]> git.saurik.com Git - bison.git/blobdiff - src/LR0.c
Fix the `GAWK Grammar' failure.
[bison.git] / src / LR0.c
index 3a036e84ecf0c4561b7c1a97bf72eeaba4bc6c36..b80cede7f42e80e10550460d03b272fa19ec6cae 100644 (file)
--- a/src/LR0.c
+++ b/src/LR0.c
 #include "reduce.h"
 
 int nstates;
-int final_state;
+/* Initialize the final state to -1, otherwise, it might be set to 0
+   by default, and since we don't compute the reductions of the final
+   state, we end up not computing the reductions of the initial state,
+   which is of course needed.
+
+   FINAL_STATE is properly set by new_state when it recognizes the
+   accessing symbol: EOF.  */
+int final_state = -1;
 static state_t *first_state = NULL;
 
 static state_t *this_state = NULL;