The src/translate Directory
Namespace translate, delivered for TC-5. Translation to intermediate code
representation.
File: local.am (src/translate/)
The Makefile configuration relative to the
src/translate/directory. It is responsible for the integration into thelibtclibrary with everything exported from thetranslatemodule.
File: libtranslate.* (src/translate/)
The interface of the
translatemodule. It exports a single procedure,translate.
File: tasks.* (src/translate/)
The tasks relative to the
translatemodule (see: The src/task Directory).
File: fwd.hh (src/translate/)
Forward declarations for the
translatemodule.
File: access.* (src/translate/)
Static link aware versions of
level::Access.
File: exp.* (src/translate/)
Implementation of
translate::Ex(expressions),Nx(instructions),Cx(conditions), andIx(if) shells. They wraptree::Treeto delay their translation until the actual use is known.
File: level.* (src/translate/)
translate::Levelare wrappers onframe::Framethat support the static links, so that we can find an access to the variables of the parent function.
File: translation.* (src/translate/)
Functions used by the
translate::Translatorto translate theASTinto HIR. For instance, it containsExp* simpleVar(const Access& access, const Level& level),Exp* callExp(const temp::Label& label, std::list<Exp*> args)etc… which are routines that produce someTree::Exp. They handle all theunCxetc. magic.
File: translator.* (src/translate/)
Implement the class
Translatorwhich performs the IR generation thanks totranslation.hh. It must not be polluted with translation details: it is only coordinating theASTtraversal with the invocation of translation routines. For instance, here is the translation of anast::SimpleVar:virtual void operator()(const SimpleVar& e) { exp_ = simpleVar(*var_access_[e.def_get()], *level_); }