From f2b30bdf3713e6fa9fafd0fc6caed68e38248ebc Mon Sep 17 00:00:00 2001 From: "Joel E. Denny" Date: Tue, 25 Aug 2009 19:41:49 -0400 Subject: [PATCH] More fixes related to last two patches. * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE comments: zero indicates syntax error not default action. * data/c.m4 (b4_table_value_equals): Comment that YYID must be defined. * data/glr.c (yyis_pact_ninf): Rename to... (yypact_value_is_default): ... this. (yyisDefaultedState): Update for rename. (yyis_table_ninf): Rename to... (yytable_value_is_error): ... this, and check for value zero besides just YYTABLE_NINF. (yygetLRActions): Check for default value from yypact. It appears that this check is always performed before this function is invoked, and so adding the check here is probably redundant. However, the code may evolve after this subtlety is forgotten. Also, update for rename to yytable_value_is_error. Because that macro now checks for zero, a different but equivalent branch of the if-then-else here is evaluated. (yyreportSyntaxError): Update for rename to yytable_value_is_error. The zero condition was mishandled before. (yyrecoverSyntaxError): Update for renames. No behavioral changes. * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_): New function. (yy_table_value_is_error_): New function. (parse): Use new functions where possible. No behavioral changes. (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_. The zero condition was mishandled before. * data/yacc.c (yyis_pact_ninf): Rename to... (yypact_value_is_default): ... this. (yyis_table_ninf): Rename to... (yytable_value_is_error): ... this, and check for value zero besides just YYTABLE_NINF. (yysyntax_error): Update for rename to yytable_value_is_error. The zero condition was mishandled before. (yyparse): Update for renames. No behavioral changes. * src/tables.h: Improve comments about yypact, yytable, etc. more. Most importantly, say yytable value of zero means syntax error not default action. --- ChangeLog | 44 +++++ data/bison.m4 | 3 +- data/c.m4 | 3 +- data/glr.c | 22 +-- data/lalr1.cc | 28 ++- data/lalr1.java | 28 ++- data/yacc.c | 15 +- src/parse-gram.c | 438 +++++++++++++++++++++++------------------------ src/parse-gram.h | 6 +- src/tables.h | 58 ++++--- 10 files changed, 367 insertions(+), 278 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6624a0ce..22a2a3c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2009-08-25 Joel E. Denny + + More fixes related to last two patches. + * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE + comments: zero indicates syntax error not default action. + * data/c.m4 (b4_table_value_equals): Comment that YYID must be + defined. + * data/glr.c (yyis_pact_ninf): Rename to... + (yypact_value_is_default): ... this. + (yyisDefaultedState): Update for rename. + (yyis_table_ninf): Rename to... + (yytable_value_is_error): ... this, and check for value zero + besides just YYTABLE_NINF. + (yygetLRActions): Check for default value from yypact. It + appears that this check is always performed before this function + is invoked, and so adding the check here is probably redundant. + However, the code may evolve after this subtlety is forgotten. + Also, update for rename to yytable_value_is_error. Because that + macro now checks for zero, a different but equivalent branch of + the if-then-else here is evaluated. + (yyreportSyntaxError): Update for rename to + yytable_value_is_error. The zero condition was mishandled + before. + (yyrecoverSyntaxError): Update for renames. No behavioral + changes. + * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_): + New function. + (yy_table_value_is_error_): New function. + (parse): Use new functions where possible. No behavioral + changes. + (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_. + The zero condition was mishandled before. + * data/yacc.c (yyis_pact_ninf): Rename to... + (yypact_value_is_default): ... this. + (yyis_table_ninf): Rename to... + (yytable_value_is_error): ... this, and check for value zero + besides just YYTABLE_NINF. + (yysyntax_error): Update for rename to yytable_value_is_error. + The zero condition was mishandled before. + (yyparse): Update for renames. No behavioral changes. + * src/tables.h: Improve comments about yypact, yytable, etc. + more. Most importantly, say yytable value of zero means syntax + error not default action. + 2009-08-25 Joel E. Denny Fix %error-verbose for conflicts resolved by %nonassoc. diff --git a/data/bison.m4 b/data/bison.m4 index 4ca6ceea..ef8f778e 100644 --- a/data/bison.m4 +++ b/data/bison.m4 @@ -266,8 +266,7 @@ $1([defgoto], [b4_defgoto], [[YYDEFGOTO[NTERM-NUM].]]) $1([table], [b4_table], [[YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which -number is the opposite. If zero, do what YYDEFACT says. -If YYTABLE_NINF, syntax error.]]) +number is the opposite. If zero or YYTABLE_NINF, syntax error.]]) $1([check], [b4_check]) diff --git a/data/c.m4 b/data/c.m4 index 3ba48db5..5cd404d1 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -161,7 +161,8 @@ m4_define([b4_int_type_for], # -------------------------------------------- # Without inducing a comparison warning from the compiler, check if the # literal value LITERAL equals VALUE from table TABLE, which must have -# TABLE_min and TABLE_max defined. +# TABLE_min and TABLE_max defined. YYID must be defined as an identity +# function that suppresses warnings about constant conditions. m4_define([b4_table_value_equals], [m4_if(m4_eval($3 < m4_indir([b4_]$1[_min]) || m4_indir([b4_]$1[_max]) < $3), [1], diff --git a/data/glr.c b/data/glr.c index 85a5affd..8d37070c 100644 --- a/data/glr.c +++ b/data/glr.c @@ -953,7 +953,7 @@ yylhsNonterm (yyRuleNum yyrule) return yyr1[yyrule]; } -#define yyis_pact_ninf(yystate) \ +#define yypact_value_is_default(yystate) \ ]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[ /** True iff LR state STATE has only a default reduction (regardless @@ -961,7 +961,7 @@ yylhsNonterm (yyRuleNum yyrule) static inline yybool yyisDefaultedState (yyStateNum yystate) { - return yyis_pact_ninf (yypact[yystate]); + return yypact_value_is_default (yypact[yystate]); } /** The default reduction for STATE, assuming it has one. */ @@ -971,8 +971,9 @@ yydefaultAction (yyStateNum yystate) return yydefact[yystate]; } -#define yyis_table_ninf(yytable_value) \ - ]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[ +#define yytable_value_is_error(yytable_value) \ + (]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[ \ + || ]b4_table_value_equals([[table]], [[yytable_value]], [[0]])[) /** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN. * Result R means @@ -987,12 +988,13 @@ yygetLRActions (yyStateNum yystate, int yytoken, int* yyaction, const short int** yyconflicts) { int yyindex = yypact[yystate] + yytoken; - if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken) + if (yypact_value_is_default (yypact[yystate]) + || yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken) { *yyaction = -yydefact[yystate]; *yyconflicts = yyconfl; } - else if (! yyis_table_ninf (yytable[yyindex])) + else if (! yytable_value_is_error (yytable[yyindex])) { *yyaction = yytable[yyindex]; *yyconflicts = yyconfl + yyconflp[yyindex]; @@ -2061,7 +2063,7 @@ yyreportSyntaxError (yyGLRStack* yystackp]b4_user_formals[) for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yyis_table_ninf (yytable[yyx + yyn])) + && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { @@ -2172,7 +2174,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } yyj = yypact[yystackp->yytops.yystates[0]->yylrState]; - if (yyis_pact_ninf (yyj)) + if (yypact_value_is_default (yyj)) return; yyj += yytoken; if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken) @@ -2180,7 +2182,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0) return; } - else if (yytable[yyj] != 0 && ! yyis_table_ninf (yytable[yyj])) + else if (! yytable_value_is_error (yytable[yyj])) return; } @@ -2201,7 +2203,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[) { yyGLRState *yys = yystackp->yytops.yystates[0]; yyj = yypact[yys->yylrState]; - if (! yyis_pact_ninf (yyj)) + if (! yypact_value_is_default (yyj)) { yyj += YYTERROR; if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR diff --git a/data/lalr1.cc b/data/lalr1.cc index 1e4c856a..36c8d581 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -245,6 +245,14 @@ do { \ /// \param yylhs the nonterminal to push on the stack state_type yy_lr_goto_state_ (state_type yystate, int yylhs); + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + /// Internal symbol numbers. typedef ]b4_int_type_for([b4_translate])[ token_number_type; static const ]b4_int_type(b4_pact_ninf, b4_pact_ninf)[ yypact_ninf_; @@ -651,6 +659,18 @@ b4_percent_code_get[]dnl return yydefgoto_[yylhs - yyntokens_]; } + inline bool + ]b4_parser_class_name[::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + inline bool + ]b4_parser_class_name[::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == 0 || yyvalue == yytable_ninf_; + } + int ]b4_parser_class_name[::parse () { @@ -709,7 +729,7 @@ m4_popdef([b4_at_dollar])])dnl /* Try to take a decision without lookahead. */ yyn = yypact_[yystack_[0].state]; - if (yyn == yypact_ninf_) + if (yy_pact_value_is_default_ (yyn)) goto yydefault; /* Read a lookahead token. */ @@ -737,7 +757,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[ yyn = yytable_[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == yytable_ninf_) + if (yy_table_value_is_error_ (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -887,7 +907,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[ for (;;) { yyn = yypact_[yystack_[0].state]; - if (yyn != yypact_ninf_) + if (!yy_pact_value_is_default_ (yyn)) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) @@ -972,7 +992,7 @@ b4_error_verbose_if([state_type yystate, int yytoken], yyarg[yycount++] = yytname_[yytoken]; for (int yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ - && yytable_[yyx + yyn] != yytable_ninf_) + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { diff --git a/data/lalr1.java b/data/lalr1.java index 646b7772..5f0cfd76 100644 --- a/data/lalr1.java +++ b/data/lalr1.java @@ -533,7 +533,7 @@ m4_popdef([b4_at_dollar])])dnl /* Take a decision. First try without lookahead. */ yyn = yypact_[yystate]; - if (yyn == yypact_ninf_) + if (yy_pact_value_is_default_ (yyn)) { label = YYDEFAULT; break; @@ -572,7 +572,7 @@ m4_popdef([b4_at_dollar])])dnl /* <= 0 means reduce or error. */ else if ((yyn = yytable_[yyn]) <= 0) { - if (yyn == 0 || yyn == yytable_ninf_) + if (yy_table_value_is_error_ (yyn)) label = YYFAIL; else { @@ -676,7 +676,7 @@ m4_popdef([b4_at_dollar])])dnl for (;;) { yyn = yypact_[yystate]; - if (yyn != yypact_ninf_) + if (!yy_pact_value_is_default_ (yyn)) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) @@ -745,7 +745,7 @@ m4_popdef([b4_at_dollar])])dnl int count = 0; for (int x = yyxbegin; x < yyxend; ++x) if (yycheck_[x + yyn] == x && x != yyterror_ - && yycheck_[x + yyn] != yytable_ninf_) + && !yy_table_value_is_error_ (yycheck_[x + yyn])) ++count; // FIXME: This method of building the message is not compatible @@ -757,7 +757,7 @@ m4_popdef([b4_at_dollar])])dnl count = 0; for (int x = yyxbegin; x < yyxend; ++x) if (yycheck_[x + yyn] == x && x != yyterror_ - && yycheck_[x + yyn] != yytable_ninf_) + && !yy_table_value_is_error_ (yycheck_[x + yyn])) { res.append (count++ == 0 ? ", expecting " : " or "); res.append (yytnamerr_ (yytname_[x])); @@ -770,6 +770,24 @@ m4_popdef([b4_at_dollar])])dnl return "syntax error"; } + /** + * Whether the given yypact_ value indicates a defaulted state. + * @@param yyvalue the value to check + */ + private static boolean yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + /** + * Whether the given yytable_ value indicates a syntax error. + * @@param yyvalue the value to check + */ + private static boolean yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == 0 || yyvalue == yytable_ninf_; + } + private static final ]b4_int_type_for([b4_pact])[ yypact_ninf_ = ]b4_pact_ninf[; private static final ]b4_int_type_for([b4_table])[ yytable_ninf_ = ]b4_table_ninf[; diff --git a/data/yacc.c b/data/yacc.c index acc1118e..505b09e6 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -525,13 +525,14 @@ static const ]b4_int_type_for([b4_toknum])[ yytoknum[] = #define YYPACT_NINF ]b4_pact_ninf[ -#define yyis_pact_ninf(yystate) \ +#define yypact_value_is_default(yystate) \ ]b4_table_value_equals([[pact]], [[yystate]], [b4_pact_ninf])[ #define YYTABLE_NINF ]b4_table_ninf[ -#define yyis_table_ninf(yytable_value) \ - ]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[ +#define yytable_value_is_error(yytable_value) \ + (]b4_table_value_equals([[table]], [[yytable_value]], [b4_table_ninf])[ \ + || ]b4_table_value_equals([[table]], [[yytable_value]], [[0]])[) ]b4_parser_tables_define[ @@ -870,7 +871,7 @@ yysyntax_error (char *yyresult, int yystate, int yytoken) for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yyis_table_ninf (yytable[yyx + yyn])) + && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { @@ -1279,7 +1280,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyis_pact_ninf (yyn)) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1329,7 +1330,7 @@ yyread_pushed_token:]])[ yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyis_table_ninf (yyn)) + if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1513,7 +1514,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yyis_pact_ninf (yyn)) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) diff --git a/src/parse-gram.c b/src/parse-gram.c index 2389bc11..73bf2349 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.4.386-e6c849. */ +/* A Bison parser, made by GNU Bison 2.4.388-53f03. */ /* Implementation for Bison's Yacc-like parsers in C @@ -45,7 +45,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.386-e6c849" +#define YYBISON_VERSION "2.4.388-53f03" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -674,13 +674,14 @@ static const yytype_uint16 yytoknum[] = #define YYPACT_NINF -53 -#define yyis_pact_ninf(yystate) \ +#define yypact_value_is_default(yystate) \ ((yystate) == (-53)) #define YYTABLE_NINF -106 -#define yyis_table_ninf(yytable_value) \ - YYID (0) +#define yytable_value_is_error(yytable_value) \ + (YYID (0) \ + || ((yytable_value) == (0))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ @@ -745,8 +746,7 @@ static const yytype_int16 yydefgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If zero or YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 77, -105, 79, 73, 104, 3, 4, 5, 6, 7, @@ -990,154 +990,154 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp) { case 3: // "string" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 183 "parse-gram.y" { fputs (quotearg_style (c_quoting_style, ((*yyvaluep).chars)), stderr); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 998 "src/parse-gram.c" break; case 4: // "integer" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 196 "parse-gram.y" { fprintf (stderr, "%d", ((*yyvaluep).integer)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1007 "src/parse-gram.c" break; case 24: // "%" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 192 "parse-gram.y" { fprintf (stderr, "%%%s", ((*yyvaluep).uniqstr)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1016 "src/parse-gram.c" break; case 42: // "{...}" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 185 "parse-gram.y" { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).code)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1025 "src/parse-gram.c" break; case 43: // "char" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 177 "parse-gram.y" { fputs (char_name (((*yyvaluep).character)), stderr); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1034 "src/parse-gram.c" break; case 44: // "epilogue" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 185 "parse-gram.y" { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1043 "src/parse-gram.c" break; case 46: // "identifier" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 190 "parse-gram.y" { fputs (((*yyvaluep).uniqstr), stderr); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1052 "src/parse-gram.c" break; case 47: // "identifier:" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 191 "parse-gram.y" { fprintf (stderr, "%s:", ((*yyvaluep).uniqstr)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1061 "src/parse-gram.c" break; case 50: // "%{...%}" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 185 "parse-gram.y" { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1070 "src/parse-gram.c" break; case 52: // "" -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 193 "parse-gram.y" { fprintf (stderr, "<%s>", ((*yyvaluep).uniqstr)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1079 "src/parse-gram.c" break; case 83: // variable -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 190 "parse-gram.y" { fputs (((*yyvaluep).uniqstr), stderr); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1088 "src/parse-gram.c" break; case 84: // content.opt -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 185 "parse-gram.y" { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1097 "src/parse-gram.c" break; case 85: // braceless -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 185 "parse-gram.y" { fprintf (stderr, "{\n%s\n}", ((*yyvaluep).chars)); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1106 "src/parse-gram.c" break; case 86: // id -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 199 "parse-gram.y" { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1115 "src/parse-gram.c" break; case 87: // id_colon -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 200 "parse-gram.y" { fprintf (stderr, "%s:", ((*yyvaluep).symbol)->tag); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1124 "src/parse-gram.c" break; case 88: // symbol -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 199 "parse-gram.y" { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1133 "src/parse-gram.c" break; case 89: // string_as_id -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 199 "parse-gram.y" { fprintf (stderr, "%s", ((*yyvaluep).symbol)->tag); } -/* Line 653 of yacc.c */ +/* Line 654 of yacc.c */ #line 1142 "src/parse-gram.c" break; @@ -1420,7 +1420,7 @@ yysyntax_error (char *yyresult, int yystate, int yytoken) for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yyis_table_ninf (yytable[yyx + yyn])) + && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { @@ -1653,7 +1653,7 @@ YYLTYPE yylloc; #endif /* User initialization code. */ -/* Line 1175 of yacc.c */ +/* Line 1176 of yacc.c */ #line 86 "parse-gram.y" { /* Bison's grammar can initial empty locations, hence a default @@ -1661,7 +1661,7 @@ YYLTYPE yylloc; boundary_set (&yylloc.start, current_file, 1, 1); boundary_set (&yylloc.end, current_file, 1, 1); } -/* Line 1175 of yacc.c */ +/* Line 1176 of yacc.c */ #line 1666 "src/parse-gram.c" yylsp[0] = yylloc; @@ -1761,7 +1761,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyis_pact_ninf (yyn)) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1792,7 +1792,7 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyis_table_ninf (yyn)) + if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; @@ -1848,7 +1848,7 @@ yyreduce: switch (yyn) { case 6: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 223 "parse-gram.y" { code_props plain_code; @@ -1859,106 +1859,106 @@ yyreduce: plain_code.code, (yylsp[0])); code_scanner_last_string_free (); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1864 "src/parse-gram.c" break; case 7: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 233 "parse-gram.y" { muscle_percent_define_ensure ((yyvsp[0].uniqstr), (yylsp[0]), true); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1874 "src/parse-gram.c" break; case 8: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 237 "parse-gram.y" { muscle_percent_define_insert ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1885 "src/parse-gram.c" break; case 9: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 241 "parse-gram.y" { defines_flag = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1893 "src/parse-gram.c" break; case 10: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 243 "parse-gram.y" { defines_flag = true; spec_defines_file = xstrdup ((yyvsp[0].chars)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1904 "src/parse-gram.c" break; case 11: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 248 "parse-gram.y" { muscle_percent_define_insert ("parse.error", (yylsp[0]), "verbose", MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1915 "src/parse-gram.c" break; case 12: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 252 "parse-gram.y" { expected_sr_conflicts = (yyvsp[0].integer); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1923 "src/parse-gram.c" break; case 13: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 253 "parse-gram.y" { expected_rr_conflicts = (yyvsp[0].integer); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1931 "src/parse-gram.c" break; case 14: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 254 "parse-gram.y" { spec_file_prefix = (yyvsp[0].chars); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1939 "src/parse-gram.c" break; case 15: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 255 "parse-gram.y" { spec_file_prefix = (yyvsp[0].chars); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1947 "src/parse-gram.c" break; case 16: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 257 "parse-gram.y" { nondeterministic_parser = true; glr_parser = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1958 "src/parse-gram.c" break; case 17: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 262 "parse-gram.y" { code_props action; @@ -1968,92 +1968,92 @@ yyreduce: muscle_code_grow ("initial_action", action.code, (yylsp[0])); code_scanner_last_string_free (); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1973 "src/parse-gram.c" break; case 18: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 270 "parse-gram.y" { language_argmatch ((yyvsp[0].chars), grammar_prio, (yylsp[-1])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1981 "src/parse-gram.c" break; case 19: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 271 "parse-gram.y" { add_param ("lex_param", (yyvsp[0].code), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1989 "src/parse-gram.c" break; case 20: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 272 "parse-gram.y" { spec_name_prefix = (yyvsp[0].chars); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 1997 "src/parse-gram.c" break; case 21: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 273 "parse-gram.y" { spec_name_prefix = (yyvsp[0].chars); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2005 "src/parse-gram.c" break; case 22: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 274 "parse-gram.y" { no_lines_flag = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2013 "src/parse-gram.c" break; case 23: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 275 "parse-gram.y" { nondeterministic_parser = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2021 "src/parse-gram.c" break; case 24: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 276 "parse-gram.y" { spec_outfile = (yyvsp[0].chars); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2029 "src/parse-gram.c" break; case 25: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 277 "parse-gram.y" { spec_outfile = (yyvsp[0].chars); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2037 "src/parse-gram.c" break; case 26: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 278 "parse-gram.y" { add_param ("parse_param", (yyvsp[0].code), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2045 "src/parse-gram.c" break; case 27: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 279 "parse-gram.y" { version_check (&(yylsp[0]), (yyvsp[0].chars)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2053 "src/parse-gram.c" break; case 28: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 281 "parse-gram.y" { char const *skeleton_user = (yyvsp[0].chars); @@ -2078,46 +2078,46 @@ yyreduce: } skeleton_arg (skeleton_user, grammar_prio, (yylsp[-1])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2083 "src/parse-gram.c" break; case 29: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 304 "parse-gram.y" { token_table_flag = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2091 "src/parse-gram.c" break; case 30: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 305 "parse-gram.y" { report_flag |= report_states; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2099 "src/parse-gram.c" break; case 31: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 306 "parse-gram.y" { yacc_flag = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2107 "src/parse-gram.c" break; case 35: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 314 "parse-gram.y" { grammar_start_symbol_set ((yyvsp[0].symbol), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2117 "src/parse-gram.c" break; case 36: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 318 "parse-gram.y" { symbol_list *list; @@ -2125,12 +2125,12 @@ yyreduce: symbol_list_destructor_set (list, (yyvsp[-1].code), (yylsp[-1])); symbol_list_free ((yyvsp[0].list)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2130 "src/parse-gram.c" break; case 37: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 325 "parse-gram.y" { symbol_list *list; @@ -2138,32 +2138,32 @@ yyreduce: symbol_list_printer_set (list, (yyvsp[-1].code), (yylsp[-1])); symbol_list_free ((yyvsp[0].list)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2143 "src/parse-gram.c" break; case 38: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 332 "parse-gram.y" { default_prec = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2153 "src/parse-gram.c" break; case 39: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 336 "parse-gram.y" { default_prec = false; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2163 "src/parse-gram.c" break; case 40: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 340 "parse-gram.y" { /* Do not invoke muscle_percent_code_grow here since it invokes @@ -2171,89 +2171,89 @@ yyreduce: muscle_code_grow ("percent_code()", (yyvsp[0].chars), (yylsp[0])); code_scanner_last_string_free (); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2176 "src/parse-gram.c" break; case 41: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 347 "parse-gram.y" { muscle_percent_code_grow ((yyvsp[-1].uniqstr), (yylsp[-1]), (yyvsp[0].chars), (yylsp[0])); code_scanner_last_string_free (); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2187 "src/parse-gram.c" break; case 42: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 361 "parse-gram.y" {} -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2195 "src/parse-gram.c" break; case 43: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 362 "parse-gram.y" { muscle_code_grow ("union_name", (yyvsp[0].uniqstr), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2203 "src/parse-gram.c" break; case 44: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 367 "parse-gram.y" { union_seen = true; muscle_code_grow ("stype", (yyvsp[0].chars), (yylsp[0])); code_scanner_last_string_free (); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2215 "src/parse-gram.c" break; case 45: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 378 "parse-gram.y" { current_class = nterm_sym; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2223 "src/parse-gram.c" break; case 46: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 379 "parse-gram.y" { current_class = unknown_sym; current_type = NULL; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2234 "src/parse-gram.c" break; case 47: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 383 "parse-gram.y" { current_class = token_sym; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2242 "src/parse-gram.c" break; case 48: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 384 "parse-gram.y" { current_class = unknown_sym; current_type = NULL; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2253 "src/parse-gram.c" break; case 49: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 389 "parse-gram.y" { symbol_list *list; @@ -2262,12 +2262,12 @@ yyreduce: symbol_type_set (list->content.sym, (yyvsp[-1].uniqstr), (yylsp[-1])); symbol_list_free ((yyvsp[0].list)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2267 "src/parse-gram.c" break; case 50: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 400 "parse-gram.y" { symbol_list *list; @@ -2280,202 +2280,202 @@ yyreduce: symbol_list_free ((yyvsp[0].list)); current_type = NULL; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2285 "src/parse-gram.c" break; case 51: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 414 "parse-gram.y" { (yyval.assoc) = left_assoc; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2293 "src/parse-gram.c" break; case 52: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 415 "parse-gram.y" { (yyval.assoc) = right_assoc; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2301 "src/parse-gram.c" break; case 53: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 416 "parse-gram.y" { (yyval.assoc) = non_assoc; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2309 "src/parse-gram.c" break; case 54: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 417 "parse-gram.y" { (yyval.assoc) = precedence_assoc; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2317 "src/parse-gram.c" break; case 55: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 421 "parse-gram.y" { current_type = NULL; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2325 "src/parse-gram.c" break; case 56: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 422 "parse-gram.y" { current_type = (yyvsp[0].uniqstr); tag_seen = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2333 "src/parse-gram.c" break; case 57: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 428 "parse-gram.y" { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2341 "src/parse-gram.c" break; case 58: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 430 "parse-gram.y" { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2349 "src/parse-gram.c" break; case 59: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 434 "parse-gram.y" { (yyval.symbol) = (yyvsp[0].symbol); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2357 "src/parse-gram.c" break; case 60: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 435 "parse-gram.y" { (yyval.symbol) = (yyvsp[-1].symbol); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2365 "src/parse-gram.c" break; case 61: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 441 "parse-gram.y" { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2373 "src/parse-gram.c" break; case 62: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 443 "parse-gram.y" { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0]))); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2381 "src/parse-gram.c" break; case 63: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 447 "parse-gram.y" { (yyval.list) = (yyvsp[0].list); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2389 "src/parse-gram.c" break; case 64: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 448 "parse-gram.y" { (yyval.list) = symbol_list_prepend ((yyvsp[-1].list), (yyvsp[0].list)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2397 "src/parse-gram.c" break; case 65: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 452 "parse-gram.y" { (yyval.list) = symbol_list_sym_new ((yyvsp[0].symbol), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2405 "src/parse-gram.c" break; case 66: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 453 "parse-gram.y" { (yyval.list) = symbol_list_type_new ((yyvsp[0].uniqstr), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2413 "src/parse-gram.c" break; case 67: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 454 "parse-gram.y" { (yyval.list) = symbol_list_default_tagged_new ((yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2421 "src/parse-gram.c" break; case 68: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 455 "parse-gram.y" { (yyval.list) = symbol_list_default_tagless_new ((yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2429 "src/parse-gram.c" break; case 69: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 461 "parse-gram.y" { current_type = (yyvsp[0].uniqstr); tag_seen = true; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2440 "src/parse-gram.c" break; case 70: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 466 "parse-gram.y" { symbol_class_set ((yyvsp[0].symbol), current_class, (yylsp[0]), true); symbol_type_set ((yyvsp[0].symbol), current_type, (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2451 "src/parse-gram.c" break; case 71: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 471 "parse-gram.y" { symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); symbol_user_token_number_set ((yyvsp[-1].symbol), (yyvsp[0].integer), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2463 "src/parse-gram.c" break; case 72: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 477 "parse-gram.y" { symbol_class_set ((yyvsp[-1].symbol), current_class, (yylsp[-1]), true); symbol_type_set ((yyvsp[-1].symbol), current_type, (yylsp[-1])); symbol_make_alias ((yyvsp[-1].symbol), (yyvsp[0].symbol), (yyloc)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2475 "src/parse-gram.c" break; case 73: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 483 "parse-gram.y" { symbol_class_set ((yyvsp[-2].symbol), current_class, (yylsp[-2]), true); @@ -2483,128 +2483,128 @@ yyreduce: symbol_user_token_number_set ((yyvsp[-2].symbol), (yyvsp[-1].integer), (yylsp[-1])); symbol_make_alias ((yyvsp[-2].symbol), (yyvsp[0].symbol), (yyloc)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2488 "src/parse-gram.c" break; case 80: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 513 "parse-gram.y" { yyerrok; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2498 "src/parse-gram.c" break; case 81: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 519 "parse-gram.y" { current_lhs = (yyvsp[-1].symbol); current_lhs_location = (yylsp[-1]); current_lhs_named_ref = (yyvsp[0].named_ref); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2507 "src/parse-gram.c" break; case 83: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 524 "parse-gram.y" { grammar_current_rule_end ((yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2515 "src/parse-gram.c" break; case 84: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 525 "parse-gram.y" { grammar_current_rule_end ((yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2523 "src/parse-gram.c" break; case 86: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 531 "parse-gram.y" { grammar_current_rule_begin (current_lhs, current_lhs_location, current_lhs_named_ref); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2532 "src/parse-gram.c" break; case 87: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 534 "parse-gram.y" { grammar_current_rule_symbol_append ((yyvsp[-1].symbol), (yylsp[-1]), (yyvsp[0].named_ref)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2540 "src/parse-gram.c" break; case 88: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 536 "parse-gram.y" { grammar_current_rule_action_append ((yyvsp[-1].code), (yylsp[-1]), (yyvsp[0].named_ref)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2548 "src/parse-gram.c" break; case 89: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 538 "parse-gram.y" { grammar_current_rule_prec_set ((yyvsp[0].symbol), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2556 "src/parse-gram.c" break; case 90: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 540 "parse-gram.y" { grammar_current_rule_dprec_set ((yyvsp[0].integer), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2564 "src/parse-gram.c" break; case 91: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 542 "parse-gram.y" { grammar_current_rule_merge_set ((yyvsp[0].uniqstr), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2572 "src/parse-gram.c" break; case 92: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 546 "parse-gram.y" { (yyval.named_ref) = 0; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2580 "src/parse-gram.c" break; case 93: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 548 "parse-gram.y" { (yyval.named_ref) = named_ref_new((yyvsp[0].uniqstr), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2588 "src/parse-gram.c" break; case 95: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 560 "parse-gram.y" { (yyval.uniqstr) = uniqstr_new ((yyvsp[0].chars)); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2596 "src/parse-gram.c" break; case 96: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 565 "parse-gram.y" { (yyval.chars) = ""; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2604 "src/parse-gram.c" break; case 98: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 576 "parse-gram.y" { code_props plain_code; @@ -2614,51 +2614,51 @@ yyreduce: gram_scanner_last_string_free (); (yyval.chars) = plain_code.code; } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2619 "src/parse-gram.c" break; case 99: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 596 "parse-gram.y" { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2627 "src/parse-gram.c" break; case 100: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 598 "parse-gram.y" { (yyval.symbol) = symbol_get (char_name ((yyvsp[0].character)), (yylsp[0])); symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); symbol_user_token_number_set ((yyval.symbol), (yyvsp[0].character), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2639 "src/parse-gram.c" break; case 101: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 606 "parse-gram.y" { (yyval.symbol) = symbol_from_uniqstr ((yyvsp[0].uniqstr), (yylsp[0])); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2647 "src/parse-gram.c" break; case 104: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 618 "parse-gram.y" { (yyval.symbol) = symbol_get (quotearg_style (c_quoting_style, (yyvsp[0].chars)), (yylsp[0])); symbol_class_set ((yyval.symbol), token_sym, (yylsp[0]), false); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2658 "src/parse-gram.c" break; case 106: -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 627 "parse-gram.y" { code_props plain_code; @@ -2668,12 +2668,12 @@ yyreduce: muscle_code_grow ("epilogue", plain_code.code, (yylsp[0])); code_scanner_last_string_free (); } -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2673 "src/parse-gram.c" break; -/* Line 1388 of yacc.c */ +/* Line 1389 of yacc.c */ #line 2678 "src/parse-gram.c" default: break; } @@ -2802,7 +2802,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (!yyis_pact_ninf (yyn)) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -2890,7 +2890,7 @@ yyreturn: return YYID (yyresult); } -/* Line 1607 of yacc.c */ +/* Line 1608 of yacc.c */ #line 637 "parse-gram.y" diff --git a/src/parse-gram.h b/src/parse-gram.h index 0fe49e87..a43fe4eb 100644 --- a/src/parse-gram.h +++ b/src/parse-gram.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.4.386-e6c849. */ +/* A Bison parser, made by GNU Bison 2.4.388-53f03. */ /* Interface for Bison's Yacc-like parsers in C @@ -157,7 +157,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 1608 of yacc.c */ +/* Line 1609 of yacc.c */ #line 94 "parse-gram.y" symbol *symbol; @@ -171,7 +171,7 @@ typedef union YYSTYPE named_ref *named_ref; -/* Line 1608 of yacc.c */ +/* Line 1609 of yacc.c */ #line 176 "src/parse-gram.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 diff --git a/src/tables.h b/src/tables.h index b21fa7b0..9b52f092 100644 --- a/src/tables.h +++ b/src/tables.h @@ -45,6 +45,24 @@ YYSTOS[S] = the symbol number of the symbol that leads to state S. + YYFINAL = the state number of the termination state. + + YYTABLE = a vector filled with portions for different uses, found + via YYPACT and YYPGOTO. + + YYLAST ( = high) the number of the last element of YYTABLE, i.e., + sizeof (YYTABLE) - 1. + + YYCHECK = a vector indexed in parallel with YYTABLE. It indicates, + in a roundabout way, the bounds of the portion you are trying to + examine. + + Suppose that the portion of YYTABLE starts at index P and the index + to be examined within the portion is I. Then if YYCHECK[P+I] != I, + I is outside the bounds of what is actually allocated, and the + default (from YYDEFACT or YYDEFGOTO) should be used. Otherwise, + YYTABLE[P+I] should be used. + YYDEFACT[S] = default reduction number in state s. Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. @@ -58,10 +76,10 @@ YYTABLE to find out what action to perform. If YYPACT[S] == YYPACT_NINF, if YYPACT[S] + I is outside the bounds - of YYTABLE (from 0 to YYLAST), or if YYCHECK indicates that I is - outside the bounds of the portion for S, then the default action - (from YYDEFACT and YYDEFGOTO) should be used instead of YYTABLE. - Otherwise, the value YYTABLE[YYPACT[S] + I] should be used even if + of YYTABLE (from 0 to YYLAST), or I is outside the bounds for portion + S (that is, YYCHECK[YYPACT[S] + I] != I), then the default action + (that is, YYDEFACT[S]) should be used instead of YYTABLE. Otherwise, + the value YYTABLE[YYPACT[S] + I] should be used even if YYPACT[S] < 0. If the value in YYTABLE is positive, we shift the token and go to @@ -69,33 +87,19 @@ If the value is negative, it is minus a rule number to reduce by. - If the value is zero, the default action from YYDEFACT[S] is used. - - If the value is YYTABLE_NINF, it's a syntax error. + If the value is zero or YYTABLE_NINF, it's a syntax error. YYPGOTO[I] = the index in YYTABLE of the portion describing what to do after reducing a rule that derives variable I + NTOKENS. This portion is indexed by the parser state number, S, as of before the - text for this nonterminal was read. The value from YYTABLE is the - state to go to if the corresponding value in YYCHECK is S. - - YYTABLE = a vector filled with portions for different uses, found - via YYPACT and YYPGOTO. - - YYCHECK = a vector indexed in parallel with YYTABLE. It indicates, - in a roundabout way, the bounds of the portion you are trying to - examine. - - Suppose that the portion of YYTABLE starts at index P and the index - to be examined within the portion is I. Then if YYCHECK[P+I] != I, - I is outside the bounds of what is actually allocated, and the - default (from YYDEFACT or YYDEFGOTO) should be used. Otherwise, - YYTABLE[P+I] should be used. - - YYFINAL = the state number of the termination state. - - YYLAST ( = high) the number of the last element of YYTABLE, i.e., - sizeof (YYTABLE) - 1. */ + text for this nonterminal was read. + + If YYPGOTO[I] + S is outside the bounds of YYTABLE (from 0 to YYLAST) + or if S is outside the bounds of the portion for I (that is, + YYCHECK[YYPGOTO[I] + S] != S), then the default state (that is, + YYDEFGOTO[I]) should be used instead of YYTABLE. Otherwise, + YYTABLE[YYPGOTO[I] + S] is the state to go to even if YYPGOTO[I] < 0. +*/ extern int nvectors; -- 2.45.2