[antlr-interest] How to generate code from AST.

Loring Craymer lgcraymer at yahoo.com
Mon Oct 16 21:59:54 PDT 2006


Davood--

It sounds like you are tackling a hard problem.  A
good place to start is to do a search on "type
inference".  This is an active area of research, and
maybe some of the published algorithms can help.

--Loring

--- davood khoshfetrat <dave.fet at gmail.com> wrote:

> Hi Terence and thanks for your message.
> 
> Yes I've already read about it but As I already said
> I have some
> special needs. My language is some thing like GWT
> but with very
> different concept. I have needs like determining
> type of an object to
> specify create result in which languages. I have
> found some details
> about OCL (Object Constraint Language) and it's
> featues, This tool has
> some interesting features for analizing AST. I think
> I need something
> to analyze the tree. String templates looks like
> interesting but I
> think it will not work for me. In fact I wonder
> which technique is
> used in other scripting languages like
> gwt,jython,jruby,..
> 
> Can you give me a clue?
> Looking forward to hear from you.
> Thanks.
> 
> On 10/16/06, Terence Parr <parrt at cs.usfca.edu>
> wrote:
> > Hi Davood.  Have you looked at my articles like:
> >
> >
>
http://www.codegeneration.net/tiki-read_article.php?articleId=77
> >
> > That gives some idea of how ANTLR v3 works with so
> many different
> > targets.  Just one code generator, multiple
> template backends.  works
> > great. :)
> >
> > Ter
> > On Oct 15, 2006, at 4:05 PM, davood khoshfetrat
> wrote:
> >
> > > Hi every body.
> > >
> > > I've created my grammer and it works perfectly.
> Now I have AST. My
> > > problem is that I have to generate code to 3
> different languages and
> > > they are complex. Meaning iterating throgh the
> AST won't cut it. I'm
> > > looking for some kind of algorithm or framework.
> some thing flexible.
> > > If you have any clue please guide me.
> > >
> > > Looking forward to hear from you.
> > > Thanks.
> >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the antlr-interest mailing list