[antlr-interest] Is there an AST rewrite library available?

David Holroyd dave at badgers-in-foil.co.uk
Sat Oct 13 15:59:24 PDT 2007


Hi,

On Sat, Oct 13, 2007 at 01:48:37PM -0700, Gerald B. Rosenberg wrote:
> Looking for a generalized base library for doing Antlr AST rewrites - 
> inserting, deleting, moving nodes, that sort of thing -- to support 
> an interactive refactoring of the document represented by the AST?

I've done some very basic stuff to allow inserting and deleting (though
not specifically moving yet) of AST nodes, while attempting to make the
appropriate updates to the tokens so that the modified code can be
recovered without having to pretty-print the AST (i.e. I want AST
modifications to be format-preserving).

The code is part of metaas,
  http://www.badgers-in-foil.co.uk/projects/metaas/

The business-end of the codebase is here,
  http://svn.badgers-in-foil.co.uk/metaas/trunk/src/main/java/uk/co/badgersinfoil/metaas/impl/antlr/

It's not great, but it could split it off into a standalone library, if
useful to others.


ta,
dave

-- 
http://david.holroyd.me.uk/


More information about the antlr-interest mailing list