[antlr-interest] Re: Translators Should Use Tree Grammars

Monty Zukowski monty at codetransform.com
Mon Nov 22 22:22:52 PST 2004


On Nov 22, 2004, at 7:21 PM, lgcraymer wrote:

>
> No, I haven't added anything special for pattern matching.  The
> automated tree grammar generation lessens the need--it provides the
> interactive feedback needed to deal with tree transformation as a
> design problem, not just to construct trees that can be walked via a
> tree grammar.  That makes ANTLR's context-dependent pattern matching
> more powerful, and the context-independent findAll routines
> essentially irrelevant.
>

OK, to be more concrete here, I want to give an example and then try 
and figure out the definitions:

1)  Add code to the entry and exit of every function.
  2)  Add code to the entry and exit of all functions which have struct 
special_thing as an argument which return ints.

So there's patterns as in grammatical structure to find the function 
definitions as in 1), and there are patterns to match specific 
incarnations of trees within that structure as in 2).  I need help with 
clear descriptions of these, but currently ANTLR's support of 2) is 
left to actions and/or semantic predicates which can be ugly.


Monty

ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit -- 
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list