help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison/flex compatibility revisited


From: Bruce Lilly
Subject: Re: Bison/flex compatibility revisited
Date: Fri, 28 Feb 2003 23:44:31 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130

W. L. Estes wrote:

I find this in the bison manual, in the chapter on invoking bison:

`-p PREFIX'
`--name-prefix=PREFIX'
     Rename the external symbols used in the parser so that they start
     with PREFIX instead of `yy'.  The precise list of symbols renamed
     is `yyparse', `yylex', `yyerror', `yynerrs', `yylval', `yychar'
     and `yydebug'.

That's from not-the-most-recent version of bison, but it should still
be useful.

That's achieved by the a bunch of macros near the top of the
bison-generated y.tab.c:

/* If NAME_PREFIX is specified substitute the variables and functions
   names.  */
#define yyparse mailparse
#define yylex   maillex
#define yyerror mailerror
#define yylval  maillval
#define yychar  mailchar
#define yydebug maildebug
#define yynerrs mailnerrs

And if the flex-generated header file is included w/o YY_HEADER_NO_UNDEFS,
its #undefs proceed to trounce those macros.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]