]> git.saurik.com Git - bison.git/commit
Rearrange initialization of the parser state variables so that the
authorJoel E. Denny <jdenny@ces.clemson.edu>
Wed, 20 Dec 2006 06:33:30 +0000 (06:33 +0000)
committerJoel E. Denny <jdenny@ces.clemson.edu>
Wed, 20 Dec 2006 06:33:30 +0000 (06:33 +0000)
commit9baf4d74a62f21448a30109ccc60efae22229a98
tree1406ec54a1debc83b5b72052f1da4f30e9dc6c3a
parent2352216441907f86d2df858c49948ab7bd5d7874
Rearrange initialization of the parser state variables so that the
skeleton doesn't have to have a copy for pull mode and another for push
mode.  This patch also fixes at least a bug such that yylloc was not
initialized (with b4_location_initial_line and
b4_location_initial_column) upon calling yypush_parse.  However, that
initialization now overwrites the first token's location;
%initial-action assigning @$ already did the same thing, and both bugs
will be fixed in a later patch.
* data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
(b4_declare_parser_state_variables): Remove initialization of yytoken,
yyss, yyvs, yyls, and yystacksize.
(yypstate_new): Remove initialization of some yypstate fields: yystate,
yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
yylsp.
(yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
yyps->NAME so it can be used in yypush_parse.
(yyparse or yypush_parse): For yypush_parse, don't print the
"Starting parse" diagnostic for invocations after the first.
Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
yypush_parse, only do it for the first invocation.
Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
initialization to occur in yypush_parse but only on the first
invocation.
ChangeLog
data/push.c