[antlr-interest] 3.0 multiple language support
Terence Parr
parrt at cs.usfca.edu
Sun Aug 8 15:10:38 PDT 2004
On Aug 4, 2004, at 10:29 AM, Tiller, Michael (M.M.) wrote:
> Based on the response to this thread, it seems like different people
> would approach this kind of thing in different ways. So it seems like
> the best solution is to be as flexible as possible. I think a basic
> action language could be used to handle most grammar related actions.
> For people who need to support multiple languages I think the macro
> approach makes sense. For those who still want language specific
> actions in the grammar, I never objected to having that as well.
Yep, flexibility will remain key. I think it is fruitless to try to
make a grammar with extremely complicated actions like a full pascal->C
translator language independent. At best, we can hope for a
tree-building grammar possibly with symbol table management actions
for, in this example, pascal. Then have some templates/example
pascal-AST tree walker grammars people can use for their specific
application (such as C translation). This puts the
application-specific code out of the way of the most re-usable
component, the parser/tree-builder pascal.g. The tree walkers will
mostly be application specific so there is no point worrying about
making them language independent.
As a tactical issue, I wonder if having two kinds of actions is
appropriate, one for a simple target independent action-language and
one for language specific stuff. Perhaps <<language specific>> and
{antlr actions like newline}. Just thinking out loud.
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