Attribute based compiler implemented using visitor pattern

  • Authors:
  • Norman Neff

  • Affiliations:
  • The College of New Jersey, Ewing, NJ

  • Venue:
  • Proceedings of the 35th SIGCSE technical symposium on Computer science education
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

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.