[antlr-interest] ANTLR 3 & hidden token management?

David Holroyd dave at badgers-in-foil.co.uk
Wed Sep 6 06:37:22 PDT 2006


On Sun, Aug 06, 2006 at 08:17:34PM +0000, David Holroyd wrote:
> Having to potentially update startIndex/endIndex values in the whole
> tree on insertion/deletion sounds a bit hairy.  Does this leave me
> needing custom, linked-list Tree/Token implementations?

I went ahead and implemented something along these lines.  The code is a
bit hairy still:

  http://svn.badgers-in-foil.co.uk/metaas/trunk/src/java/uk/co/badgersinfoil/metaas/impl/antlr/

These class allow me to parse a document in my chosen language, insert
new nodes into the AST, and then simply seralize the updated list of
tokens back to a stream (given huge efforts by the application to insert
all the extra non-AST tokens, of course).

I hope that's of use to someone else one day :)


ta,
dave

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


More information about the antlr-interest mailing list