> On 13 Aug 2018, at 22:30, David Barto <[email protected]> wrote:
> 
> I’m not a bison/yacc/flex expert. I probably don’t even qualify as a novice.
> 
> We have some very (very very) old yacc files that bison 2.7.12 does just fine 
> with. When I attempt to use bison-3.0.5 I get the following error.
> 
> /Users/barto/UnixEnvironment/CSI/repo5/source/parse/sbxgrammar.y: In function 
> 'int sbx::yyparse()':
> /Users/barto/UnixEnvironment/CSI/repo5/source/parse/sbxgrammar.y:461:7: 
> error: 'pstate' was not declared in this scope
>      { pstate->parsetree = $1; }
>       ^~~~~~
> 
> Our Yacc file has the following:
> #define YYPARSE_PARAM nuthin UNUSED, ParserState *pstate, Q_alloc *heap
> 
> And the old bison output the following, which used that YYPARSE_PARAM to 
> generate the interface for yyparse that we call.
> 
> #ifdef YYPARSE_PARAM
> #if defined __STDC__ || defined __cplusplus
> int yyparse (void *YYPARSE_PARAM);
> #else
> int yyparse ();
> #endif
> #else /* ! YYPARSE_PARAM */
> #if defined __STDC__ || defined __cplusplus
> int yyparse (void);
> #else
> int yyparse ();
> #endif
> #endif /* ! YYPARSE_PARAM */
> 
> What do I need to do to get the new bison to generate the interface we need. 

It is described in the Bison 3.0.5 manual, "The Parser Function yyparse", sec. 
4.1.

It looks like you might try
  %parse-param {ParserState *pstate} {Q_alloc *heap}





_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to