d: add support for lookahead correction
commit593724366f714e6c0316c51716cc507309ea9030
authorAdela Vais <adela.vais@yahoo.com>
Tue, 17 Nov 2020 14:44:52 +0000 (17 16:44 +0200)
committerAkim Demaille <akim.demaille@gmail.com>
Wed, 18 Nov 2020 07:14:43 +0000 (18 08:14 +0100)
treefcac72e034806bd4b853a879897456c28dd3185b
parent0e51f6146ad32126b9fce26fb8de34c3d2f727e6
d: add support for lookahead correction

When using lookahead correction, the method YYParser.Context.getExpectedTokens
is not annotated with const, because the method calls yylacCheck, which is not
const. Also, because of yylacStack and yylacEstablished, yylacCheck needs to
be called from the context of the parser class, which is sent as parameter to
the Context's constructor.

* data/skeletons/lalr1.d (yylacCheck, yylacEstablish, yylacDiscard,
yylacStack, yylacEstablished): New.
(Context): Use it.
* doc/bison.texi: Document it.
* tests/calc.at: Check it.
data/skeletons/lalr1.d
doc/bison.texi
tests/calc.at