summaryrefslogtreecommitdiffhomepage
path: root/cpp.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-11-01 22:26:56 +0100
committerRoland Reichwein <mail@reichwein.it>2020-11-01 22:26:56 +0100
commit62aafc5c9273cb0b7a91bf2e4dee1ac2d3658bb3 (patch)
tree4c3e2943b48260c173733ffa1199bc09c907f131 /cpp.h
parente0d6dac4b103a557b37f4850fe76dacf87df7cb9 (diff)
translate() translation-unit and declaration (WIP)
Diffstat (limited to 'cpp.h')
-rw-r--r--cpp.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/cpp.h b/cpp.h
index 3be03e2..95289fc 100644
--- a/cpp.h
+++ b/cpp.h
@@ -19,8 +19,6 @@ public:
CPP();
~CPP();
- std::string valueOfNode(index_t node_index, const std::vector<Gram::TreeNode>& Tree);
-
// phases of translation, according to standard
void source_charset_map(); // phase 1
void backslash_escape(); // phase 2
@@ -47,6 +45,14 @@ private:
CPPContext m_cpp_context;
+ std::string valueOfNode(index_t node_index) const;
+ std::string typeOfNode(index_t node_index) const;
+ std::string locationOfNode(index_t node_index) const; ///< Empty if no location available
+ void compileError(index_t node_id, const std::string& msg) const;
+ std::string typeOfChild(int32_t child_id) const;
+ bool childTypesOfNodeMatch(index_t, const std::vector<std::string>& pattern) const; ///< returns true iff specified type list matches; "" -> don't care
+
void trTranslationUnit(index_t node_id);
+ void trDeclaration(index_t node_id);
};