|yacc and lex email@example.com (1996-02-09)|
|From:||firstname.lastname@example.org (Helmut Wais)|
|Date:||9 Feb 1996 14:22:14 -0500|
|Organization:||Customer of EUnet Germany; Info: info@Germany.EU.net|
I'm new with lex and yacc. Trying to write something like a
interpreter (using yacc because there is no yaic). It should scan a
file with a description of a data-format and at the same time scan the
data-file. Now there is something like:
while( field == 'x' )
in the description-file. yacc is reading this once, finding it
syntactically correct. For the data-file i have to pass the body of
the loop more than once. I'm thinking 'bout an array of function
pointers that are executed when yacc reduces to a while-statement, for
each statement in the loop a pointer in the array.
Now i'm not very happy with this. Does anybody have a better idea ?
Help me please, Thank you.
[The array of function pointers approach is pretty popular. I've sure used
it a lot. -John]
Return to the
Search the comp.compilers archives again.