It depends on whether you want to be right or to follow the specification.
]]>My misunderstanding; I was using grun to test it in Linux after compiling. It runs the same as Eclipse using java instead of grun.
]]>If you experience this on the thingies but not in Eclipse, I’m guessing the problem is in your configuration. In Eclipse, you added the JAR to your build path. Did you do the equivalent thing on the thingies?
The equivalent thing is to include the JAR file in the Java build path. This can be done per command-line:
$ javac -cp ~/w330/jsonograph/antlr-4.0-complete.jar:. MyClass.java
Or once, in an environment variable in .bashrc or .zshrc:
export CLASSPATH="$HOME/w330/jsonograph/antlr-4.0-complete.jar:."
Exception in thread “main” java.lang.ClassCastException: class Interpreter
at java.lang.Class.asSubclass(Class.java:3046)
at org.antlr.v4.runtime.misc.TestRig.process(TestRig.java:157)
at org.antlr.v4.runtime.misc.TestRig.main(TestRig.java:142)
I’ve commented out everything in my main method so I only have the class declaration extending JSONographBaseListener and the main method throwing an IOException. All I could find on the web on this subject were a few scatterings about duplicate classes (which I don’t believe I have) or issues with the grammar (needing carots in some regex areas?).
]]>