From 10c2b7f9b6676dafd62d0eeda507b5ee5c6db216 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 20 Feb 2020 23:26:57 +0100 Subject: Grammar applied to lex (WIP) --- cpp.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'cpp.h') diff --git a/cpp.h b/cpp.h index 7388e94..5ec43fb 100644 --- a/cpp.h +++ b/cpp.h @@ -1,25 +1,37 @@ #pragma once +#include "grammer.h" #include "minicc.h" #include -namespace CPP { +class CPP { -void PreprocessorTokensToTokens(std::vector& tokens); +public: + +CPP(); +~CPP(); + +std::string valueOfNode(index_t node_index, const std::vector& Tree); +static void PreprocessorTokensToTokens(std::vector& tokens); // obsolete // phases of translation, according to standard void source_charset_map(); // phase 1 void backslash_escape(); // phase 2 -void preprocessing_tokenize(const std::string& s); // phase 3 +std::pair> preprocessing_tokenize(const std::string& s); // phase 3 void preprocess(); // phase 4 void execution_charset_map(); // phase 5 void concatenate_strings(); // phase 6 -void tokens_from_pptokens(); // phase 7 +std::vector tokens_from_pptokens(std::pair> Tree); // phase 7.a +std::pair> analysis(std::vector); // phase 7.b +void translate(); // phase 7.c void instantiate(); // phase 8 void link(); // phase 9 // all phases of translation void translate(const std::string& code); -} +private: + std::string m_code; + std::vector m_charTokens; +}; -- cgit v1.2.3