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
exp.hh
Go to the documentation of this file.
1
91
#ifndef TRANSLATE_EXP_HH
92
# define TRANSLATE_EXP_HH
93
94
# include <iosfwd>
95
# include <
tree/all.hh
>
96
# include <
temp/fwd.hh
>
97
# include <
frame/frame.hh
>
98
99
100
namespace
translate
101
{
102
103
/*------.
104
| Exp. |
105
`------*/
106
108
class
Exp
109
{
110
public
:
111
virtual
~Exp
() {}
112
virtual
std::ostream&
dump
(std::ostream&)
const
= 0;
113
115
virtual
tree::rExp
un_ex
() = 0;
116
118
virtual
tree::rStm
un_nx
() = 0;
119
123
virtual
tree::rStm
un_cx
(
const
temp::Label
& t,
const
temp::Label
& f) = 0;
124
};
125
127
typedef
misc::ref<Exp>
rExp
;
128
130
std::ostream&
operator<<
(std::ostream& ostr,
const
Exp
& exp);
131
132
133
/*-----.
134
| Cx. |
135
`-----*/
136
138
class
Cx
:
public
Exp
139
{
140
public
:
141
Cx
(
tree::Cjump::Relop
op,
142
const
tree::rExp
& left,
const
tree::rExp
& right);
143
145
virtual
tree::rExp
un_ex
()
override
;
146
virtual
tree::rStm
un_nx
()
override
;
147
virtual
tree::rStm
un_cx
(
const
temp::Label
& t,
148
const
temp::Label
& f)
override
;
149
150
virtual
std::ostream&
dump
(std::ostream& ostr)
const override
;
151
152
private
:
153
tree::Cjump::Relop
op_
;
154
tree::rExp
left_
;
155
tree::rExp
right_
;
156
};
157
159
typedef
misc::ref<Cx>
rCx
;
160
161
162
/*-----.
163
| Ex. |
164
`-----*/
165
167
class
Ex
:
public
Exp
168
{
169
public
:
170
Ex
(
const
tree::rExp
& exp);
171
172
virtual
tree::rExp
un_ex
()
override
;
173
virtual
tree::rStm
un_nx
()
override
;
174
virtual
tree::rStm
un_cx
(
const
temp::Label
& t,
175
const
temp::Label
& f)
override
;
176
177
virtual
std::ostream&
dump
(std::ostream& ostr)
const override
;
178
179
private
:
180
tree::rExp
exp_
;
181
};
182
184
typedef
misc::ref<Ex>
rEx
;
185
186
187
/*-----.
188
| Nx. |
189
`-----*/
190
192
class
Nx
:
public
Exp
193
{
194
public
:
195
Nx
(
const
tree::rStm& stm);
196
197
virtual
tree::rExp
un_ex
()
override
;
198
virtual
tree::rStm
un_nx
()
override
;
199
virtual
tree::rStm
un_cx
(
const
temp::Label
&,
200
const
temp::Label
&)
override
;
201
202
virtual
std::ostream&
dump
(std::ostream& ostr)
const override
;
203
204
private
:
205
tree::rStm
stm_
;
206
};
207
209
typedef
misc::ref<Nx>
rNx
;
210
211
212
/*-----.
213
| Ix. |
214
`-----*/
215
217
class
Ix
:
public
Exp
218
{
219
public
:
220
Ix
(
rExp
& cond,
rExp
& iftrue,
rExp
& iffalse);
221
222
virtual
tree::rExp
un_ex
()
override
;
223
virtual
tree::rStm
un_nx
()
override
;
224
virtual
tree::rStm
un_cx
(
const
temp::Label
& t_outer,
225
const
temp::Label
& f_outer)
override
;
226
227
virtual
std::ostream&
dump
(std::ostream& ostr)
const override
;
228
229
private
:
230
rExp
cond_
;
231
rExp
iftrue_
;
232
rExp
iffalse_
;
233
};
234
236
typedef
misc::ref<Ix>
rIx
;
237
238
}
239
240
241
# include <
translate/exp.hxx
>
242
243
#endif // !TRANSLATE_EXP_HH
translate
exp.hh
Generated on Wed Mar 5 2014 15:47:36 for LRDE Tiger Compiler by
1.8.1.2