mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
glr.c: obey the parse.assert %define variable
* data/skeletons/glr.c (YYASSERT): Rename as... (YY_ASSERT): this, for consistency with yacc.c, and also to emphasize the fact that this is not for the end user (YY_ prefix). * tests/glr-regression.at: Define parse.assert.
This commit is contained in:
@@ -41,9 +41,9 @@ static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
|
||||
%}
|
||||
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
|
||||
|
||||
/* -------- productions ------ */
|
||||
%%
|
||||
|
||||
@@ -128,6 +128,7 @@ AT_DATA_GRAMMAR([glr-regr2a.y],
|
||||
]AT_YYLEX_DECLARE[
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
|
||||
%%
|
||||
@@ -265,6 +266,7 @@ static int MergeRule (int x0, int x1);
|
||||
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
|
||||
%token BAD_CHAR
|
||||
@@ -370,6 +372,7 @@ AT_SETUP([Duplicate representation of merged trees])
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
AT_DATA_GRAMMAR([glr-regr4.y],
|
||||
[[
|
||||
%define parse.assert
|
||||
%union { char *ptr; }
|
||||
%type <ptr> S A A1 A2 B
|
||||
%glr-parser
|
||||
@@ -469,6 +472,7 @@ AT_DATA_GRAMMAR([glr-regr5.y],
|
||||
enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { int value; }
|
||||
%type <value> start
|
||||
@@ -524,6 +528,7 @@ AT_DATA_GRAMMAR([glr-regr6.y],
|
||||
]AT_YYLEX_DECLARE[
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { int value; }
|
||||
%type <value> 'a'
|
||||
@@ -580,6 +585,7 @@ AT_DATA_GRAMMAR([glr-regr7.y],
|
||||
static count_node *tail;
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { count_node *node; }
|
||||
%type <node> 'a'
|
||||
@@ -667,6 +673,7 @@ AT_DATA_GRAMMAR([glr-regr8.y],
|
||||
%token T_PORT
|
||||
%token T_SIGNAL
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
|
||||
%%
|
||||
@@ -756,6 +763,7 @@ AT_DATA_GRAMMAR([glr-regr9.y],
|
||||
# define USE(Var)
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { int dummy; }
|
||||
%type <dummy> 'a'
|
||||
@@ -831,6 +839,7 @@ AT_DATA_GRAMMAR([glr-regr10.y],
|
||||
static char garbage[GARBAGE_SIZE];
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { char *ptr; }
|
||||
%type <ptr> start
|
||||
@@ -884,6 +893,7 @@ AT_DATA_GRAMMAR([glr-regr11.y],
|
||||
# define USE(val)
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { int dummy; }
|
||||
%type <int> 'a'
|
||||
@@ -934,6 +944,7 @@ AT_SETUP([Leaked semantic values if user action cuts parse])
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
AT_DATA_GRAMMAR([glr-regr12.y],
|
||||
[[
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%union { int dummy; }
|
||||
%token PARENT_RHS_AFTER
|
||||
@@ -1073,6 +1084,7 @@ AT_DATA_GRAMMAR([glr-regr13.y],
|
||||
#define USE(value)
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%union { char value; }
|
||||
%type <value> 'a' 'b'
|
||||
%glr-parser
|
||||
@@ -1213,6 +1225,7 @@ AT_DATA_GRAMMAR([glr-regr14.y],
|
||||
#define USE(value)
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%type <value> 'a' 'b' 'c' 'd' stack_explosion
|
||||
%glr-parser
|
||||
%locations
|
||||
@@ -1397,6 +1410,7 @@ AT_SETUP([Leaked semantic values when reporting ambiguity])
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
AT_DATA_GRAMMAR([glr-regr15.y],
|
||||
[[
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%destructor { parent_rhs_before_value = 0; } parent_rhs_before
|
||||
|
||||
@@ -1479,6 +1493,7 @@ AT_SETUP([Leaked lookahead after nondeterministic parse syntax error])
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
AT_DATA_GRAMMAR([glr-regr16.y],
|
||||
[[
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%destructor { lookahead_value = 0; } 'b'
|
||||
|
||||
@@ -1540,6 +1555,7 @@ AT_BISON_OPTION_PUSHDEFS([%glr-parser %locations %define api.pure])
|
||||
|
||||
AT_DATA_GRAMMAR([glr-regr17.y],
|
||||
[[
|
||||
%define parse.assert
|
||||
%glr-parser
|
||||
%locations
|
||||
%define api.pure
|
||||
@@ -1612,7 +1628,8 @@ AT_SETUP([Missed %merge type warnings when LHS type is declared later])
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS
|
||||
AT_DATA_GRAMMAR([glr-regr18.y],
|
||||
[[%glr-parser
|
||||
[[%define parse.assert
|
||||
%glr-parser
|
||||
|
||||
%{
|
||||
#include <stdlib.h>
|
||||
@@ -1625,7 +1642,6 @@ AT_DATA_GRAMMAR([glr-regr18.y],
|
||||
int type2;
|
||||
int type3;
|
||||
}
|
||||
|
||||
%%
|
||||
|
||||
sym1: sym2 %merge<merge> { $$ = $1; } ;
|
||||
@@ -1661,14 +1677,14 @@ AT_SETUP([Ambiguity reports])
|
||||
|
||||
AT_BISON_OPTION_PUSHDEFS([%debug])
|
||||
AT_DATA_GRAMMAR([input.y],
|
||||
[[
|
||||
%{
|
||||
[[%{
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
]AT_YYERROR_DECLARE[
|
||||
]AT_YYLEX_DECLARE[
|
||||
%}
|
||||
|
||||
%define parse.assert
|
||||
%debug
|
||||
%glr-parser
|
||||
|
||||
@@ -1762,7 +1778,8 @@ AT_CLEANUP
|
||||
AT_SETUP([Predicates])
|
||||
|
||||
AT_DATA_GRAMMAR([input.y],
|
||||
[[%glr-parser
|
||||
[[%define parse.assert
|
||||
%glr-parser
|
||||
%define parse.error verbose
|
||||
%expect-rr 1
|
||||
%code requires
|
||||
|
||||
Reference in New Issue
Block a user