LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Interface between the `tree' and `translate' modules. More...
Go to the source code of this file.
Namespaces | |
namespace | translate |
Translation from ast::Ast to tree::Node. |
Functions | |
ast::Var. | |
rExp | translate::simple_var (const Access &access, const Level &use_level) |
rExp | translate::field_var (rExp var_exp, int index) |
rExp | translate::subscript_var (rExp var_exp, rExp index_exp) |
ast::Exp. | |
rExp | translate::nil_exp () |
rExp | translate::int_exp (int i) |
rExp | translate::string_exp (const std::string &s, tree::Fragment *&f) |
rExp | translate::record_exp (std::list< rExp > args) |
rExp | translate::static_link (const Level *decl, const Level *use) |
rExp | translate::call_exp (const temp::Label &label, std::list< rExp > args) |
Call the function LABEL. | |
rExp | translate::call_exp (const std::string &label, rExp arg1, rExp arg2=nullptr) |
Shorthand. | |
rExp | translate::op_exp (const ast::OpExp::Oper oper, rExp left, rExp right) |
Translation of ast::OpExp. | |
rExp | translate::seq_exp (std::list< rExp > &exps) |
Translate an ast::SeqExp. | |
rExp | translate::eseq_exp (std::list< rExp > &exps) |
rExp | translate::assign_exp (rExp dst, rExp src) |
rExp | translate::if_exp (rExp test, rExp then_clause, rExp else_clause) |
rExp | translate::while_exp (rExp test, rExp body, const temp::Label &ldone) |
rExp | translate::break_exp (const temp::Label &loop_end) |
rExp | translate::array_exp (rExp array_size, rExp init_val) |
ast::Dec. | |
tree::ProcFrag * | translate::procedure_dec (const temp::Label &label, const misc::symbol &name, rExp body, frame::Frame *frame) |
tree::ProcFrag * | translate::function_dec (const temp::Label &label, const misc::symbol &name, rExp value, frame::Frame *frame) |
Interface between the `tree' and `translate' modules.
The Translator should never be bothered with low level details, and the tree module is considered low level. All the functions below make it simple for Translator to create the intermediate representation.
In order to produce good IR code, we cannot just use tree directly, rather we use another layer (translate::rExp), so actually the function of the following function is to provide an easy API to `translate::', masking bureaucratic details from `tree::' and `translate::rExp'.