diff options
Diffstat (limited to 'cpp.h')
-rw-r--r-- | cpp.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -5,6 +5,13 @@ #include <vector> +struct CPPContext { + // global variable declarations + // global variable definitions + // functions declarations + // functions definitions +}; + class CPP { public: @@ -34,14 +41,12 @@ public: std::vector<uint8_t> getData(); private: - typedef std::unordered_map<std::string, std::function<void(fs::path&, index_t)>> map_type; - std::string m_code; // input from compile() std::vector<Token> m_tokens; // result of phase 7.a std::vector<Gram::TreeNode> m_nodes; // result of phase 7.b - void traverse(index_t node_id, map_type& map, fs::path parent_path = "/"); - - CPP::map_type map_translation_unit; + CPPContext m_cpp_context; + + void trTranslationUnit(index_t node_id); }; |