Noeud « Next »: , Noeud « Previous »: T4 Options, Noeud « Up »: T4



4.6.6 T4 FAQ

Stupid Types
One can legitimately wonder whether the following program is correct:
          let type weirdo = array of weirdo
          in
            print ("I'm a creep.\n")
          end
     

the answer is "yes", as nothing prevents this in the Tiger specifications. Note that this type is not usable though.

kinds (kind_get, etc.)
Some of the ast components have features such as kind_, kind_get and so forth. These are to be used only in T5, you don't have to complete them now.
The TypeVisitor is not a ConstVisitor
One of the tasks of the type checking is to pass additional information to the translation. For instance, since < is overloaded (for integers and strings), the translation needs to know the types of the arguments. In a traditional compiler, type checking and translation would be performed simultaneously, but our Tiger Compiler, in order to simplify its architecture, has two different passes for each. Hence, the TypeVisitor will have to leave notes on the AST for the TranslateVisitor, therefore it cannot be a const visitor once T5 implemented. It can perfectly be const during T4.