[antlr-interest] A postmortem of my use of antler
Loring Craymer
lgcraymer at yahoo.com
Tue Mar 11 15:35:29 PDT 2008
----- Original Message ----
From: "siemsen at ucar.edu" <siemsen at ucar.edu>
There are many languages (most?) that can be translated without an AST phase.
If I don't need one, why bother? Perhaps ASTs add some nice modularity, or
compartmentalize semantic errors or something? I'm ready to be convinced, but I
want some value to compensate for the complexity they add to the translation process.
Trivial translations--A source to B source for languages in which language B can straightforwardly express the paradigms of language A--can be done without intermediate analysis. Even there, an AST is helpful and aids maintainability. Cross-paradigm translations--including code optimization--often require extensive multi-pass analysis. For these, ASTs (and other data structures) are indispensable. Also, if you use a parser with multiple backends, an AST makes it possible to re-use the same parser for the different backends without having a parser grammar for each.
That said, most ANTLR users never get beyond simple intra-paradigm translation problems or do analysis in the most brutal form with actions in a single pass processor.
--Loring
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080311/a528e9eb/attachment.html
More information about the antlr-interest
mailing list