ABSTRACT
The JastAdd Extensible Java Compiler is a high quality Java compiler that is easy to extend in order to build static analysis tools for Java, and to extend Java with new language constructs. It is built modularly, with a Java 1.4 compiler that is extended to a Java 5 compiler. Example applications that are built as extensions include an alternative backend that generates Jimple, an extension of Java with AspectJ constructs, and the implementation of a pluggable type system for non-null checking and inferenc.
The system is implemented using JastAdd, a declarative Java-like language. We describe the compiler architecture, the major design ideas for building and extending the compiler, in particular, for dealing with complex extensions that affect name and type analysis. Our extensible compiler compares very favorably concerning quality, speed and size with other extensible Java compiler frameworks. It also compares favorably in quality and size compared with traditional non-extensible Java compilers, and it runs within a factor of three compared to javac.
- Pavel Avgustinov, Aske Simon Christensen, Laurie Hendren, Sascha Kuzins, Jennifer Lhoták, Ondrej Lhoták, Oege de Moor, Damien Sereni, Ganesh Sittampalam, and Julian Tibble. abc: An extensible AspectJ compiler. Transactions on Aspect-Oriented Software Development, 1(1), 2006. Google ScholarDigital Library
- Per Andersson. Efficient modelling and synthesis of data intensive reconfigurable systems. PhD thesis, Lund University, Sweden, June 2005.Google Scholar
- ajc in the AspectJ project, 1.5.0, 2007. http://www.eclipse.org/aspectj/.Google Scholar
- Kim B. Bruce, Luca Cardelli, Giuseppe Castagna, Jonathan Eifrig, Scott F. Smith, Valery Trifonov, Gary T. Leavens, and Benjamin C. Pierce. On binary methods. Theory and Practice of Object Systems, 1(3):221--242, 1995. Google ScholarDigital Library
- S. M. Blackburn, R. Garner, C. Hoffman, A. M. Khan, K. S. McKinley, R. Bentzur, A. Diwan, D. Feinberg, D. Frampton, S. Z. Guyer, M. Hirzel, A. Hosking, M. Jump, H. Lee, J. E. B. Moss, A. Phansalkar, D. Stefanović, T. VanDrunen, Dvon Dincklage, and B. Wiedermann. The DaCapo benchmarks: Java benchmarking development and analysis. In Proceedings of OOPSLA'06. ACM Press, October 2006. Google ScholarDigital Library
- Jonthan Bachrach and Keith Playford. The Java syntactic extender (JSE). In Proceedings of OOPSLA'01, pages 31--42. ACM Press, 2001. Google ScholarDigital Library
- Gilad Bracha. Pluggable Type Systems. In OOPSLA'04 workshop on revival of dynamic languages, 2004.Google Scholar
- Martin Bravenboer and Eelco Visser. Concrete syntax for objects. Domain-specific language embedding and assimilation without restrictions. In Proceedings of OOPSLA'04, pages 365--383. ACM Press, October 2004. Google ScholarDigital Library
- Eclipse Java Compiler, Eclipse Java Development Tools 3.1.2, 2007. http://download.eclipse.org/eclipse/downloads/drops/R--3.1.2--200601181600% /index.php.Google Scholar
- Torbjörn Ekman and Görel Hedin. Rewritable Reference Attributed Grammars. In Proceedings of ECOOP 2004, volume 3086 of LNCS, pages 144--169. Springer, 2004.Google Scholar
- Torbjörn Ekman and Görel Hedin. Modular name analysis for Java using JastAdd. In Generative and Transformational Techniques in Software Engineering, International Summer School, GTTSE 2005, volume 4143 of LNCS. Springer, 2006. Google ScholarDigital Library
- Torbjörn Ekman and Görel Hedin. Pluggable checking and inferencing of non-null types for Java. Proceedings of TOOLS Europe 2007, Journal of Object Technology, 6(7), 2007.Google Scholar
- Torbjörn Ekman. Extensible Compiler Construction. PhD thesis, Lund University, Sweden, June 2006.Google Scholar
- M. Fahndrich and K. Rustan M. Leino. Declaring and checking non-null types in an object-oriented language. In Proceedings of OOPSLA'03, pages 302--312, 2003. Google ScholarDigital Library
- James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification Second Edition. Addison-Wesley, Boston, Mass., 2000. Google ScholarDigital Library
- Görel Hedin. Reference Attributed Grammars. In Informatica (Slovenia), 24(3), pages 301--317, 2000.Google Scholar
- Görel Hedin and Eva Magnusson. JastAdd: an aspect-oriented compiler construction system. Science of Computer Programming, 47(1):37--58, 2003. Google ScholarDigital Library
- DHH. Ingalls. A simple technique for handling multiple polymorphism. In Proceedings of OOPSLA'86, pages 347--349, 1986. Google ScholarDigital Library
- The Jacks compiler test suite, 2007. http://sources.redhat.com/mauve/.Google Scholar
- JaCo Java Compiler, The Programming Language Keris, 2007. http://lampwww.epfl.ch/~zenger/keris/.Google Scholar
- JastAdd, 2007. http://jastadd.cs.lth.se/web/.Google Scholar
- Gregor Kiczales, Erik Hilsdale, Jim Hugunin, Mik Kersten, Jeffrey Palm, and William G. Griswold. An overview of AspectJ. In Proceedings of ECOOP 2001, volume 2072 of LNCS, pages 327--355. Springer, 2001. Google ScholarDigital Library
- Donald E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127--145, June 1968. Correction: Mathematical Systems Theory 5, 1, pp. 95--96 (March 1971).Google ScholarCross Ref
- Uwe Kastens and William M. Waite. Modularity and reusability in attribute grammars. Acta Informatica, 31(7):601--627, 1994. Google ScholarDigital Library
- E. Magnusson and G. Hedin. Circular Reference Attributed Grammars-Their Evaluation and Applications. Electr. Notes Theor. Comput. Sci., 82(3), 2003.Google Scholar
- Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for java. In Compiler Construction, 12th International Conference, CC 2003, volume 2622 of LNCS, pages 138--152. Springer, 2003.Google ScholarDigital Library
- Anders Nilsson. Tailoring native compilation of Java for real-time systems. PhD thesis, Lund University, Sweden, May 2006.Google Scholar
- Palpable Computing - a new perspective on Ambient Computing, 2007. http://www.ist-palcom.org.Google Scholar
- Yannis Smaragdakis and Don Batory. Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM Trans. Softw. Eng. Methodol., 11(2):215--255, 2002. Google ScholarDigital Library
- Milan Stanojevic and Todd Millstein. Java 5 extension for Polyglot compiler framework, 2007. http://www.cs.ucla.edu/~milanst/projects/polyglot5/.Google Scholar
- Michiaki Tatsubori, Shigeru Chiba, Kozo Itano, and Marc-Olivier Killijian. OpenJava: A Class-Based Macro System for Java. In Proceedings of the 1st OOPSLA Workshop on Reflection and Software Engineering, pages 117--133. Springer, 2000. Google ScholarDigital Library
- Raja Vallée-Rai, Laurie Hendren, Vijay Sundaresan, Patrick Lam, Etienne Gagnon, and Phong Co. Soot-a Java Optimization Framework. In Proceedings of CASCON 1999, pages 125--135, 1999.Google Scholar
- H. H. Vogt, S. D. Swierstra, and M. F. Kuiper. Higher order attribute grammars. In Proceedings of PLDI '89, pages 131--145. ACM Press, 1989. Google ScholarDigital Library
- David A. Wheeler. SLOCCount, 2007. http://www.dwheeler.com/sloccount/.Google Scholar
- Eric Van Wyk, Lijesh Krishnan, August Schwerdfeger, and Derek Bodin. Attribute Grammar-based Language Extensions for Java. In Proceedings of ECOOP'07, LNCS. Springer, 2007. Google ScholarDigital Library
- Matthias Zenger and Martin Odersky. Extensible algebraic datatypes with defaults. In Proceedings of ICFP'01, pages 241--252. ACM Press, 2001. Google ScholarDigital Library
- Matthias Zenger and Martin Odersky. Implementing extensible compilers. In Workshop on Multiparadigm Programming with Object-Oriented allLanguages, Budapest, Hungary, June 2001.Google Scholar
- Johan Åkesson, Torbjörn Ekman, and Görel Hedin. Development of a Modelica compiler using Jast-Add. In Proceedings of LDTA'07. Electr. Notes Theor. Comput. Sci., 2007.Google Scholar
Index Terms
- The jastadd extensible java compiler
Recommendations
The jastadd extensible java compiler
Proceedings of the 2007 OOPSLA conferenceThe JastAdd Extensible Java Compiler is a high quality Java compiler that is easy to extend in order to build static analysis tools for Java, and to extend Java with new language constructs. It is built modularly, with a Java 1.4 compiler that is ...
The JastAdd extensible Java compiler
OOPSLA '07: Companion to the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications companionThe JastAdd Extensible Java Compiler is a high quality Java compiler that is easy to extend with new analyses as well as new language constructs. In this demonstration we show how the existing framework for name analysis and type checking can be ...
The JastAdd extensible Java compiler
OOPSLA '07: Companion to the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications companionJastAddJ is a Java compiler that is easy to extend with new analyses and language constructs. The main systems contains a Java 1.4 compiler with modular Java5 extensions. It compares favourably in quality and size compared to other Java compilers, and ...
Comments