[antlr-interest] Empty complement set?

Anton Bychkov bychkov.anton at gmail.com
Wed Mar 31 02:20:43 PDT 2010


Hi.

The following grammar does not generate target code.
It says "error(139): skipper.g: set complement is empty".

grammar skipper;

options
{
	language = C;
}

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

What's wrong with it?


More information about the antlr-interest mailing list