diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-06 18:20:34 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-06 18:20:34 +0100 |
commit | 71c7fd62f8b5257b82cf32b0f747fcf313fcc617 (patch) | |
tree | 6f014b14d08080459a04a965912c62605d9015ca /cpp.h | |
parent | 62aafc5c9273cb0b7a91bf2e4dee1ac2d3658bb3 (diff) |
Prepare Token/Node handling
Diffstat (limited to 'cpp.h')
-rw-r--r-- | cpp.h | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -3,6 +3,9 @@ #include "grammer.h" #include "minicc.h" +#include <any> +#include <deque> +#include <memory> #include <vector> struct CPPContext { @@ -43,8 +46,6 @@ private: std::vector<Token> m_tokens; // result of phase 7.a std::vector<Gram::TreeNode> m_nodes; // result of phase 7.b - 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 @@ -52,7 +53,9 @@ private: 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); + std::deque<std::shared_ptr<std::any>> mValues; + void getValueOfToken(index_t index); + void getValueOfNode(index_t index); + void visitRecursive(index_t node_id); }; |