[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for Dlang support] d: add support for lookahead correction
From: |
Akim Demaille |
Subject: |
Re: [PATCH for Dlang support] d: add support for lookahead correction |
Date: |
Wed, 18 Nov 2020 08:46:22 +0100 |
> Le 17 nov. 2020 à 19:09, Adela Vais <adela.vais99@gmail.com> a écrit :
>
> When using lookahead correction, the method YYParser.Context.getExpectedTokens
> is not annotated with const, because the method calls yylacCheck, which is not
> const.
It is logically const though. It's only because its auxiliary stack
is stored in the parser to avoid repeated construction/destruction,
that it needs to "alter the parser".
> 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.
\o/
Excellent!
Installed. Thanks!