LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
canon.hh
Go to the documentation of this file.
1 
6 #ifndef CANON_CANON_HH
7 # define CANON_CANON_HH
8 
9 #include <tree/fwd.hh>
10 
11 namespace canon
12 {
13 
15  class Canon : public std::unary_function<tree::rTree, tree::rTree>
16  {
17  public:
19  Canon(bool trace_p = false);
20 
22  tree::rStm operator()(const tree::rStm& tree);
23 
24  private:
26  tree::rTree canon(tree::rTree tree);
27 
31  bool commutes_with_all_eseq(const tree::rTree& a,
32  tree::tree_list_type::iterator start,
33  tree::tree_list_type::iterator end);
34 
35 
36  /*------------------.
37  | Rewriting rules. |
38  `------------------*/
39 
41  tree::rStm assemble_stm(const tree::rStm& s1, const tree::rStm& s2);
42 
44  tree::rExp assemble_eseq(tree::rStm s, tree::rExp e);
45 
48  tree::rSeq operator()(const tree::rSeq& seq);
49 
51  tree::rExp operator()(const tree::rEseq& eseq);
52 
54  bool valid_call(const tree::rTree& tree, const tree::rTree& call);
55 
57  tree::rTree canon_default(const tree::rTree& tree);
58 
59 
60  /*-------------.
61  | Attributes. |
62  `-------------*/
63  private:
65  bool trace_p_;
66  };
67 }
68 
69 #endif // !CANON_CANON_HH