bison-patches
[Top][All Lists]
Advanced

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

test suite yylloc and yylval


From: Joel E. Denny
Subject: test suite yylloc and yylval
Date: Sun, 18 Sep 2005 21:27:39 -0400 (EDT)

I am preparing a GLR patch for the incorrect yychar problem and a new
patch for the duplicated user destructor for lookaheads:

  http://lists.gnu.org/archive/html/help-bison/2005-07/msg00017.html
  http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00019.html

Along the way, I've noticed an issue in the test suite that interferes
with one of my patches.  Some tests declare yylloc and yylval as pointer
arguments. It seems more logical to name them yyllocp and yylvalp.
Moreover, if a skeleton should need to #define yylloc or yylval in a
nontrivial manner (as pure GLR already does yychar), it won't break the
test suite this way.

Joel

Index: calc.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/calc.at,v
retrieving revision 1.77
diff -p -u -r1.77 calc.at
--- calc.at     22 Aug 2005 02:31:10 -0000      1.77
+++ calc.at     19 Sep 2005 01:09:26 -0000
@@ -72,7 +72,7 @@ static int power (int base, int exponent
 [/* yyerror receives the location if:
    - %location & %pure & %glr
    - %location & %pure & %yacc & %parse-param. */
-static void yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])
+static void yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *yyllocp, ])
                      AT_PARAM_IF([semantic_value *result, int *count, ])
                      const char *s
                      );])[
@@ -145,7 +145,7 @@ yyparse (AT_PARAM_IF([semantic_value *re
 }
 ],
 [static void
-yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])
+yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *yyllocp, ])
          AT_PARAM_IF([semantic_value *result, int *count, ])
          const char *s)
 {
Index: local.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/local.at,v
retrieving revision 1.11
diff -p -u -r1.11 local.at
--- local.at    25 Aug 2005 08:53:33 -0000      1.11
+++ local.at    19 Sep 2005 01:09:26 -0000
@@ -79,14 +79,14 @@ m4_pushdef([AT_PURE_LEX_IF],
             [AT_LALR1_CC_IF([$1], [$2])])])

 AT_PURE_LEX_IF(
-[m4_pushdef([AT_LOC], [(*yylloc)])
- m4_pushdef([AT_VAL], [(*yylval)])
+[m4_pushdef([AT_LOC], [(*yyllocp)])
+ m4_pushdef([AT_VAL], [(*yylvalp)])
  m4_pushdef([AT_LEX_FORMALS],
-            [YYSTYPE *yylval[]AT_LOCATION_IF([, YYLTYPE *yylloc])])
+            [YYSTYPE *yylvalp[]AT_LOCATION_IF([, YYLTYPE *yyllocp])])
  m4_pushdef([AT_LEX_ARGS],
-            [yylval[]AT_LOCATION_IF([, yylloc])])
+            [yylvalp[]AT_LOCATION_IF([, yyllocp])])
  m4_pushdef([AT_USE_LEX_ARGS],
-            [(void) yylval;AT_LOCATION_IF([(void) yylloc])])
+            [(void) yylvalp;AT_LOCATION_IF([(void) yyllocp])])
  m4_pushdef([AT_LEX_PRE_FORMALS],
             [AT_LEX_FORMALS, ])
  m4_pushdef([AT_LEX_PRE_ARGS],





reply via email to

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