LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pretty-printer.hh
Go to the documentation of this file.
1 
6 #ifndef AST_PRETTY_PRINTER_HH
7 # define AST_PRETTY_PRINTER_HH
8 
9 # include <ast/default-visitor.hh>
10 # include <ast/object-visitor.hh>
11 
12 namespace ast
13 {
14 
17  : virtual public DefaultConstVisitor
18  , virtual public ObjectConstVisitor
19  {
20  public:
22  // Import overloaded virtual functions.
23  using super_type::operator();
24 
26  PrettyPrinter(std::ostream& ostr);
27 
30  virtual void operator()(const SimpleVar& e);
31  virtual void operator()(const FieldVar& e);
32  virtual void operator()(const SubscriptVar& e);
33  virtual void operator()(const CastVar& e);
34  // FIXME: Some code was deleted here.
35  virtual void operator()(const CastExp& e);
36  // FIXME: Some code was deleted here.
38 
39  private:
40  // Factor pretty-printing of RecordExp and RecordTy.
41  template <typename RecordClass>
42  void print_record(const RecordClass& e);
43 
44  protected:
46  std::ostream& ostr_;
47  };
48 
49 
50 } // namespace ast
51 
52 #endif // !AST_PRETTY_PRINTER_HH