[antlr-interest] Internal error in 3.1; also, context-sensitive keyword sets

Jesse McGrew jmcgrew at gmail.com
Tue Aug 5 23:58:15 PDT 2008


On Tue, Aug 5, 2008 at 2:25 PM, Jesse McGrew <jmcgrew at gmail.com> wrote:
> java.lang.NullPointerException
> org.antlr.analysis.NFAToDFAConverter.getPredicatesPerNonDeterministicAlt(NFAToDFAConverter.java:1601)
...

I've narrowed down the code that causes this internal error:

======================================
grammar FrankBug;

options
{
	output = AST;
}

ID	:	('a'..'z' | 'A'..'Z')+;
	
normalExpr
	:	expression;

expression
	:	functionExpression
			({!noComma}?	(',' functionExpression)* )?
	;

functionExpression
	:	ID
			({!noFuncCall}?	('(' expression ')')? )?
	;
======================================

If I remove either of the semantic predicates, or the normalExpr rule,
the exception goes away.

Jesse


More information about the antlr-interest mailing list