X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/4a2a22f4c0b1ce06a0a473038436bd8a8116b2aa..c0ad8bf3c2fb46f001bb24ac98a72b8bfb3a77ce:/data/yacc.c diff --git a/data/yacc.c b/data/yacc.c index eed1a8a1..daa08d60 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -358,12 +358,14 @@ static const char *const yytname[[]] = }; #endif +# ifdef YYPRINT /* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to token YYLEX-NUM. */ static const b4_int_type_for([b4_toknum]) yytoknum[[]] = { b4_toknum }; +# endif /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives. */ static const b4_int_type_for([b4_r1]) yyr1[[]] = @@ -650,7 +652,7 @@ b4_c_function([yyreport_parse_error], [[int], [yystate]], [[int], [yychar]], [[YYSTYPE], [yyvalue]]b4_location_if([, - [[YYLTYPE], [yylocation]]])) + [[YYLTYPE], [yylloc]]])) [{ #if YYERROR_VERBOSE int yyn = yypact[yystate]; @@ -667,7 +669,7 @@ b4_c_function([yyreport_parse_error], YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; yysize += yystrlen ("parse error, unexpected ") + 1; yysize += yystrlen (yytname[yytype]); @@ -683,7 +685,7 @@ b4_c_function([yyreport_parse_error], for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); @@ -705,7 +707,7 @@ b4_c_function([yyreport_parse_error], (void) yystate; (void) yychar; (void) yyvalue; - ]b4_location_if([(void) yylocation;])[ + ]b4_location_if([(void) yylloc;])[ }] @@ -1044,8 +1046,8 @@ yyreduce: /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. - Otherwise, the following line sets YYVAL to the semantic value of - the lookahead token. This behavior is undocumented and Bison + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */