Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse Java source with Scala

I am working on a static analysis tool and I need to work with Java source code and I'd like to write my code in Scala so that I can benefit from its functional features.

Is there any easy way to parse Java source code and have an Abstract Syntax Tree with Scala? I thought at using some existing Java parsers written in Java but I wanted to make sure that I'm not missing some cool Scala library

like image 903
mariosangiorgio Avatar asked Mar 28 '13 15:03

mariosangiorgio


1 Answers

I thought Scala could call Java libraries.

You should be able to call any Java-implemented Java parser (e.g., ANTLR). That way you get a mature parser.

like image 91
Ira Baxter Avatar answered Oct 24 '22 01:10

Ira Baxter