---------- Forwarded message ----------
From: The Researcher <[email protected]>
Date: Thu, Sep 22, 2011 at 4:22 PM
Subject: Re: [antlr-interest] NullPointer exception and inline template
To: Gabriel Miro <[email protected]>




On Thu, Sep 22, 2011 at 3:46 PM, Gabriel Miro <[email protected]> wrote:

>  It gives me a NullPointerException and I'm unable to compile the parser
> code.
>

Try using with the -Xsavelexer option to see more of the error.

 student@antlr:~/projects/antlr/mail/Gabriel$ java org.antlr.Tool
-Xsavelexer test.g

error(100): test__.g:20:26: syntax error: antlr: NoViableAltException(
75@[921:1: rewrite_alternative options {k=1; } : ({...}? => rewrite_template
| {...}? => ( rewrite_element )+ -> {!stream_rewrite_element.hasNext()}? ^(
ALT[LT(1),"ALT"] EPSILON["epsilon"] EOA["<end-of-alt>"] ) -> ^(
ALT[LT(1),"ALT"] ( rewrite_element )+ EOA["<end-of-alt>"] ) | -> ^(
ALT[LT(1),"ALT"] EPSILON["epsilon"] EOA["<end-of-alt>"] ) | {...}? ETC );])
error(100): test__.g:20:26: syntax error: antlr: NoViableAltException(75@[])
error(100): test.g:0:1: syntax error: assign.types:
MismatchedTreeNodeException(0!=18)
error(10):  internal error: test.g : java.lang.NullPointerException
org.antlr.grammar.v3.DefineGrammarItemsWalker.countAltsForRule(DefineGrammarItemsWalker.java:153)
org.antlr.grammar.v3.DefineGrammarItemsWalker.rule(DefineGrammarItemsWalker.java:1546)
org.antlr.grammar.v3.DefineGrammarItemsWalker.rules(DefineGrammarItemsWalker.java:1190)
org.antlr.grammar.v3.DefineGrammarItemsWalker.grammarSpec(DefineGrammarItemsWalker.java:623)
org.antlr.grammar.v3.DefineGrammarItemsWalker.grammar_(DefineGrammarItemsWalker.java:255)
org.antlr.tool.Grammar.defineGrammarSymbols(Grammar.java:748)
org.antlr.tool.CompositeGrammar.defineGrammarSymbols(CompositeGrammar.java:369)
org.antlr.Tool.process(Tool.java:521)
org.antlr.Tool.main(Tool.java:93)

Hope that helps.

Eric

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to