[antlr-interest] Re: thoughts on source-to-source workshop at oopsla 2004

Terence Parr parrt at cs.usfca.edu
Wed Oct 27 12:00:30 PDT 2004



On Oct 27, 2004, at 11:23 AM, atripp54321 wrote:
>> My approach uses AST to AST translation.
>> Why did you refuse this approach? What was the main drawback
>> of this approach?
>
> I just found AST to AST too cumbersome.
> To oversimplify, I'd rather just write:
> int main(int argc, char *argv[]) --> public static void main(String[]
> args)
>
> Writing that line is far easier than figuring out what each of
> those two ASTs look like and how to convert from one to the
> other.

I'm working on a "blog" entry that describes this right this second.  
Often concrete syntax level (rather than tree level) specs are easier.  
My only question will be, for the general case, is it powerful enough 
with a simple to understand "engine".

> I also found that examples like the "main" one above
> seemed to be about the
> most complicated examples shown for AST translation languages
> like TXL. When in fact, that "main" example is one of the
> simplest rules, and I have many hundreds of rules, most more
> complicated than that.

Sounds like you and I should talk on the phone sometime when i get more 
time to think about a simple general rewrite system.  Where were you 
during the workshop!? ;)

> I found that I was just getting bogged down trying to keep ASTs
> in my head. I felt it was much easier to write translation rules
> in simple text as shown with the "-->" separator above. That way,
> you never even have to think about ASTs much.

Do you do multiple passes or all translations in a single?  What kind 
of "engine" did the replacing?

Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!





 
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