Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update elkhound/grampar.y for bison 3.* #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions elkhound/grampar.y
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@
#define YYDEBUG 1
#endif

// name of extra parameter to yylex
#define YYLEX_PARAM parseParam

// make it call my yylex
#define yylex(lv, param) grampar_yylex(lv, param)

// Bison calls yyerror(msg) on error; we need the extra
// parameter too, so the macro shoehorns it in there
#define yyerror(msg) grampar_yyerror(msg, YYPARSE_PARAM)
// Bison calls yyerror(<params>, msg) on error
#define yyerror(param, msg) grampar_yyerror(msg, param)

// rename the externally-visible parsing routine to make it
// specific to this instance, so multiple bison-generated
Expand Down Expand Up @@ -59,7 +55,10 @@ AssocKind whichKind(LocString * /*owner*/ kind);

/* ================== bison declarations =================== */
// don't use globals
%pure_parser
%define api.pure full

// extra parameter to both parser and lexer
%param {void *parseParam}


/* ===================== tokens ============================ */
Expand Down