[antlr-interest] grammar guessing.
Bryan Ewbank
ewbank at gmail.com
Tue Apr 5 13:38:54 PDT 2005
Related to guessing mode is scanner lookahead. I was having trouble
with scanner lookahead until I learned about semantic predicates
(thanks to Ter for his help!). It might be appropriate here as well.
For example, if you have k>2, you can't use one token to alter the
scanner results on the next token - the token has already been
processed.
Ideally, you should be able to scan the entire file into a token
stream; with semantic predicates, you can do this.
On Apr 5, 2005 11:48 AM, Bharath Sundararaman
<Bharath.Sundararaman at starthis.com> wrote:
> I have a rule of the form:
>
> var: v:IDENT{Get type of "v" and store it in AST #v}(subscripts[#v])?;
>
> Before the 'subscripts' rule is called, I have to store the type of 'v'.
> However, the compiler is in GUESSING MODE
More information about the antlr-interest
mailing list