[antlr-interest] StringTemplate is Ok, but what about "Action code"?

Loring Craymer lgcraymer at yahoo.com
Wed Nov 28 10:06:37 PST 2007


Harald--

I suspect you misinterpreted Cristian's question.  It is not uncommon to find a need use the same grammar with multiple target languages, or (more commonly) to want to take a grammar that someone developed for an application written in one target language, say C++, to use for a second target language such as Java.  If you have to modify the actions in the grammar, you end up with two copies of the grammar that need to be kept in synch and the start of a maintenance nightmare.

--Loring


----- Original Message ----
> From: Harald Mueller <harald_m_mueller at gmx.de>
> To: Cristian Peraferrer <corellian.c at gmail.com>; antlr-interest at antlr.org
> Sent: Wednesday, November 28, 2007 7:15:41 AM
> Subject: Re: [antlr-interest] StringTemplate is Ok, but what about "Action code"?
> 
> Hi -
> 
> Why would you want to do this?? - whatever you do in actions, you
> need
> 
 to express some sort of "algorithm." I do not see another
> possibility
> 
 than to have SOME language that will express what you need. Java
> is
> 
 perfect: It will decouple you (they say) from any plat form
> specifics,
> 
 because you write it once, and it runs everywhere ;-)
> 
> If you do not believe this, you must invest in your own
> infrastructure
> 
 for this: Define a language (generic bytecode? Turing
> machine
> 
 statements ;-) ?) and deliver in-process compilers which will transform
> your
> 
 selected language to something running on the target system.
> 
> Not even low coupling with the target language is a
> worthwhile
> 
 consideration most times, isn't it? - except for meta-tools like e.g.
> ANTLR
> 
 itself.
> 
> Regards
> Harald M.
> 
> 
> -------- Original-Nachricht --------
> > Datum: Tue, 27 Nov 2007 16:35:38 +0100
> > Von: Cristian Peraferrer 
> > An: antlr-interest at antlr.org
> > Betreff: [antlr-interest]  StringTemplate is Ok,    but what
> about
> 
 "Action code"?
> 
> > Hi,
> > 
> > With StringTemplate we can achieve low coupling with the target  
> > language. But what about Action code?
> > How we should achieve low coupling with the target language?
> > 
> > Thanks in advance,
> > Cristian.
> > 
> > -- 
> > GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch
> 
> -- 
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> 




      ____________________________________________________________________________________
Get easy, one-click access to your favorites. 
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs 


More information about the antlr-interest mailing list