summaryrefslogtreecommitdiffhomepage
path: root/cpp.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp.h')
-rw-r--r--cpp.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/cpp.h b/cpp.h
index 267aa9d..8258011 100644
--- a/cpp.h
+++ b/cpp.h
@@ -1,5 +1,6 @@
#pragma once
+#include "asm/segment.h"
#include "flowgraph/graph.h"
#include "grammer.h"
#include "minicc.h"
@@ -39,13 +40,13 @@ public:
void link(); // phase 9
// all phases of translation
- void compile(const std::string& code);
+ void compile(const std::string& source);
std::vector<uint8_t> getCode();
std::vector<uint8_t> getData();
private:
- std::string m_code; // input from compile()
+ std::string m_source; // input from compile()
std::vector<Token> m_tokens; // result of phase 7.a
std::vector<Gram::TreeNode> m_nodes; // result of phase 7.b
@@ -70,5 +71,11 @@ private:
void getValueOfToken(index_t index);
void getValueOfNode(index_t index);
void visitRecursive(index_t node_id);
+
+ // phase 8: instantiate: instantiate templates; flowgraph->asm
+ Segment mSegment;
+
+ // phase 9: link
+ std::vector<uint8_t> mCode;
};