Reputation: 5543
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
Upvotes: 7
Views: 929
Reputation: 95362
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.
Upvotes: 1