|Passing a parameter to yylex thru yyparse email@example.com (Gwenakl Lambrouin) (1998-04-29)|
|From:||"Gwenakl Lambrouin" <firstname.lastname@example.org>|
|Date:||29 Apr 1998 22:34:58 -0400|
|Organization:||Cincom Systems, Inc., Cincinnati OH|
|Keywords:||lex, question, comment|
I'm writing a parser using Bison 1.2.4 and Flex 2.5.1.
I'm calling yyparse from a C function, and I'd like to pass a parameter
(void*) to yylex. I want yylex to set up my parameter while scanning. I
don't want the parameter to be global.
So I've got to pass the parameter to yyparse, and then yyparse has to
pass it to yylex.
I don't know if it's possible to do so, without modifying to much the
generated parser. If possible, I'd like to modify only the grammar file.
Thanks for any help.
[Considering the enormous amount of state that lex keeps in static data,
I don't see why one more word of static info is a problem. -John]
Return to the
Search the comp.compilers archives again.