summaryrefslogtreecommitdiff
path: root/node/BaseNode.hh
blob: 22ab93aa56022d3a89db8ae7c64960afbe49d650 (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
#ifndef PCC_BASENODE_H
#define PCC_BASENODE_H

#include <list>

#include "Context.hh"

namespace pcc {
class BaseNode {
  public:
    BaseNode(Context* context);
    virtual Value CodeGen() = 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;

  protected:
    std::string name_;
    std::list<std::shared_ptr<DeclNode>> GlobalDeclarations_;
    std::list<std::shared_ptr<FunctionNode>> functions_;
};
} // namespace pcc

#endif