[antlr-interest] NOT in v3

Mark Bednarczyk voytechs at yahoo.com
Mon Mar 12 11:54:13 PDT 2007


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