[antlr-interest] Transforming AST subtrees in TreeParser with "buildAST = false"

micheal_jor open.zone at virgin.net
Wed May 19 07:45:52 PDT 2004


Is this possible?

Having created an AST from a source file, I would like to correct some
minor [context-sensitive] recognition errors by tranforming specific
expression subtrees.

I am using a TreeParser but with buildAST=false to avoid redundant
"copying" of most of the nodes in the AST. They are untouched by the
minor transformations.

I guess I have two questions really:

1. In a TreeParser, is it possible to specify that "buildAST=true"
only for certain rules or rule-Alternatives. The rest of the AST is
left as is (it is "copied" to output logically but no *actual* copying
is done).

2. Failing (1), is it "safe" (advisable?) to include tree tranforming
statements in the action code of TreeParsers with buildAST=false. I am
aware that the tree construction/transformation shortcut notation
would be unavailable in this case.

Cheers,

Micheal




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list