Next: , Previous: , Up: Project Layout   [Contents][Index]


3.2.11 The src/type Directory

Namespace ‘type’. Type checking.

File: libtype.* (src/type/)

The interface of the Type module. It exports a single procedure, types_check.

File: types.hh (src/type/)
File: type.* (src/type/)
File: array.* (src/type/)
File: attribute.* (src/type/)
File: builtin-types.* (src/type/)
File: class.* (src/type/)
File: field.* (src/type/)
File: function.* (src/type/)
File: method.* (src/type/)
File: named.* (src/type/)
File: record.* (src/type/)

The definitions of all the types. Built-in types (Int, String and Void) are defined in src/type/builtin-types.*.

File: nil.* (src/type/)

The Nil type is holding information about the real record type that it’s hiding. The record_type represents the actual type that the nil was meant to be used with.

The record_type is set during the type-checker in the parent nodes of the node holding a Nil type.

File: type-checker.* (src/type/)

The type::TypeChecker visitor. Computes the types of an AST and adds type labels to the corresponding nodes (works on syntax without object).

File: pretty-printer.* (src/type/)

The type::PrettyPrinter visitor which pretty-prints type::Types in a human-readable way. Used to output nice type errors.