Hi, I've finally solved my problem using an AST parser. Specifically I find that srcML (http://www.sdml.info/projects/srcml/) parses Java source code and then it creates a XML file. The XML file can also be transformed into Java source code again. You can find my solution in http://ss3.gemstone.com/ss/SPIRIT.html into the category Spirit-JavaParser. *JavaMethodParser initializeWith: aFamixMethod* returns the parsed method (you need to link the model with the root folder that contains the source code) Cheers
Santiago
2012/10/6 Santiago Vidal santiago.a.vidal@gmail.com
Hi Nicolas and Doru, thank you for your answers. I was thinking the AST parser option. I'm going to take a look to PetitJava. I'll let you know if I extend this parser or if I use an AST parser.
Cheers,
Santiago
2012/10/6 Tudor Girba tudor@tudorgirba.com
Hi Santiago,
As I understand, you need a parser for Java such that you can get access to get the AST.
There is no ready made solution that covers this. However, there is a Java grammar and half of a parser implemented using PetitParser. You can find it in PetitJava. In case you have time and interest, it would be very cool to strengthen this parser.
Other than that, perhaps you can find a parser that exports the AST in some format like XML. Afterwards, you could query this information from the image. In case you look into this, let us know if you do anything in this direction.
Cheers, Doru
On Fri, Oct 5, 2012 at 8:10 PM, Santiago Vidal santiago.a.vidal@gmail.com wrote:
Hi,
I looking for a Java parser to use with Moose. While the MSE file gives
me
most of the relevant information,I need to analyze the internals
statements
of a method. Anybody is aware of such a parser? Thanks in advance.
Cheers,
-- Santiago Vidal
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Every thing has its own flow" _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- Santiago Vidal