1 #include <frith/symbol_tree_node.hpp>
5 symbol_tree_entity::symbol_tree_entity()
9 symbol_tree_entity::symbol_tree_entity(symbol::type type
):
14 case variable::variable
:
15 variable_pointer
= new variable
;
18 case variable::function
:
19 function_pointer
= new function
;
22 case variable::class_symbol
:
23 class_pointer
= new class_type
;
28 symbol_tree_node::symbol_tree_node():
33 bool symbol_tree_node::exists(std::string
const & name
)
35 scope_entities::iterator iterator
= entities
.find(name
);
36 return iterator
!= entities
.end();
39 bool symbol_tree_node::find_entity(std::string
const & name
, symbol_tree_node
* & entity_scope_output
, symbol_tree_entity
* & entity_output
)
41 scope_entities::iterator iterator
= entities
.find(name
);
42 if(iterator
== entities
.end())
46 return parent
->find_entity(name
, entitiy_scope_output
, entity_output
);
49 entity_scope_output
= this;
50 entity_output
= &iterator
->second
;