Remove d_initial from the parser as it is unused (GH-12212)

d_initial, the first state of a particular DFA in the parser has always been initialized to 0 in the old pgen as well as the new pgen. As this value is not used and the first state of each DFA is assumed to be the first element in the array representing it, remove d_initial from the parser to reduce complexity.
This commit is contained in:
tyomitch 2019-03-09 17:35:50 +02:00 committed by Pablo Galindo
parent d70a359adf
commit 1b304f992d
4 changed files with 94 additions and 95 deletions

View file

@ -662,7 +662,7 @@ validate_node(node *tree)
REQ(tree, nt_dfa->d_type);
/* Run the DFA for this nonterminal. */
dfa_state = &nt_dfa->d_state[nt_dfa->d_initial];
dfa_state = nt_dfa->d_state;
for (pos = 0; pos < nch; ++pos) {
node *ch = CHILD(tree, pos);
int ch_type = TYPE(ch);