duh, forgot to record the start symbol in table

This commit is contained in:
Sven M. Hallberg 2013-06-12 15:33:53 +02:00
parent 0a7548bb2f
commit 805dfeb363

View file

@ -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)