Working on the class code
[fridhskrift.git] / symbol.cpp
blob441053d7b91155e704bf8dd4f0077fa18d06d23d
1 #include <frith/symbol_tree_node.hpp>
3 namespace frith
5 symbol_tree_node::symbol_tree_node():
6 parent(0)
10 bool symbol_tree_node::exists(std::string const & name)
12 scope_entities::iterator iterator = entities.find(name);
13 return iterator != entities.end();
16 bool symbol_tree_node::find_entity(std::string const & name, symbol_tree_node * & entity_scope_output, symbol_tree_entity * & entity_output)
18 scope_entities::iterator iterator = entities.find(name);
19 if(iterator == entities.end())
21 if(parent == 0)
22 return false;
23 return parent->find_entity(name, entitiy_scope_output, entity_output);
26 entity_scope_output = this;
27 entity_output = &iterator->second;
28 return true;