Re: help on reentrant parser in bison

Mats Luspa <mats@snake.irf.se>
Tue, 14 Nov 1995 07:53:32 GMT

          From comp.compilers

Related articles
help on reentrant parser in bison hnair@msmail.sapient.com (Hari Nair) (1995-11-11)
Re: help on reentrant parser in bison mats@snake.irf.se (Mats Luspa) (1995-11-14)
| List of all articles for this month |
Newsgroups: comp.compilers
From: Mats Luspa <mats@snake.irf.se>
Keywords: yacc
Organization: Compilers Central
Date: Tue, 14 Nov 1995 07:53:32 GMT

When you want to use an reentrant parser in bison with the declaration
%pure_parser the effect is that the two communication variables become local
variables in yyparse, and a different calling convention is used for yylex.
The communcation variables yylval and yylloc are usually global but as told
they become local in the reentrant parser. Therefore you must replace them
with pointers passed as arguments to yylex. The call to yylex will now be
yylex(YYSTYPE* lvalp, YYLTYPE* llocp).
To set a value you of course use *lvalp=value.
If you have access to a WWW-browser you can obtain this information from
http://www.cs.utah.edu/csinfo/texinfo/bison/bison.html.


/Regards Mats L
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.