PandA-2024.02
|
#include <tree_node_factory.hpp>
Public Member Functions | |
tree_node_factory (const std::map< TreeVocabularyTokenTypes_TokenEnum, std::string > &_tree_node_schema, tree_manager &_TM) | |
default constructor More... | |
void | create_tree_node (const unsigned int node_id, enum kind) |
tree_node visitors More... | |
Public Member Functions inherited from object_visitor | |
virtual | ~object_visitor () |
destructor More... | |
BOOST_PP_SEQ_FOR_EACH (OPERATOR_MACRO, BOOST_PP_EMPTY, VISITED_OBJ_SEQ1) | |
virtual template object functor More... | |
BOOST_PP_SEQ_FOR_EACH (OPERATOR_MACRO, BOOST_PP_EMPTY, VISITED_OBJ_SEQ2) | |
Private Attributes | |
const std::map< TreeVocabularyTokenTypes_TokenEnum, std::string > & | tree_node_schema |
tree_node_schema expresses the value of the fields of the tree node we would like to create. More... | |
tree_manager & | TM |
tree manager More... | |
tree_node * | curr_tree_node_ptr |
current tree node filled according to the tree_node_schema More... | |
Definition at line 68 of file tree_node_factory.hpp.
|
inline |
default constructor
Definition at line 71 of file tree_node_factory.hpp.
References object_visitor::BOOST_PP_SEQ_FOR_EACH(), create_tree_node(), OBJ_NOT_SPECIALIZED_SEQ, OBJ_SPECIALIZED_SEQ, OPERATOR_MACRO, and OPERATOR_MACRO_DECL.
void tree_node_factory::create_tree_node | ( | const unsigned int | node_id, |
enum kind | tree_node_type | ||
) |
tree_node visitors
Factory method. It creates a tree_node of type equal tree_node_type by using a relation (tree_node_schema) between tree node fields and their values.
node_id | is the node id of the created object. |
tree_node_type | is the type of the node added to the tree_manager For example the following code: std::map<int, std::string> identifier_schema; int identifier_node_id = TM->get_tree_node_n(); identifier_schema[TOK(TOK_STRG)]= "my_identifier"; tree_node_factory TNF(identifier_schema, TM); TNF.create_tree_node(identifier_node_id, TOK(TOK_IDENTIFIER_NODE));
|
special care is reserved for identifier_nodes
Definition at line 67 of file tree_node_factory.cpp.
References tree_manager::AddTreeNode(), ATTR_MACRO, ATTR_SEQ, object_visitor::BOOST_PP_SEQ_FOR_EACH(), CREATE_TREE_NODE_CASE_BODY, curr_tree_node_ptr, tree_node::get_kind_text(), STR, template_id_expr(), THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, TM, TOK, TOK_OPERATOR, TOK_STRG, tree_node_schema, typename_type(), and using_decl().
Referenced by tree_manager::create_tree_node(), and tree_node_factory().
|
private |
current tree node filled according to the tree_node_schema
Definition at line 102 of file tree_node_factory.hpp.
Referenced by create_tree_node().
|
private |
tree manager
Definition at line 100 of file tree_node_factory.hpp.
Referenced by create_tree_node().
|
private |
tree_node_schema expresses the value of the fields of the tree node we would like to create.
Definition at line 98 of file tree_node_factory.hpp.
Referenced by create_tree_node().