[antlr-interest] Fundamental tree parsing question

Benjamin Niemann pink at odahoda.de
Wed Jul 11 10:05:09 PDT 2007


Ted Villalba wrote:

> Wow. Thanks Benjamin. That gave me a lot of new insight into the rewrite
> rules.
> It builds a nice parse tree, but fails with a NullPointerException when
> trying to generate the AST.
> Although I've been avoiding it, maybe it's time for me to start stepping
> through the java code. Would this be your approach to resolving this, or
> how would one go about debugging this particular issue?
> The exception:
> 08:37:45] java.lang.NullPointerException
>     at
>     org.antlr.works.debugger.tree.DBASTModel$ASTNode.becomeParent(Unknown
> Source)
> [...]

That exception happends in ANTLRWorks, so it is probably not be an issue of
the generated parser.
If the code runs fine outside of ANTLRWorks, then it look pretty much like a
bug in ANTLRWorks. Or perhaps something is wrong with the debug template
used to generate the code, and that's confuses ANTLRWorks enough to crash
it.
Debugging that probably requires some knowledge of the internals of
ANTLRWorks - which I don't have.
So my approach to resolve this: pass it on to Jean ;)

-- 
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/



More information about the antlr-interest mailing list