How do I generate different yyparse functions from lex/yacc for use in the same program?

Posted by th on Stack Overflow See other posts from Stack Overflow or by th
Published on 2010-03-19T22:11:29Z Indexed on 2010/03/19 22:31 UTC
Read the original article Hit count: 323

Filed under:
|
|
|
|

Hi,

I want to generate two separate parsing functions from lex/yacc. Normally yacc gives you a function yyparse() that you can call when you need to do some parsing, but I need to have several different yyparses each associated with different lexers and grammars. The man page seems to suggest the -p (prefix) flag, but this didn't work for me. I got errors from gcc that indicated that yylval was not properly being relabeled (i.e. it claims that several different tokens are not defined). Does anyone know the general rpocedure for generating these separate functions?

thanks

© Stack Overflow or respective owner

Related posts about c

    Related posts about lex