[antlr-interest] Empty complement set?

Anton Bychkov bychkov.anton at gmail.com
Wed Mar 31 02:47:21 PDT 2010


> Try adding the lexer rules:
>
> LParen : '(';
> RParen : ')';
>

It didn't helped.
New grammar file:

grammar skipper;

options
{
	language = C;
}

LParen : '(';
RParen : ')';

skipper		
	@init {
		int braceCount = 1;
	}
	: (
	LParen
	{
		braceCount ++;
	}
	| RParen
	{
		braceCount --;
		if(braceCount == 0)
		{
			LTOKEN = EOF_TOKEN;
		}
	}
	| ~(LParen|RParen)
	) *
	;

Antlrwoks reports the same error on 28 line which is
	| ~(LParen|RParen)

There is also a strange thing in rule view, it looks like antlr does
not see LParen and RParen in twiddle operator.
I attached screenshot with it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grammar.png
Type: image/png
Size: 5583 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20100331/fe79c545/attachment.png 


More information about the antlr-interest mailing list