antlr/antlr4 — Issue #26: an exception upon  simple rule with double recursion in an alternative
Author: parrt
Created: 2012-02-27 19:32:41+00:00
State: open
Labels: comp:tool, grammars

expr
: 'x'
| e1=expr e2=expr
;

then the following exception is thrown:

[java] can't find rule grammarSpec or tree structure error:
(COMBINED_GRAMMAR ANTLRv4 (RULES (RULE expr (BLOCK (ALT 'x') (ALT (= e1
expr[1]) (= e2 expr[1]))))))
[java] java.lang.reflect.InvocationTargetException
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at
org.antlr.v4.parse.GrammarTreeVisitor.visit(GrammarTreeVisitor.java:192)
[java] at
org.antlr.v4.parse.GrammarTreeVisitor.visitGrammar(GrammarTreeVisitor.java:186)
[java] at
org.antlr.v4.semantics.SymbolCollector.process(SymbolCollector.java:69)
[java] at