[antlr-interest] tree/token manipulation

Loring Craymer lgcraymer at yahoo.com
Tue Oct 17 18:52:42 PDT 2006


Rob--

I am sure that there is an answer involving
TreeAdaptors, eye of newt and wing of bat.  Properly,
though, this is a tree transformation issue.  It has
been a few years since Ter did any multi-pass tree
transformation work, though, so the best way to get
the functionality into the baseline is to keep raising
the issue.  (Unfortunate, that:  I consider
grammar-based tree manipulation to be one of Ter's
most important contributions to the field.)

--Loring

--- Robert Hill <rob.hill at blueyonder.co.uk> wrote:

> Hi all,
> 	I have a rule that allows me to have syntactic
> shortcuts in my
> language
> 
> So,
> 
> Select a using b,pack
> 
> Is the same as writing
> 
> Select a using b;
> Pack a using b;
> 
> 
> When I come across the first shortcut form in the
> AST, how can I transform
> it into the second, effectively rewriting the tokens
> in the stream to the
> next pass so the next treeparser sees the second
> form?
> Can this be done easily? Or do I have to maintain
> the checks for the ',pack'
> on subsequent grammars?
> 
> Ok, I realise this is dangerously close to the tree
> transform argument LOL,
> but it would save me LOTS of typing :)
> 
> Thanks,
> 
> Rob
> 
> 
> 
> 
> 



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the antlr-interest mailing list