OpenJava: A Class-Based Macro System for Java

  • Michiaki Tatsubori
  • Shigeru Chiba
  • Marc-Olivier Killijian
  • Kozo Itano
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1826)


This paper presents OpenJava, which is a macro system that we have developed for Java. With traditional macro systems designed for non object-oriented languages, it is difficult to write a number of macros typical in object-oriented programming since they require the ability to access a logical structure of programs. One of the drawbacks of traditional macro systems is that abstract syntax trees are used for rep-resenting source programs. This paper first points out this problem and then shows how OpenJava addresses this problem. A key idea of Open-Java is to use metaobjects, which was originally developed for reflective computing, for representing source programs.


Design Pattern Logical Structure Source Program Abstract Syntax Tree Method Body 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Jan Bosch. Design Patterns as Language Constructs. Journal of Object Oriented Programming, 1997.Google Scholar
  2. 2.
    Peter J. Brown. Macro Processors and Techniques for Portable Software. Wiley, 1974.Google Scholar
  3. 3.
    Shigeru Chiba. A Metaobject Protocol for C++. SIGPLAN Notices, 30(10):285–299, 1995.CrossRefGoogle Scholar
  4. 4.
    Shigeru Chiba. Macro Processing in Object-Oriented Languages. In Proceedings of TOOLS Pacific’ 98, Australia, November 1998. IEEE, IEEE Press.Google Scholar
  5. 5.
    Pierre Cointe. Metaclasses are First Class: the ObjVlisp Model. SIGPLAN Notices, 22(12):156–162, December 1987.CrossRefGoogle Scholar
  6. 6.
    Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns-Elements of Reusable Object-Oriented Software. Addison-Wesley, 1994.Google Scholar
  7. 7.
    Joseph Gil and David H. Lorenz. Design Patterns and Language Design. IEEE Computer, 31(3):118–120, March 1998.Google Scholar
  8. 8.
    Adele Goldberg and Dave Robson. Smalltalk-80: The Language. Addison Wesley, 1989.Google Scholar
  9. 9.
    Yuji Ichisugi and Yves Roudier. Extensible Java Preprocessor Kit and Tiny Data-Parallel Java. In Proceedings of ISCOPE’97, California, December 1997.Google Scholar
  10. 10.
    Yutaka Ishikawa, Atsushi Hori, Mitsuhisa Sato, Motohiko Matsuda, Jörg Nolte, Hiroshi Tezuka, Hiroki Konaka, and Kazuto Kubota. Design and Implementation of Metalevel Architecture in C++-MPC++ Approach-. In Proceedings of Reflection’96, pages 153–166, 1996.Google Scholar
  11. 11.
    JavaSoft. Java Core Reflection API and Specification. online publishing, January 1997.Google Scholar
  12. 12.
    Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Videira Lopes, Jean Marc Loingtier, and John Irwin. Aspect-Oriented Programming. LNCS 1241, pages 220–242, June 1997.Google Scholar
  13. 13.
    Gregor Kiczales, Jim Rivières, and Daniel G. Bobrow. The Art of the Metaobject Protocol. The MIT Press, 1991.Google Scholar
  14. 14.
    David A. Ladd and J. Christopher Ramming. A*: A Language for Implementing Language Processors. IEEE Transactions on Software Engineering, 21(11):894–901, November 1995.CrossRefGoogle Scholar
  15. 15.
    William Maddox. Semantically-Sensitive Macroprocessing. Master’s thesis, University of California, Berkeley, 1989. ucb/csd 89/545.Google Scholar
  16. 16.
    Pattie Maes. Concepts and Experiments in Computational Reflection. SIGPLAN Notices, 22(12):147–155, October 1987.CrossRefGoogle Scholar
  17. 17.
    Jiri Soukup. Implementing Patterns. In Pattern Languages of Program Design, chapter 20, pages 395–412. Addison-Wesley, 1995.Google Scholar
  18. 18.
    Guy L. Steel Jr. Common Lisp: The Language. Digital Press, 2nd edition, 1990.Google Scholar
  19. 19.
    Daniel Weise and Roger Crew. Programmable Syntax Macros. SIGPLAN Notices, 28(6):156–165, 1993.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Michiaki Tatsubori
    • 1
  • Shigeru Chiba
    • 2
  • Marc-Olivier Killijian
    • 3
  • Kozo Itano
    • 2
  1. 1.Doctoral Program in EngineeringUniversity of TsukubaTsukuba, IbarakiJapan
  2. 2.Department of Information Science and ElectronicsUniversity of TsukubaTsukuba
  3. 3.LAAS-CNRS, 7Toulouse cedex 04France

Personalised recommendations