help_needed in bison/yacc

"vicky" <>
2 May 2005 14:28:24 -0400

          From comp.compilers

Related articles
help_needed in bison/yacc (vicky) (2005-05-02)
Re: help_needed in bison/yacc (Detlef Meyer-Eltz) (2005-05-02)
Re: help_needed in bison/yacc (Brian Inglis) (2005-05-06)
Re: help_needed in bison/yacc (Clint Olsen) (2005-06-10)
| List of all articles for this month |

From: "vicky" <>
Newsgroups: comp.compilers
Date: 2 May 2005 14:28:24 -0400
Keywords: parse, question
Posted-Date: 02 May 2005 14:28:24 EDT

hi ever1,

my input is verilog code, and i need to convert turnary expressions
into if-else statements.

please tell me if it is possible using Flex/Bison (i.e. pls tell me
how to create interperter using flex/bison).

All i wanted to say is, i don't want to take pain for writing grammer
for whole verilog code. i just want to make changes in turnary
expression. i.e. want a small script to change turnary expression into
if-else statement. pls help.

Thanks in Advance.

Vikas Talwar
[If you don't want to parse the entire program, I'd suggest a kludge
that uses regular expressions to match something like ( .* ? .* : .* )
or whatever the syntax is and then spits out the corresponding
if/then/else. My experience suggests that if you want to do a complete
job, you'll end up having to parse the whole language, but if you're willing
to have it give up on the hardest ones and leave them for hand repair,
the kludge works pretty well. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.