[antlr-interest] How to use predicate or workaround the bug ?

Terence Parr parrt at cs.usfca.edu
Thu Jan 4 10:00:35 PST 2007


On Jan 3, 2007, at 1:49 PM, Ilia Kantor wrote:

>
> Thanks for answering, Ter. The book is going to be a must-read for  
> me =).
>
> Still confused, what's up with predicate:
>
> curly_block
> 	:	
> 	 {true}? LCURL exprs? RCURL -> TEXT[$LCURL] exprs? TEXT[$RCURL] |
> 	   LCURL exprs? RCURL -> exprs?
>
> The predicate does not reference anything, it's a plain "true" value.
>
> How should I change it to work ?
>
> The ultimate question is  how to make 'input.index()==0' to work,  
> but 'true'
> fails to compile also..

works fine for me.  input.index()==0 should be fine too.

Ter



More information about the antlr-interest mailing list