duh, forgot to record the start symbol in table
This commit is contained in:
parent
0a7548bb2f
commit
805dfeb363
1 changed files with 3 additions and 0 deletions
|
|
@ -398,6 +398,9 @@ HLRTable *h_lr0_table(HCFGrammar *g)
|
||||||
HLRTable *table = h_lrtable_new(mm__, dfa->nstates);
|
HLRTable *table = h_lrtable_new(mm__, dfa->nstates);
|
||||||
HArena *arena = table->arena;
|
HArena *arena = table->arena;
|
||||||
|
|
||||||
|
// remember start symbol
|
||||||
|
table->start = g->start;
|
||||||
|
|
||||||
// add shift entries
|
// add shift entries
|
||||||
for(HSlistNode *x = dfa->transitions->head; x; x = x->next) {
|
for(HSlistNode *x = dfa->transitions->head; x; x = x->next) {
|
||||||
// for each transition x-A->y, add "shift, goto y" to table entry (x,A)
|
// for each transition x-A->y, add "shift, goto y" to table entry (x,A)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue