summaryrefslogtreecommitdiffhomepage
path: root/cpp.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-11-01 16:26:22 +0100
committerRoland Reichwein <mail@reichwein.it>2020-11-01 16:26:22 +0100
commite0d6dac4b103a557b37f4850fe76dacf87df7cb9 (patch)
tree76cd488c6eb59d0e42639b0abcf623d311a07c4c /cpp.cpp
parent8256280b348b4b53fff35c9101ced0a8dfb2c58e (diff)
Update cppbnf.cpp
Diffstat (limited to 'cpp.cpp')
-rw-r--r--cpp.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/cpp.cpp b/cpp.cpp
index 563ba4c..21f4df1 100644
--- a/cpp.cpp
+++ b/cpp.cpp
@@ -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