diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-08 16:38:30 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-08 16:38:30 +0100 |
commit | db0654fa48ddc07e6bcaaaeddfa301a32806dadc (patch) | |
tree | ea611c24a41ea8d9dc1e2116b64b9760f26708e0 /cpp.h | |
parent | dd2a994fbbe946fa751b689e92c85696469e5e5c (diff) |
Prepare encoding and linking
Diffstat (limited to 'cpp.h')
-rw-r--r-- | cpp.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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; }; |