> I'm having a problem building a reentrant parser. Here's the simple > test I'm doing, as suggested by the flex documentation. This is using > flex 2.5.31 and bison 2.1 on x86_64 using g++ 4.0.2 on Fedora Core. > Please send any suggestions or help. > > +++ begin file slex.l +++ > /* Scanner for "C" assignment statements... sort of. */ > %{ > #include "sparse.tab.h" /* Generated by bison. */ > %} > %option bison-bridge bison-locations > > %% > > [[:digit:]]+ { yylval->num = atoi(yytext); return NUMBER;} > [[:alnum:]]+ { yylval->str = strdup(yytext); return STRING;} > "="|";" { return yytext[0];} > . {} > > %% > > +++ end of slex.l, begin sparse.y +++ > /* Parser to convert "C" assignments to lisp. */ > %{ > /* Pass the argument to yyparse through to yylex. */ > #define YYPARSE_PARAM scanner > #define YYLEX_PARAM scanner > #include <stdio.h> > %} > %locations > %pure_parser
You want %pure-parser. Bob Rossi _______________________________________________ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison