mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 04:43:03 +00:00
During deterministic GLR operation, user actions should be able to
influence the parse by changing yychar. To make this easier to fix and to make glr.c easier to evolve in general, don't maintain yytoken in parallel with yychar; just compute yytoken when needed. * tests/glr-regression.at (Incorrect lookahead during deterministic GLR): Check that setting yychar in a user action has the intended effect. * data/glr.c (yyGLRStack): Remove yytokenp member. (yyclearin): Don't set *yytokenp. (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine yychar rather than *yytokenp to determine the current lookahead. Compute yytoken locally when needed. (yyparse): Likewise. Remove the local yytoken that yytokenp used to point to. * doc/bison.texinfo (Bison Options): Remove stray sentence fragment after `--report' documentation.
This commit is contained in:
@@ -1912,7 +1912,7 @@ yyreduce:
|
||||
{
|
||||
symbol_list *list;
|
||||
for (list = (yyvsp[(2) - (2)].list); list; list = list->next)
|
||||
symbol_printer_set (list->sym, (yyvsp[(1) - (2)].chars), list->location);
|
||||
symbol_printer_set (list->sym, (yyvsp[(1) - (2)].chars), (yylsp[(1) - (2)]));
|
||||
symbol_list_free ((yyvsp[(2) - (2)].list));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -148,7 +148,7 @@ typedef union YYSTYPE
|
||||
uniqstr uniqstr;
|
||||
}
|
||||
/* Line 1536 of yacc.c. */
|
||||
#line 152 "parse-gram.h"
|
||||
#line 152 "y.tab.h"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
|
||||
Reference in New Issue
Block a user