An Object-Oriented and Generic Compiler Generator
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.
KeywordsCompiler Compiler Generator Design Patterns Interpreter Visitor EBNF Attributed Grammars Genericity
Unable to display preview. Download preview PDF.
- 1.Aho, A.V., Ullman, J.D.: Principles of Compiler Design. Addison-Wesley, London, UK (1977)Google Scholar
- 2.Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns–Elements of Reusable Object-Oriented Software. Professional Computing (1995)Google Scholar
- 5.Levine, J.R., Mason, T., Brown, D.: Lex & Yacc. O’Reilly & Associates (1992)Google Scholar
- 6.Thai, T.L., Lam, H.: .NET Framework Essentials. O’Reilly (2002)Google Scholar
- 7.Dobler, H.: Coco-2: A new compiler compiler. SIGPLAN Notices 25 (1990)Google Scholar
- 8.Knuth, D.E.: Semantics of context-free languages. Springer, New York (1967)Google Scholar
- 9.McFlynn, D., Weissman, P.F.: Using JavaCC and SableCC. 4UPress (2004)Google Scholar
- 10.Pitzer, M.: An object-oriented compiler generator. Bachelor Thesis (2006)Google Scholar