[antlr-interest] Lookahead problem

Bryan Ewbank ewbank at gmail.com
Sun May 15 13:40:07 PDT 2005


> The logical answer is simple: get as many {} after #var as possible as array
> members.
> 
> How to implement that? I tried lookahead like:

Look up "greedy=true" in the PDF manual...

    variable : VARIABLE (options{greedy=true;}: curly_text )* ;

This option tells ANTLR that the ambiguity is to be resolved by "going
around again".

Hope this helps,
- Bryan


More information about the antlr-interest mailing list