LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Desugaring an ast::Ast. More...
Namespaces | |
namespace | tasks |
Tasks of the desugar module. |
Classes | |
class | BoundCheckingVisitor |
Add dynamic array bound checks while duplicating an AST. More... | |
class | DesugarVisitor |
Desugar some syntactic structures while duplicating an Ast. More... |
Functions | |
template<typename A > | |
void | bind_and_types_check (A &tree) |
template void | bind_and_types_check< ast::DecsList > (ast::DecsList &) |
template<typename A > | |
A * | raw_desugar (const A &tree, bool desugar_for_p, bool desugar_string_cmp_p) |
Remove the syntactic sugar from an AST without recomputing its bindings nor its types. | |
template<typename A > | |
A * | desugar (const A &tree, bool desugar_for_p, bool desugar_string_cmp_p) |
Remove the syntactic sugar from an AST. | |
template ast::DecsList * | raw_desugar (const ast::DecsList &, bool, bool) |
Explicit instantiations. | |
template ast::DecsList * | desugar (const ast::DecsList &, bool, bool) |
template<typename A > | |
A * | raw_bound_checks_add (const A &tree) |
Remove the syntactic sugar from an AST without recomputing its bindings nor its types. | |
template<typename A > | |
A * | bound_checks_add (const A &tree) |
Add runtime checks of array bounds. | |
template ast::DecsList * | raw_bound_checks_add (const ast::DecsList &t) |
Explicit instantiations. | |
template ast::DecsList * | bound_checks_add (const ast::DecsList &t) |
Desugaring an ast::Ast.
void desugar::bind_and_types_check | ( | A & | tree | ) |
Recompute the bindings and the types of the AST tree.
Raise an Internal Compiler Error on failure.
References overload::bind(), and object::types_check().
Referenced by bound_checks_add(), desugar(), object::desugar(), inlining::inline_expand(), and inlining::prune().
template void desugar::bind_and_types_check< ast::DecsList > | ( | ast::DecsList & | ) |
A * desugar::bound_checks_add | ( | const A & | tree | ) |
Add runtime checks of array bounds.
tree | abstract syntax tree's root, whose bindings and types have been computed, and whose identifiers are all unique. |
References assertion, bind_and_types_check(), and raw_bound_checks_add().
Referenced by desugar::tasks::bound_checks_add().
template ast::DecsList* desugar::bound_checks_add | ( | const ast::DecsList & | t | ) |
A * desugar::desugar | ( | const A & | tree, |
bool | desugar_for_p, | ||
bool | desugar_string_cmp_p | ||
) |
Remove the syntactic sugar from an AST.
tree | abstract syntax tree's root, whose bindings and types have been computed, and whose identifiers are all unique. |
desugar_for_p | desugar `for' loops. |
desugar_string_cmp_p | desugar string comparisons. |
References assertion, bind_and_types_check(), and raw_desugar().
Referenced by raw_desugar().
template ast::DecsList* desugar::desugar | ( | const ast::DecsList & | , |
bool | , | ||
bool | |||
) |
A * desugar::raw_bound_checks_add | ( | const A & | tree | ) |
Remove the syntactic sugar from an AST without recomputing its bindings nor its types.
This function acts like desugar::bound_checks_add, but stops just after the tranformation step (in fact, desugar::bound_checks_add is built upon this function). It is meant to be used as a test of BoundCheckingVisitor (i.e., even if the tree with bound checks is badly bound or typed, it can still be pretty-printed).
tree | AST on which bound checks are to be added |
References astclone::Cloner::result_get().
Referenced by bound_checks_add(), and desugar::tasks::raw_bound_checks_add().
template ast::DecsList* desugar::raw_bound_checks_add | ( | const ast::DecsList & | t | ) |
Explicit instantiations.
A * desugar::raw_desugar | ( | const A & | tree, |
bool | desugar_for_p, | ||
bool | desugar_string_cmp_p | ||
) |
Remove the syntactic sugar from an AST without recomputing its bindings nor its types.
This function acts like desugar::desugar, but stops just after the desugaring step (in fact, desugar::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).
tree | AST to desugar. |
desugar_for_p | desugar `for' loops. |
desugar_string_cmp_p | desugar string comparisons. |
References desugar(), and astclone::Cloner::result_get().
Referenced by desugar().
template ast::DecsList* desugar::raw_desugar | ( | const ast::DecsList & | , |
bool | , | ||
bool | |||
) |
Explicit instantiations.