LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
object Namespace Reference

Namespaces

namespace  tasks
 The Tasks of the object module.

Classes

class  Binder
 Computing bindings with support for objects. More...
class  DesugarVisitor
 Desugar some object structures while duplicating an Ast. More...
class  Renamer
 Perform identifier renaming within an AST (in place), with support for objects. More...
class  TypeChecker

Typedefs

typedef misc::map< const
type::Class *, misc::symbol
class_names_type
 Names associated to class types.

Functions

template<>
void Binder::visit_dec_header< ast::FunctionDec > (ast::FunctionDec &e)
template<>
void Binder::visit_dec_body< ast::FunctionDec > (ast::FunctionDec &e)
misc::error types_check (ast::Ast &tree)
 Check types allowing objects.
class_names_typerename (ast::Ast &tree)
template<typename A >
A * raw_desugar (const A &tree, const class_names_type &class_names)
 Remove objects constructs from an AST without recomputing its bindings nor its types.
template<typename A >
A * desugar (const A &tree, const class_names_type &class_names)
 Remove objects constructs from an AST.
template ast::DecsListraw_desugar (const ast::DecsList &, const class_names_type &)
 Explicit instantiations.
template ast::DecsListdesugar (const ast::DecsList &, const class_names_type &)

Typedef Documentation

Names associated to class types.

Function Documentation

template<typename A >
A * object::desugar ( const A &  tree,
const class_names_type &  class_names 
)

Remove objects constructs from an AST.

Parameters
treeabstract syntax tree's root, whose bindings and types have been computed, and whose identifiers are all unique.
class_namesthe names of the class types of the AST
Returns
the desugared, bound and type-checked AST.

References assertion, desugar::bind_and_types_check(), and raw_desugar().

Referenced by object::tasks::object_desugar(), and raw_desugar().

template ast::DecsList* object::desugar ( const ast::DecsList ,
const class_names_type &   
)
template<typename A >
A * object::raw_desugar ( const A &  tree,
const class_names_type &  class_names 
)

Remove objects constructs from an AST without recomputing its bindings nor its types.

This function acts like object::object_desugar, but stops just after the desugaring step (in fact, object::desugar is built upon this function). It is meant to be used as a test of DesugarVisitor (i.e., even if the desugared tree is badly bound or typed, it can still be pretty-printed).

Parameters
treeAST to desugar.
class_namesthe names of the class types of the AST
Returns
the desugared AST.

References desugar(), and astclone::Cloner::result_get().

Referenced by desugar(), and object::tasks::raw_object_desugar().

template ast::DecsList* object::raw_desugar ( const ast::DecsList ,
const class_names_type &   
)

Explicit instantiations.

class_names_type * object::rename ( ast::Ast tree)

Rename the variables of an AST so that they each have a unique name, with support for objects.

Parameters
treeabstract syntax tree's root, whose bindings and types have been computed.
Returns
a newly allocated dictionnary of class names

References object::Renamer::class_names_get().

Referenced by object::tasks::object_rename().

misc::error object::types_check ( ast::Ast tree)

Check types allowing objects.

Parameters
treeabstract syntax tree's root.
Returns
success of the type-checking.

References type::TypeChecker::error_get().

Referenced by desugar::bind_and_types_check(), and object::tasks::object_types_compute().