[antlr-interest] Force nodes for grammar rules
Matt Benson
gudnabrsam at yahoo.com
Mon Dec 5 13:22:59 PST 2005
read the ANTLR Tree Construction portion of the
manual; search for "AST Action Translation". Is this
what you want?
HTH,
Matt
--- Maik Merten <maikmerten at gmx.net> wrote:
> Hello,
>
> I know that ANTLR generates abstract syntax trees
> and doesn't include
> nodes for every grammar-rule applied. This is
> discussed in the FAQ (
> http://www.jguru.com/faq/view.jsp?EID=814505 ) and
> this behaviour is a
> Good Thing(tm).
>
> However, for the project i am involved with it is
> considered extremely
> handy to have the actual parse tree (there may be
> cases where the exact
> sequence of productions gives information about the
> "context" - which we
> could exploit instead of doing more extensive
> analysis).
>
> I may be cursed with blindness but I am not aware of
> a way to force the
> parse tree into the "AST" tree. Is there any? Can we
> modify the grammar
> in a way that ensures that every rule applied gets a
> node?
>
>
> Thank you,
>
> Maik
>
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
More information about the antlr-interest
mailing list