]> ocean-lang.org Git - ocean/commitdiff
parsergen: add action tables when needed.
authorNeilBrown <neil@brown.name>
Sun, 14 Nov 2021 05:07:15 +0000 (16:07 +1100)
committerNeilBrown <neil@brown.name>
Sun, 14 Nov 2021 05:07:15 +0000 (16:07 +1100)
In most cases there is at most one reducible production per state, and
that is all we previously handled.
However occasionally it can be useful to have more than one, triggered
by different look-ahead symbols.

With this patch, we add entries to the go_to table in that case.  The
go_to table now has a flag to indicate if the symbol maps to a state (in
which case it can be SHIFTed if a terminal), or to a production (in
which case it triggers a reduction).

If the in-state production has the special value MANY_REDUCIBLE, when
the parser performs a lookup to see which production, if any, should be
reduced.

Signed-off-by: NeilBrown <neil@brown.name>

No differences found