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

David Holroyd dave at badgers-in-foil.co.uk
Mon Mar 26 10:01:23 PDT 2007


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/


More information about the antlr-interest mailing list