[antlr-interest] ANTLR3 Converting Java to C++ subset (sorta)

Robert Enyedi renyedi at gmail.com
Tue Mar 27 02:15:19 PDT 2007


I would also recommend for Kailey to use the Java syntax tree provided by
the Eclipse Java Development Tools (JDT) project. This project includes a
well tested Java parser and syntax tree which you can easily use in your
project. The only technical restriction is that you need to use an OSGi
plug-in model in your application and acquire some basic familiarity with
it. The on-line Eclipse help is a good start (for instance
as well as articles like this one:

An up to date link to the Eclipse Java DOM model API is:

There you also have some basic examples, like this one:


On 3/26/07, David Holroyd <dave at badgers-in-foil.co.uk> wrote:
> On Mon, Mar 26, 2007 at 08:25:27AM -0700, Randall R Schulz wrote:
> > On Monday 26 March 2007 08:18, Kailey Joanette wrote:
> > > Should I continue with the tree approach I started with, or would it
> > > make more sense to convert it directly?
> > Perhaps you've imposed additional constraints on made addition or
> > assumptions about your Java inputs that are not part of the Java
> > language that will get around this (I know next to nothing about J2ME
> > other than what the acronym means), but if not, I think you're going to
> > have to produce the intermediate representation.
> Multiple intermediate representations already exist for Java.  I know
> of the 'Spoon' metamodel, and the Eclipse Java DOM,
>   http://spoon.gforge.inria.fr/
> http://download.eclipse.org/eclipse/downloads/documentation/2.0/html/plugins/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/package-summary.html
>   (sorry, I found no better link)
> I've not used either yet, but I *think* both provide things like type /
> variable resolution, in addition to actually parsing the code.
> Unless, as Randall says, you've got to deal with more than just standard
> Java syntax, I'd be looking at a pre-existing representation.
> ta,
> dave
> --
> http://david.holroyd.me.uk/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070327/bf7f1336/attachment-0001.html 

More information about the antlr-interest mailing list