diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-01 16:26:22 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-01 16:26:22 +0100 |
commit | e0d6dac4b103a557b37f4850fe76dacf87df7cb9 (patch) | |
tree | 76cd488c6eb59d0e42639b0abcf623d311a07c4c /cpp.cpp | |
parent | 8256280b348b4b53fff35c9101ced0a8dfb2c58e (diff) |
Update cppbnf.cpp
Diffstat (limited to 'cpp.cpp')
-rw-r--r-- | cpp.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -20,16 +20,7 @@ using namespace Gram; namespace fs = std::filesystem; -CPP::CPP(): map_translation_unit ({ - {"/translation-unit/top-level-declaration-seq/top-level-declaration/declaration/function-definition", - [&](fs::path& path, index_t node_id) - { - //std::cout << "DEBUG: " << path << ", " << node_id << ", " << valueOfNode(node_id, m_nodes) << ", " << m_nodes[node_id].node_id << ", " << m_nodes[node_id].pos.node_id << std::endl; - } - }, -}) -{ -} +CPP::CPP(){} CPP::~CPP(){} @@ -245,7 +236,8 @@ std::vector<Gram::TreeNode> CPP::analysis(const std::vector<Token>& tokens) return compiler.compile(tokens); } -void CPP::traverse(index_t node_id, map_type& map, fs::path parent_path) +#if 0 +void CPP::traverse(index_t node_id) { fs::path current_path{parent_path / m_nodes[node_id].type}; @@ -262,6 +254,11 @@ void CPP::traverse(index_t node_id, map_type& map, fs::path parent_path) } } } +#endif + +void CPP::trTranslationUnit(index_t node_id) +{ +} // Phase 7.c: Translate void CPP::translate() @@ -269,7 +266,7 @@ void CPP::translate() if (m_nodes.size() == 0) throw std::runtime_error("ICE: Tree is empty"); - traverse(0, map_translation_unit); + trTranslationUnit(0); } // Phase 8: Instantiate objects |