LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
any-decs.hxx
Go to the documentation of this file.
1 
6 #ifndef AST_ANY_DECS_HXX
7 # define AST_ANY_DECS_HXX
8 
9 # include <ast/visitor.hh>
10 # include <ast/any-decs.hh>
11 
12 namespace ast
13 {
14 
15  template <typename D>
16  AnyDecs<D>::AnyDecs(const Location& location, Ds* decs) :
17  Decs(location),
18  decs_(decs)
19  {}
20 
21  template <typename D>
22  AnyDecs<D>::AnyDecs(const Location& location) :
23  Decs(location)
24  {}
25 
26  template <typename D>
28  {
29  for (typename Ds::iterator i = decs_->begin(); i != decs_->end(); ++i)
30  delete *i;
31  delete decs_;
32  }
33 
34  template <typename D>
35  inline void
37  {
38  v(*this);
39  }
40 
41  template <typename D>
42  inline void
44  {
45  v(*this);
46  }
47 
48  template <typename D>
49  AnyDecs<D>&
51  {
52  location_set(location_get() + d.location_get());
53  decs_->push_front(&d);
54  return *this;
55  }
56 
57  template <typename D>
58  AnyDecs<D>&
60  {
61  location_set(location_get() + d.location_get());
62  decs_->push_back(&d);
63  return *this;
64  }
65 
66  template <typename D>
67  inline typename AnyDecs<D>::Ds&
69  {
70  return *decs_;
71  }
72 
73  template <typename D>
74  inline const typename AnyDecs<D>::Ds&
76  {
77  return *decs_;
78  }
79 
80 } // namespace ast
81 
82 #endif // !AST_ANY_DECS_HXX