skip to main content
10.1145/1297027.1297029acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

The jastadd extensible java compiler

Published:21 October 2007Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Per Andersson. Efficient modelling and synthesis of data intensive reconfigurable systems. PhD thesis, Lund University, Sweden, June 2005.Google ScholarGoogle Scholar
  3. ajc in the AspectJ project, 1.5.0, 2007. http://www.eclipse.org/aspectj/.Google ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. Jonthan Bachrach and Keith Playford. The Java syntactic extender (JSE). In Proceedings of OOPSLA'01, pages 31--42. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Gilad Bracha. Pluggable Type Systems. In OOPSLA'04 workshop on revival of dynamic languages, 2004.Google ScholarGoogle Scholar
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle Scholar
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. Torbjörn Ekman. Extensible Compiler Construction. PhD thesis, Lund University, Sweden, June 2006.Google ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification Second Edition. Addison-Wesley, Boston, Mass., 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Görel Hedin. Reference Attributed Grammars. In Informatica (Slovenia), 24(3), pages 301--317, 2000.Google ScholarGoogle Scholar
  17. Görel Hedin and Eva Magnusson. JastAdd: an aspect-oriented compiler construction system. Science of Computer Programming, 47(1):37--58, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. DHH. Ingalls. A simple technique for handling multiple polymorphism. In Proceedings of OOPSLA'86, pages 347--349, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. The Jacks compiler test suite, 2007. http://sources.redhat.com/mauve/.Google ScholarGoogle Scholar
  20. JaCo Java Compiler, The Programming Language Keris, 2007. http://lampwww.epfl.ch/~zenger/keris/.Google ScholarGoogle Scholar
  21. JastAdd, 2007. http://jastadd.cs.lth.se/web/.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarCross RefCross Ref
  24. Uwe Kastens and William M. Waite. Modularity and reusability in attribute grammars. Acta Informatica, 31(7):601--627, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. E. Magnusson and G. Hedin. Circular Reference Attributed Grammars-Their Evaluation and Applications. Electr. Notes Theor. Comput. Sci., 82(3), 2003.Google ScholarGoogle Scholar
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. Anders Nilsson. Tailoring native compilation of Java for real-time systems. PhD thesis, Lund University, Sweden, May 2006.Google ScholarGoogle Scholar
  28. Palpable Computing - a new perspective on Ambient Computing, 2007. http://www.ist-palcom.org.Google ScholarGoogle Scholar
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. Milan Stanojevic and Todd Millstein. Java 5 extension for Polyglot compiler framework, 2007. http://www.cs.ucla.edu/~milanst/projects/polyglot5/.Google ScholarGoogle Scholar
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle Scholar
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. David A. Wheeler. SLOCCount, 2007. http://www.dwheeler.com/sloccount/.Google ScholarGoogle Scholar
  35. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  36. Matthias Zenger and Martin Odersky. Extensible algebraic datatypes with defaults. In Proceedings of ICFP'01, pages 241--252. ACM Press, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Matthias Zenger and Martin Odersky. Implementing extensible compilers. In Workshop on Multiparadigm Programming with Object-Oriented allLanguages, Budapest, Hungary, June 2001.Google ScholarGoogle Scholar
  38. 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 ScholarGoogle Scholar

Index Terms

  1. The jastadd extensible java compiler

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      OOPSLA '07: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems, languages and applications
      October 2007
      728 pages
      ISBN:9781595937865
      DOI:10.1145/1297027
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 42, Issue 10
        Proceedings of the 2007 OOPSLA conference
        October 2007
        686 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1297105
        Issue’s Table of Contents

      Copyright © 2007 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 21 October 2007

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      OOPSLA '07 Paper Acceptance Rate33of156submissions,21%Overall Acceptance Rate268of1,244submissions,22%

      Upcoming Conference

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader