LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
type-checker.hh
Go to the documentation of this file.
1 
6 #ifndef OBJECT_TYPE_CHECKER_HH
7 # define OBJECT_TYPE_CHECKER_HH
8 
9 # include <type/class.hh>
10 # include <type/types.hh>
11 # include <type/type-checker.hh>
12 
13 namespace object
14 {
15 
19  {
20  public:
23  using super_type::operator();
24 
25  public:
27  TypeChecker();
28 
29  protected:
30 
31  // ------------------------- //
32  // The core of the visitor. //
33  // ------------------------- //
34 
35  // ---------------- //
36  // Visiting /Var/. //
37  // ---------------- //
38 
39  virtual void operator()(ast::FieldVar& e);
40  virtual void operator()(ast::SimpleVar& e);
41 
42  // --------------- //
43  // Visiting /Ty/. //
44  // --------------- //
45 
46  virtual void operator()(ast::NameTy& e);
47 
48  // ---------------- //
49  // Visiting /Exp/. //
50  // ---------------- //
51 
52  // Method exp.
53  virtual void operator()(ast::ObjectExp& e);
54  virtual void operator()(ast::MethodCallExp& e);
55 
56 
57  // ---------------- //
58  // Visiting /Dec/. //
59  // ---------------- //
60 
76  virtual void operator()(ast::TypeDecs& e);
77 
78  // Check a Method's declaration header.
80  // Check a Method's declaration body.
82 
84  virtual void operator()(ast::MethodDecs& e);
85 
87  virtual void operator()(ast::VarDec& e);
88 
89 
90  // --------------- //
91  // Visiting /Ty/. //
92  // --------------- //
93 
94  // Visit a class definition \em without its members.
95  virtual void operator()(ast::ClassTy& e);
96  // Visit the members of a class.
97  virtual void visit_dec_members(ast::ClassTy& e);
98 
99 
100  private:
105  };
106 
107 } // namespace type
108 
109 #endif // !OBJECT_TYPE_CHECKER_HH