Re: %lex-param is not working

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
Hi Timothy,

> Le 4 juin 2020 à 17:30, Timothy Krause <[email protected]> a écrit :
> 
> In the bison source file I have
> %lex-param { ps->scaninfo }
> 
> When I compile the parser I get:
> parser.tab.cpp: In function ‘int yyparse(parse_state*)’:
> parser.tab.cpp:1689:41: error: ‘scaninfo’ was not declared in this scope;
> did you mean ‘scanf’?
> 1689 |       yychar = yylex (&yylval, &yylloc, scaninfo);
> 
> The 'ps->' is missing.
> 
> Is this the correct use of %lex-param? Is there a better way to specify the
> parameter?

Please see the documentation.

https://www.gnu.org/software/bison/manual/html_node/Pure-Calling.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.