LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
binder.hh
Go to the documentation of this file.
1 
6 #ifndef OBJECT_BINDER_HH
7 # define OBJECT_BINDER_HH
8 
9 # include <bind/binder.hh>
10 
11 
12 namespace object
13 {
14 
16  class Binder : public bind::Binder
17  {
18  public:
20  typedef ::bind::Binder super_type;
22  using super_type::operator();
23 
24  /* The visiting methods. */
25  public:
26  // ---------------- //
27  // Visiting /Exp/. //
28  // ---------------- //
29 
30  virtual void operator()(ast::ForExp& e) override;
31 
33  virtual void operator()(ast::SimpleVar& e) override;
34 
35 
36  // ---------------- //
37  // Visiting /Ty/. //
38  // ---------------- //
39 
41  virtual void operator()(ast::NameTy& e) override;
42 
44  virtual void operator()(ast::ClassTy& e) override;
45 
46 
47  // ---------------- //
48  // Visiting /Dec/. //
49  // ---------------- //
50 
52  template <class D>
53  void visit_dec_header(D& e);
54 
56  template <class D>
57  void visit_dec_body(D& e);
58 
59  // Visit a variable declaration.
60  virtual void operator()(ast::VarDec&) override;
61 
63  virtual void operator()(ast::FunctionDecs&) override;
64 
66  virtual void operator()(ast::MethodDec&) override;
67 
68  private:
78  bool within_class_ty_ = false;
79 
86  bool within_method_dec_ = false;
87  };
88 
89 } // namespace object
90 
91 #endif // !OBJECT_BINDER_HH