[antlr-interest] A postmortem of my use of antler

Oti ohumbel at gmail.com
Tue Mar 11 15:10:34 PDT 2008


The parse result has a method
  Object getTree()
optional: cast it down to CommonTree and call toStringTree() to see it's repr.

I did not know the answer, but it took me 30 secs to set a breakpoint
in my JUnit test (on the way to the AST) and to find it out from
there.
The other pragmatic way is to have a look on page 191, in TestCMinus.java

best wishes,
Oti.


On Tue, Mar 11, 2008 at 10:33 PM, Andy Tripp <antlr at jazillian.com> wrote:
>  Ummm...sorry for the newbie question. How do I get ANTLR to produce a
>  parse tree?
>  I looked through all instances of "parse tree" in the book and couldn't
>  find the answer. I
>  see that ANTLRWorks shows it, and obviously the code itself is a parse
>  tree. But is there
>  some option that says "give me the parse tree as a data structure?"


More information about the antlr-interest mailing list