]> ocean-lang.org Git - ocean/commit
parsergen: fix up stack management
authorNeilBrown <neilb@suse.de>
Sun, 22 Jun 2014 05:12:41 +0000 (15:12 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 22 Jun 2014 05:15:48 +0000 (15:15 +1000)
commitb5039c5ba828498822903abe4b68cde2a8124aa5
tree8827067967622e9dab9a728569a30e24bb9d076a
parentf0665bd4c3455633f6a489f88464132490aacf37
parsergen: fix up stack management

The stack has alternating states and symbols.  I had groups a state
with the following symbol as the first thing pushed is a state and the
next is a symbol.

It works much better to group the other ways.  First we push just state zero.
Then we push some symbol and the state which 'goto' leads to.

In particularly this keeps the 'shift' that happens after "reduce"
quite separate from the 'shift' that happens when the look-ahead is
shifted in.  Previous the post-reduce shift was stealing the indent
information that should have stayed in the look-ahead buffer.

Signed-off-by: NeilBrown <neilb@suse.de>
csrc/parsergen.mdc