[antlr-interest] Antlr v3.3/3.4 documentation hurdles

The Researcher researcher0x00 at gmail.com
Thu Sep 22 09:31:04 PDT 2011


On Wed, Aug 24, 2011 at 4:36 PM, Ramanand Mandayam <
ramanand_mandayam at yahoo.com> wrote:

>
> error(10):  internal error: GTgrammar.g : java.lang.ClassCastException:
> org.antlr.runtime.tree.CommonTree cannot be cast to
> org.antlr.tool.GrammarAST



I just stumbled upon a simple way to create this error.


Grammar Demo;
Name : 'a' |'b' | 'c';

The problem is that Name is a lexer rule because it starts with a capitol
letter. There are no parser rules which start with a lower case letter. Just
change 'Name' to 'name".

Eric


More information about the antlr-interest mailing list