[antlr-interest] Dynamic AST node

Elnur Cabarov elnur.j at gmail.com
Thu Sep 3 22:09:18 PDT 2009


Hi,

I've got a rule that is called from multiple other rules. I want dynamically
modify AST node for every invocation.

For example:

variable
    :    type ID -> ^(VARIABLE type ID);

I want VARIABLE node be dynamic, that is it can also be PARAMETER when
called from somewhere else.
My case is not as simple as this, so duplicating rules is not acceptable.
Also I'd prefer use dynamic attribute scopes, because rules are nested into
many levels and rule attributes are not desirable too :)

Thanks

-- 
Elnur Cabarov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090904/977e72f7/attachment.html 


More information about the antlr-interest mailing list