[antlr-interest] CommonTree & Tree grammar versus DIY

Gavin Lambert antlr at mirality.co.nz
Thu Aug 21 13:21:09 PDT 2008


At 14:42 21/08/2008, Gerald Rosenberg wrote:
 >For ad-hoc AST changes, the better approach, at least
 >conceptually, is to implement a low-level structural
 >modification API with methods to "find" a node based on
 >parameter values, and to similarly create, copy, insert and
 >delete nodes.

You can write a tree grammar to do the find (or just do it 
manually, depending on how flexible your find requirements are), 
and use the TreeAdaptors for modifying the tree structure 
afterwards...



More information about the antlr-interest mailing list