[antlr-interest] NOT in v3

Terence Parr parrt at cs.usfca.edu
Mon Mar 12 12:54:54 PDT 2007


Hi. ~ only works on a set not a sequence.
Ter
On Mar 12, 2007, at 11:54 AM, Mark Bednarczyk wrote:

> I'm trying to use a NOT (~x) in a production, but keep getting  
> internal
> error whenever the ! character appears in any of the rules. Here is  
> one such
> rule:
>
> myrule
> 	:	':' (':' ac ~(':' ac '.') )+ 	
> 		':' ac '.' ac '.' ac '.' ac
> 		-> ^(IP6C ':' ac*)	
>
> When I remove the ~(..) part, it compiles, but doesn't match. I'm  
> trying to
> specify a condition to terminate the ()+ production so that the  
> parser will
> move on to the second line. Otherwise it seems to be too greedy and  
> matches
> 1 too many ac subrules and the latter part never gets matched. (i.e.
> input="::ff:192.168.1.1")
>
> Any ideas or is it something I'm doing wrong?
>
> Cheers,
> mark...
>
>



More information about the antlr-interest mailing list