[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bad YYLEX value if %lex-param but not %pure-parser

From: Tim Van Holder
Subject: Bad YYLEX value if %lex-param but not %pure-parser
Date: Mon, 28 Apr 2003 13:44:50 +0200

Currently, if %lex-param is used, but %pure-parser is not, the YYLEX
macro gets defined with an invalid value.


%lex-param {int foo}

causes YYLEX to be 'yylex(, foo)'

(also, b4_yyerror_args uses m4_ifset to test if any were given, while
b4_lex_param uses m4_ifdef; not sure if this matters, but it gives
the appearance of being inconsistent).

2003-04-28  Tim Van Holder <address@hidden>

        * data/yacc.c: (b4_lex_param) Corrected for the case where
        %lex-param is provided and %pure-parser isn't.

Index: data/yacc.c
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.55
diff -u -u -p -d -r1.55 yacc.c
--- data/yacc.c 28 Apr 2003 06:03:58 -0000      1.55
+++ data/yacc.c 28 Apr 2003 10:33:24 -0000
@@ -58,8 +58,8 @@ m4_ifset([b4_parse_param], [b4_c_args(b4
 # b4_lex_param arrives quoted twice, but we want to keep only one level.
 m4_dquote(b4_pure_if([[[[YYSTYPE *]], [[&yylval]]][]dnl
-b4_location_if([, [[YYLTYPE *], [&yylloc]]])])dnl
-m4_ifdef([b4_lex_param], [, ]b4_lex_param)))
+b4_location_if([, [[YYLTYPE *], [&yylloc]]])m4_ifdef([b4_lex_param], [,
+m4_ifdef([b4_lex_param], b4_lex_param)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]