diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-02-20 23:26:57 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-02-20 23:26:57 +0100 |
commit | 10c2b7f9b6676dafd62d0eeda507b5ee5c6db216 (patch) | |
tree | 705885f41d9224e8678578e99db9f80af8136e94 /cpp.h | |
parent | ba8520d3435c75c2568c05f1333966a4c1a4d69b (diff) |
Grammar applied to lex (WIP)
Diffstat (limited to 'cpp.h')
-rw-r--r-- | cpp.h | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -1,25 +1,37 @@ #pragma once +#include "grammer.h" #include "minicc.h" #include <vector> -namespace CPP { +class CPP { -void PreprocessorTokensToTokens(std::vector<Token>& tokens); +public: + +CPP(); +~CPP(); + +std::string valueOfNode(index_t node_index, const std::vector<Gram::TreeNode>& Tree); +static void PreprocessorTokensToTokens(std::vector<Token>& 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<index_t, std::vector<Gram::TreeNode>> 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<Token> tokens_from_pptokens(std::pair<index_t, std::vector<Gram::TreeNode>> Tree); // phase 7.a +std::pair<index_t, std::vector<Gram::TreeNode>> analysis(std::vector<Token>); // 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<Token> m_charTokens; +}; |