diff options
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 |