ABSTRACT
In our compiler course for undergraduate students, we use a class of attribute grammars to specify type information, target code, and other properties calculated for the source program. In the design of the compiler, a modification of the visitor design pattern allows us to transparently compute the attributes. Within our framework, implementation is straightforward; the emphasis of the course shifts to theory and specification. In several offerings of the course, students have implemented parts of a highly modular compiler for a small, statically typed object oriented language.
- Aho, Alfred V., R Sethi, J. D. Ullman. Compilers : principles, techniques, and tools, Addison-Wesley, 1988. Google ScholarDigital Library
- Baldwin, Doug. A compiler for teaching about compilers, Proceedings of the 34th SIGCSE Technical Symposium on Computer Science Education, 2003. pp. 220--223. Google ScholarDigital Library
- Gamma, Erich {et al}. Design patterns: elements of reusable object-oriented software. Reading, Mass. Addison-Wesley, c1995. Google ScholarDigital Library
- Knuth D.E.: Examples of Formal Semantics: Symposium on Semantics of Algorithmic Languages, E. Engeler (ed.), Lecture Notes in Mathematics, Springer-Verlag, 1971, 212--235.Google Scholar
- Neff, N. "OO Design in Compiling an OO Language", Proceedings of the 30th SIGCSE Technical Symposium on Computer Science Education, Mar. 1999. pp. 326--330. Google ScholarDigital Library
Index Terms
- Attribute based compiler implemented using visitor pattern
Recommendations
A compiler for teaching about compilers
SIGCSE '03: Proceedings of the 34th SIGCSE technical symposium on Computer science educationProjects in which students write a small compiler are common in compiler design courses, but even a small compiler can be daunting to students with no prior compiler-writing experience. When I recently taught compiler design, I developed a very small ...
Attribute based compiler implemented using visitor pattern
In our compiler course for undergraduate students, we use a class of attribute grammars to specify type information, target code, and other properties calculated for the source program. In the design of the compiler, a modification of the visitor design ...
A compiler for teaching about compilers
Projects in which students write a small compiler are common in compiler design courses, but even a small compiler can be daunting to students with no prior compiler-writing experience. When I recently taught compiler design, I developed a very small ...
Comments