Fix some comments concerning LR(0) versus LALR(1).

Stop equating LR(0) with nondeterminism and LALR(1) with
determinism.  That is, if all states are consistent, then LR(0)
tables are deterministic.  On the other hand, LALR(1) tables
might be nondeterministic before conflict resolution, and GLR
permits LALR(1) tables to remain nondeterministic.
* src/LR0.c, src/LR0.h: Here.
* src/lalr.c, src/lalr.h: Here.
* src/main.c (main): Here.
* src/state.c, src/state.h: Here.

* src/ielr.h (ielr): In preconditions, expect LR(0) not LALR(1)
parser tables.
(cherry picked from commit 1c4ad777cb)
This commit is contained in:
Joel E. Denny
2010-01-04 14:13:43 -05:00
parent e141f4d4bb
commit fca9c5eff1
9 changed files with 32 additions and 17 deletions

View File

@@ -97,15 +97,14 @@ main (int argc, char *argv[])
nullable_compute ();
timevar_pop (TV_SETS);
/* Convert to nondeterministic finite state machine. In file LR0.
See state.h for more info. */
/* Compute LR(0) parser states. See state.h for more info. */
timevar_push (TV_LR0);
generate_states ();
timevar_pop (TV_LR0);
/* Make it deterministic by computing lookahead sets. Except when LALR(1) is
requested, split states to eliminate LR(1)-relative inadequacies. In file
lalr and ielr. */
/* Add lookahead sets to parser states. Except when LALR(1) is
requested, split states to eliminate LR(1)-relative
inadequacies. */
ielr ();
/* Find and record any conflicts: places where one token of