Hi folks,

Tried to setup a testsuite for my tree grammar. The testsuite can be run (allthough all tests fail) via the normal org.antlr.gunit.Interp command but
when I try to generate JUnit-Code for it I get an NPE:

 java -cp ../../../target/classes/:$CLASSPATH org.antlr.gunit.Interp -o Optimizer.testsuite 
Exception in thread "main" java.lang.NullPointerException
at org.antlr.gunit.JUnitCodeGen.changeFirstCapital(JUnitCodeGen.java:322)
at org.antlr.gunit.JUnitCodeGen.genTestRuleMethods(JUnitCodeGen.java:193)
at org.antlr.gunit.JUnitCodeGen.compileToBuffer(JUnitCodeGen.java:121)
at org.antlr.gunit.JUnitCodeGen.compile(JUnitCodeGen.java:113)
at org.antlr.gunit.Interp.main(Interp.java:55)

I am using antlr-3.1.3 and the respective version of antlr3-maven-plugin to do the grammar code-generation and compilation.
From what I found so far it seems to be that :

- gUnitTestSuite doesnt correctly set the treerule field 
- JUnitCodeGen doesn't check for null in genTestRuleMethods

I attached my grammars so you can reproduce the problem.

NB: If anybody has a neat solution to integrate gunit with maven pleeease answer my prior thread :)


Attachment: Arith.g
Description: Binary data

Attachment: Optimizer.g
Description: Binary data


kind regards

Tilman Bender
Student des Software Engineering
Hochschule Heilbronn



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

Reply via email to