Namespace ast, delivered for T2. Implementation of the abstract syntax tree. The file ast/README gives an overview of the involved class hierarchy.
These files are now simply forwarding the definitions of
yy::Position
andyy::Location
as provided by Bison.
Abstract base class of the compiler's visitor hierarchy. Actually, it defines a class template
GenVisitor
, which expects an argument which can be eithernon_const_kind
orconst_kind
. This allows to define to parallel hierarchies:ConstVisitor
andVisitor
, similar toiterator
andconst_iterator
.The understanding of the template programming used is not required at this stage as it is quite delicate, and goes far beyond your (average) current understanding of templates.
Implementation of the
DefaultVisitor
class, which walks the abstract syntax tree, doing nothing. It is mainly used as a basis for deriving other visitors. Actually, just as above, there is a template, so that we have two different default visitors:DefaultVisitor<const_kind>
andDefaultVisitor<non_const_kind>
.
Implementation of the
PrintVisitor
class, which performs pretty-printing in the tiger compiler.