From e2688cd96e3f6835381cec7811d45d8548053d06 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 14 Jul 2005 23:15:47 +0000 Subject: [PATCH] * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined. (yyuserMerge): Provide a default case if b4_mergers is empty. * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE. * tests/glr-regression.at (Improper handling of embedded actions and dollar(-N) in GLR parsers): YYSTYPE is char *, not char const *, so that strcpy ($$, ...) works. --- ChangeLog | 6 ++++++ data/glr.c | 16 +++++++++------- tests/cxx-type.at | 1 + tests/glr-regression.at | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b543983..6343ff28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ 2005-07-14 Paul Eggert Fix problems reported by twlevo@xs4all.nl. + * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined. + (yyuserMerge): Provide a default case if b4_mergers is empty. + * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE. + * tests/glr-regression.at + (Improper handling of embedded actions and dollar(-N) in GLR parsers): + YYSTYPE is char *, not char const *, so that strcpy ($$, ...) works. * tests/glr-regression.at (Improper merging of GLR delayed action sets): Declare yylex before using it. * tests/Makefile.am (maintainer-check-g++): Fix a stray diff --git a/data/glr.c b/data/glr.c index 0f38c2d6..f9835ada 100644 --- a/data/glr.c +++ b/data/glr.c @@ -556,13 +556,14 @@ int yydebug; properly redirected to new data. */ #define YYHEADROOM 2 -#if (! defined (YYSTACKEXPANDABLE) \ - && (! defined (__cplusplus) \ - || (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \ - && ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) -#define YYSTACKEXPANDABLE 1 -#else -#define YYSTACKEXPANDABLE 0 +#ifndef YYSTACKEXPANDABLE +# if (! defined (__cplusplus) \ + || (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \ + && ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)) +# define YYSTACKEXPANDABLE 1 +# else +# define YYSTACKEXPANDABLE 0 +# endif #endif #if YYERROR_VERBOSE @@ -812,6 +813,7 @@ yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1) switch (yyn) { b4_mergers + default: break; } } [ diff --git a/tests/cxx-type.at b/tests/cxx-type.at index e5b8778c..f9c093c5 100644 --- a/tests/cxx-type.at +++ b/tests/cxx-type.at @@ -38,6 +38,7 @@ $1 ]m4_bmatch([$2], [stmtMerge], [ static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);])[ #define YYINITDEPTH 10 + #define YYSTACKEXPANDABLE 1 static char *format (char const *, ...); struct YYLTYPE; #if YYPURE diff --git a/tests/glr-regression.at b/tests/glr-regression.at index df27f0a9..ae15e4cf 100644 --- a/tests/glr-regression.at +++ b/tests/glr-regression.at @@ -121,7 +121,7 @@ AT_DATA_GRAMMAR([glr-regr2a.y], /* Reported by S. Eken */ %{ - #define YYSTYPE char const * + #define YYSTYPE char * #define yyfalse 0 #define yytrue 1 -- 2.45.2