blob: ac62975aab3439963e5cff64ee20c73ace49342a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#ifndef PCC_EXPRNODE_H
#define PCC_EXPRNODE_H
#include "BaseNode.hh"
#include "Type.hh"
namespace pcc {
class ExprNode : public BaseNode {
public:
ExprNode(Context* context);
virtual Value CodeGen() = 0;
std::shared_ptr<Type> GetType();
protected:
std::shared_ptr<Type> type_;
};
class BinaryExprNode : public ExprNode {
public:
BinaryExprNode(Context* context, BinaryOperator op,
std::shared_ptr<ExprNode> left,
std::shared_ptr<ExprNode> right);
virtual Value CodeGen();
protected:
BinaryOperator op_;
std::shared_ptr<ExprNode> left_, right_;
};
class UnaryExprNode : public ExprNode {
public:
UnaryExprNode(Context* context, UnaryOperator op,
std::shared_ptr<ExprNode> value);
virtual Value CodeGen();
protected:
UnaryOperator op_;
std::shared_ptr<ExprNode> value_;
};
} // namespace pcc
#endif // !PCC_EXPRNODE_H
|