Noeud « Next »: , Noeud « Previous »: T5 Given Code, Noeud « Up »: T5



4.7.4 T5 Code to Write

You are encouraged to try first very simple examples: nil, 1 + 2, "foo" < "bar" etc. Then consider supporting variables, and finally handle the case of the functions.

Driver
The driver must performs the translation when given --hir-compute, but displays the result iff the option -H was given. Obviously, an input that has not been type-checked cannot be translated, so --hir-compute implies --types-check.
TypeVisitor
The TranslateVisitor often needs additional type information to proceed, especially expression versus instruction. Hence, you'll have to update the TypeVisitor to leave notes on the AST using kind_set and so forth.
src/translate/fragment.hh
There remains to implement translate::ProcFrag::print which outputs the routine themselves plus the glue code (allocating the frame etc.).
src/translate/level-env.hh
Code is missing. In particular, bear in mind that the initial environment is not empty...
src/translate/translation.hh
There are many holes to fill.
src/translate/translate-visitor.hh
There are holes to fill.