views:

93

answers:

3

Our project group is working on a Java language extension and we have been trying to figure out what tool we should use for this purpose. The extension will primarily consist of a modification of the concurrency model used in Java. We have been looking at two tools so far: Polyglot and Javacc. Javacc seems to be a bit more easy to use, but as we will be making some significant changes to the language it might still not be a good idea to use it over the more advanced Polyglot as it might be better at coping with the increased complexity.

Do you have any experience with these tools and/or do you have other tool recommendations?

+1  A: 

ANTLR is a very good choice. It's a bit more active than JavaCC, and the documentation is better. There's a book available on Amazon that you'll find to be very helpful.

duffymo
+1  A: 

Check Jetbrain's MPS, but I have no experiences with it so far.

bwalliser
MPS is a great tool for creating and extending languages, not only Java-based. It is exactly matching tool if you need to 'rewrite' some parts of Java language or standard libraries.You should _definetely_ spend a week learning their system (including Actors framework) before creating your own java extentions.
Alexander Kosenkov
@Alex do you work for Jetbrains ?
mP
A: 

See the DMS Software Reengineering Toolkit. It has full Java 1.4 and Java 1.5 parsers, builds ASTs, can build symbol tables, control and data flow graphs, apply procedural or source-to-source transformations, and regenerate output text back into Java (if you just want to extend it) or into other languages (if you are extending for the purpose of cross-compiling). See http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html and http://www.semanticdesigns.com/Products/FrontEnds/JavaFrontEnd.html

Ira Baxter