Hi David, have a look at the %parse-param directive:
https://www.gnu.org/software/bison/manual/bison.html#C_002b_002b-Parser-Interface Yours, Alex On 13.08.2018 22:30, David Barto 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. > I’ve run duckduckgo until I can’t think of any more options to get guided > assistance, and I’ve read the email list back issues looking for any guidance > there. > > David > > > David Barto > [email protected] > > Sometimes, my best code does nothing. Most of the rest of it has bugs. > > > > > _______________________________________________ > [email protected] https://lists.gnu.org/mailman/listinfo/help-bison > _______________________________________________ [email protected] https://lists.gnu.org/mailman/listinfo/help-bison
