From db0654fa48ddc07e6bcaaaeddfa301a32806dadc Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 8 Nov 2020 16:38:30 +0100 Subject: Prepare encoding and linking --- cpp.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cpp.h') 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 getCode(); std::vector getData(); private: - std::string m_code; // input from compile() + std::string m_source; // input from compile() std::vector m_tokens; // result of phase 7.a std::vector 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 mCode; }; -- cgit v1.2.3