From a6c99f406234cb6396e2586b9dc80050ab27e848 Mon Sep 17 00:00:00 2001 From: xaizek Date: Mon, 30 Oct 2017 21:51:56 +0200 Subject: [PATCH] Update elkhound/grampar.y for modern bison Where "modern" is bison 3.* or so. --- elkhound/grampar.y | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/elkhound/grampar.y b/elkhound/grampar.y index 86b4981..7198526 100644 --- a/elkhound/grampar.y +++ b/elkhound/grampar.y @@ -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(, 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 @@ -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 ============================ */