[antlr-interest] Problems with AST parsers in Antlrworks 1.0.1

Johannes Luber jaluber at gmx.de
Sun Jun 3 05:45:43 PDT 2007


Robin Davies wrote:
> Probably a very beginner antlr question, but maybe not.
>  
> I'm trying to debug the CMinus.g AST parser sample >from the manual:
>  
> http://media.pragprog.com/titles/tpantlr/code/trees/CMinus/CMinus.g
>  
> When I start the AnltrWorks debugger, and step through a couple of
> steps, in AntlrWorks 1.01, I get the following exception:
>  
> Exception in thread "main" java.lang.NullPointerException
>  at org.antlr.runtime.debug.DebugTreeAdaptor.nil(DebugTreeAdaptor.java:45)
>  at CMinusParser.aexpr(CMinusParser.java:1731)
>  at __Test__.main(__Test__.java:22)
> (And the same with pretty much anything that has options {output=AST;}
> // build trees, I think.
>  
> I'm coming to this with a C# background and not a whole lot of Java
> experience. There's a very real risk that I have my classpath set up
> properly. I have a classpath to the source distribution, but no
> classpath to the Antlworks jar. Is that wrong?
>  
> My classpath:
>  
> .;C:\Program
> Files\Java\jre1.5.0_10\lib\ext\QTJava.zip;C:\usr\src\antlr-3.0\lib\
> antlr-2.7.7.jar;C:\usr\src\antlr-3.0\lib\antlr-2.7.7.jar;C:\usr\src\antlr-3.0\li
> b\antlr-3.0.jar;C:\usr\src\antlr-3.0\lib\antlr-runtime-3.0.jar;C:\usr\src\antlr-
> 3.0\lib\stringtemplate-3.0.jar
>  
> Environment: Vista, JRE 1.5.

I believe this is a bug in ANTLRworks. Maybe it is already fixed in
1.0.2. The workaround is to call the ANTLR on the command line.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list