[antlr-interest] rewriting done in antlrworks
Kay Roepke
kroepke at classdump.org
Wed Oct 25 13:43:58 PDT 2006
Moin Dieter!
On 25. Oct 2006, at 22:30 , Dieter Frej wrote:
> When I use the interpreter in antlrworks a correct AST
> will be drawn showing which rules was executed.
Isn't that just the parse tree instead of an AST? I believe the Parse
Tree and AST buttons show
the same thing if there are no tree operators or rewrites in the
grammar. Admittedly I haven't
checked, but I imagine that's what's happening.
To get the parse tree, you could insert actions at the end of each of
your rules, to get the structure.
The token indices you can get out of the rule's return value (named
retval currently).
HTH,
-k
--
Kay Röpke <kroepke at classdump.org>
classdump Software
Key fingerprint = A849 0F2C C322 4022 379E 8661 7E1B FE0D 4CD2 A6D0
More information about the antlr-interest
mailing list