From 62aafc5c9273cb0b7a91bf2e4dee1ac2d3658bb3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 1 Nov 2020 22:26:56 +0100 Subject: translate() translation-unit and declaration (WIP) --- cpp.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cpp.h') 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& 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& pattern) const; ///< returns true iff specified type list matches; "" -> don't care + void trTranslationUnit(index_t node_id); + void trDeclaration(index_t node_id); }; -- cgit v1.2.3