The src/type
Directory
Namespace type
, delivered during TC-4 and TC-EXTS. Type checking.
File: local.am (src/type/)
This is a Makefile configuration relative to the
src/type/
directory. It is responsible for the integration into thelibtc
library with everything exported from thetype
module, and the linkage of the directory’s unit tests in the test-suite.
File: libtype.* (src/type/)
The interface of the
type
module. It exports a single procedure,types_check
.
File: tasks.* (src/type/)
Tasks related to the
type
module (see: The src/task Directory).
File: fwd.hh (src/type/)
Forward declarations for the
type
module.
File: default-visitor.* (src/type/)
Implementation of the
GenDefaultVisitor
class template, which walks the abstract syntax tree, doing nothing. This visitor does not define visit methods for nodes related to object-oriented constructs (classes, methods, etc.); thus it is an abstract class, and is solely used as a basis for deriving other visitors. It is instantiated twice:GenDefaultVisitor<misc::constify_traits>
andGenDefaultVisitor<misc::id_traits>
.
Files: types.hh, type.*, array.*, attribute.*, builtin-types.*, class.*, field.*, function.*, method.*, named.* & record.* (src/type/)
The definitions of all the types. Built-in types (
Int, String and Void
) are defined insrc/type/builtin-types.*
.
File: nil.* (src/type/)
The
Nil
type is holding information about the real record type that it’s hiding. Therecord_type
is set during the type checking in the parent nodes of the node holding aNil
type.
File: type-checker.* (src/type/)
The
type::TypeChecker
visitor. Computes the types of anAST
and adds type labels to the corresponding nodes (works on syntax without objects).
File: pretty-printer.* (src/type/)
The
type::PrettyPrinter
visitor which pretty-printstype::Type
in a human-readable way. Used to output nice type errors.
File: test-type.cc (src/type/)
Unit tests.