I'm looking for a Java source code parser/generator. By which I mean a
tool that can:
* read in Java source code to some sort of internal representation
* let me examine/edit that representation
* write out such a representation as Java source code
So far I've found JParse, which looks potentially useful
(http://www.ittc.ku.edu/JParse/), are there any other tools are similar?
(It's slightly tricky to google for, because invariably you find things
like JavaCC, which is Java software for generating arbitrary parsers in
Java, which isn't what I'm looking for.)
lex
Tom Forsmo - 12 Nov 2006 12:36 GMT
> I'm looking for a Java source code parser/generator. By which I mean a
> tool that can:
>
> * read in Java source code to some sort of internal representation
> * let me examine/edit that representation
> * write out such a representation as Java source code
antlr might be what you are looking for
http://www.antlr.org/
tom
Alex Hunsley - 12 Nov 2006 17:08 GMT
>> I'm looking for a Java source code parser/generator. By which I mean a
>> tool that can:
[quoted text clipped - 6 lines]
>
> http://www.antlr.org/
Thanks! It turns out antlr is what JParse uses. Looks like JParse/antlr
is the best way to go...
lex
jyura - 14 Nov 2006 22:05 GMT
"""
> I'm looking for a Java source code parser/generator. By which I mean a
> tool that can:
[quoted text clipped - 11 lines]
>
> lex
I think spoon is that you are lookin for.
http://spoon.gforge.inria.fr/.
I have used it in commercial project and happy with result, but it has
some lacks and think haven't commercial support.
For genral task you can use ANTLR generate parser as you like, change
builded you own tree, and write it to files using template engine like
VM. Spoon hasent extension point like, changing templeate or generated
model, but stell very useful/