LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
Main Page
Namespaces
Classes
Files
File List
File Members
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>
27
AnyDecs<D>::~AnyDecs
()
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
36
AnyDecs<D>::accept
(
Visitor
& v)
37
{
38
v(*
this
);
39
}
40
41
template
<
typename
D>
42
inline
void
43
AnyDecs<D>::accept
(
ConstVisitor
& v)
const
44
{
45
v(*
this
);
46
}
47
48
template
<
typename
D>
49
AnyDecs<D>
&
50
AnyDecs<D>::push_front
(D& 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>
&
59
AnyDecs<D>::push_back
(D& 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
&
68
AnyDecs<D>::decs_get
()
69
{
70
return
*decs_;
71
}
72
73
template
<
typename
D>
74
inline
const
typename
AnyDecs<D>::Ds
&
75
AnyDecs<D>::decs_get
()
const
76
{
77
return
*decs_;
78
}
79
80
}
// namespace ast
81
82
#endif // !AST_ANY_DECS_HXX
ast
any-decs.hxx
Generated on Wed Mar 5 2014 15:47:36 for LRDE Tiger Compiler by
1.8.1.2