lalr1.cc: get rid of yyparse's yystate.

yystate and yystack_[0].state are equal, keep only the latter.
The former was also used as a temporary variable to compute the
post-reduction state.  Move this computation into an auxiliary
function.

	* data/glr.c (yyLRgotoState): Fuse variable definition and first
	assignment.
	* data/lalr1.cc (yy_lr_goto_state_): New.
	(yyparse): Use it.
	Replace remaining uses of yystate by yystate_[0].state.
	Remove the former.
This commit is contained in:
Akim Demaille
2009-08-16 07:36:39 +02:00
parent c4dc4c4671
commit 7580c37942
3 changed files with 41 additions and 25 deletions

View File

@@ -1,3 +1,18 @@
2009-08-19 Akim Demaille <demaille@gostai.com>
lalr1.cc: get rid of yyparse's yystate.
yystate and yystack_[0].state are equal, keep only the latter.
The former was also used as a temporary variable to compute the
post-reduction state. Move this computation into an auxiliary
function.
* data/glr.c (yyLRgotoState): Fuse variable definition and first
assignment.
* data/lalr1.cc (yy_lr_goto_state_): New.
(yyparse): Use it.
Replace remaining uses of yystate by yystate_[0].state.
Remove the former.
2009-08-19 Akim Demaille <demaille@gostai.com>
lalr1.cc: destroy $$ when YYERROR is called.