An Object-Oriented and Generic Compiler Generator

  • Michael Pitzer
  • Heinz Dobler
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4739)


Object-oriented software development has become the de-facto standard programming paradigm used in modern software systems. Additionally genericity has grown more popular since the enhancement of Java and C#. This paper attempts to reconsider the principles of compiler construction from this modern, object-oriented point of view. We present a multi-paradigm, mainly object-oriented and generic approach for creating a compiler generator using a combination of the Interpreter pattern and the Visitor pattern. A prototype of such an object-oriented and generic compiler generator has also been developed using C# 2.0 and will serve as a reference to explain the design throughout this paper.


Compiler Compiler Generator Design Patterns Interpreter Visitor EBNF Attributed Grammars Genericity 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aho, A.V., Ullman, J.D.: Principles of Compiler Design. Addison-Wesley, London, UK (1977)Google Scholar
  2. 2.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns–Elements of Reusable Object-Oriented Software. Professional Computing (1995)Google Scholar
  3. 3.
    Lorenz, D.H.: Tiling Design Patterns–A Case Study Using the Interpreter Pattern. ACM SIGPLAN Notices 32, 206–217 (1997)CrossRefGoogle Scholar
  4. 4.
    Appel, A.W., Palsberg, J.: Modern Compiler Implementation in Java. Camebridge University Press, Camebridge (2002)zbMATHGoogle Scholar
  5. 5.
    Levine, J.R., Mason, T., Brown, D.: Lex & Yacc. O’Reilly & Associates (1992)Google Scholar
  6. 6.
    Thai, T.L., Lam, H.: .NET Framework Essentials. O’Reilly (2002)Google Scholar
  7. 7.
    Dobler, H.: Coco-2: A new compiler compiler. SIGPLAN Notices 25 (1990)Google Scholar
  8. 8.
    Knuth, D.E.: Semantics of context-free languages. Springer, New York (1967)Google Scholar
  9. 9.
    McFlynn, D., Weissman, P.F.: Using JavaCC and SableCC. 4UPress (2004)Google Scholar
  10. 10.
    Pitzer, M.: An object-oriented compiler generator. Bachelor Thesis (2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Michael Pitzer
    • 1
  • Heinz Dobler
    • 1
  1. 1.University of Applied Sciences, Hauptstr. 117, 4232 HagenbergAustria

Personalised recommendations