summaryrefslogtreecommitdiff
path: root/node/BaseNode.cc
diff options
context:
space:
mode:
Diffstat (limited to 'node/BaseNode.cc')
-rw-r--r--node/BaseNode.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/node/BaseNode.cc b/node/BaseNode.cc
index 8fe2c5d..4b1166b 100644
--- a/node/BaseNode.cc
+++ b/node/BaseNode.cc
@@ -3,4 +3,23 @@
namespace pcc {
BaseNode::BaseNode(Context* context)
: context_(context) {}
+
+ProgramNode::ProgramNode(
+ Context* context, const std::string& name,
+ std::list<std::shared_ptr<BaseNode>> GlobalDeclarations,
+ std::list<std::shared_ptr<FunctionNode>> functions)
+ : BaseNode(context)
+ , name_(name)
+ , GlobalDeclarations_(GlobalDeclarations)
+ , functions_(functions) {}
+
+Value ProgramNode::CodeGen() {
+ for (auto decl : GlobalDeclarations_) {
+ decl->CodeGen();
+ }
+ for (auto function : functions_) {
+ function->CodeGen();
+ }
+ return nullptr;
+}
} // namespace pcc