[antlr-interest] Pruning the Parse Tree

Richard Clark rdclark at gmail.com
Tue Mar 11 11:44:11 PDT 2008


If the "flatness" of the AST is a problem, you could always write your
own tree adaptor and generate the tree nodes with any relationship you
like. This is an old ANTLR 2 trick.

Otherwise, if you want to handle parse trees like ANTLRWorks does, I'd
suggest looking into its source code and the source for ANTLR's
debugging interface. I'm not fond of building production solutions
that depend on "debugging interfaces" and the like, as there's no
expectation that those undocumented bits will remain stable in the
future.

 ...Richard


More information about the antlr-interest mailing list