blob: 8916ef1d8e19ac9949389ee035c293b98ff5502e (
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
|
#ifndef PCC_BASENODE_H
#define PCC_BASENODE_H
#include <list>
#include "Context.hh"
#include "Traveler.hh"
namespace pcc {
class BaseNode {
public:
BaseNode(Context* context);
virtual Value CodeGen() = 0;
virtual int Travel(Traveler& traveler) = 0;
protected:
Context* context_;
};
class FunctionNode;
class DeclNode;
class ProgramNode : public BaseNode {
public:
ProgramNode(Context* context, std::string&& name,
std::list<std::shared_ptr<DeclNode>>&& GlobalDeclarations,
std::list<std::shared_ptr<FunctionNode>>&& functions);
virtual Value CodeGen() override;
virtual int Travel(Traveler& traveler) override;
protected:
std::string name_;
std::list<std::shared_ptr<DeclNode>> GlobalDeclarations_;
std::list<std::shared_ptr<FunctionNode>> functions_;
};
} // namespace pcc
#endif
|