[antlr-interest] ENHANCEMENT (JAVA): Catch and report exceptions in ActionAnalysis phase

Austin Hastings Austin_Hastings at Yahoo.com
Tue Nov 6 17:56:20 PST 2007


I am getting this output:

compile:
   [antlr3] ANTLR Parser Generator  Version 3.0.1 (August 13, 2007)  
1989-2007
   [antlr3] error(10):  internal error: 
/home/austin/gunit/sources/org/antlr/gunit/TestSuite.g : 
java.lang.NullPointerException
   [antlr3] 
org.antlr.tool.ActionAnalysisLexer.mX_Y(ActionAnalysisLexer.java:133)
   [antlr3] 
org.antlr.tool.ActionAnalysisLexer.mTokens(ActionAnalysisLexer.java:323)
   [antlr3] 
org.antlr.tool.ActionAnalysisLexer.nextToken(ActionAnalysisLexer.java:69)
   [antlr3] 
org.antlr.tool.ActionAnalysisLexer.analyze(ActionAnalysisLexer.java:43)
   [antlr3] 
org.antlr.tool.Grammar.examineAllExecutableActions(Grammar.java:1283)
   [antlr3] org.antlr.tool.Grammar.setGrammarContent(Grammar.java:567)
   [antlr3] org.antlr.tool.Grammar.<init>(Grammar.java:456)
   [antlr3] org.antlr.Tool.getGrammar(Tool.java:331)
   [antlr3] org.antlr.Tool.process(Tool.java:267)
   [antlr3] org.antlr.Tool.main(Tool.java:70)



At this point, I have absolutely no idea what is causing these messages. 
I believe, from the file name and line info, that it relates to 
$rule.attribute referencing inside an action, but beyond that I am 
mystified. I think it would be good to have AAL.analyze() or maybe 
Grammar.examineAllExecutableActions() catch these exceptions and tell 
the user exactly which action was the source of the trouble.

Thanks,

=Austin



More information about the antlr-interest mailing list