Continuing the work on the class implementation and the line processing code
[fridhskrift.git] / frith / symbol.hpp
blobe3b296e91de306850b2eba613d160b55075b06cf
1 #pragma once
3 #include <map>
4 #include <string>
5 #include <frith/variable.hpp>
6 #include <frith/function.hpp>
8 namespace frith
10 namespace symbol
12 enum type
14 variable,
15 function,
16 class_symbol,
17 module
21 struct symbol_tree_node;
22 struct class_type;
24 struct symbol_tree_entity
26 symbol::type type;
27 union
29 variable * variable_pointer;
30 function * function_pointer;
31 class_type * class_pointer;
32 module * module_pointer;
35 symbol_tree_entity();
36 symbol_tree_entity(symbol::type type);
39 typedef std::map<std::string, symbol_tree_entity> scope_entities;
41 struct symbol_tree_node
43 scope_entities entities;
44 symbol_tree_node * parent;
46 symbol_tree_node();
48 bool exists(std::string const & name);
49 bool find_entity(std::string const & name, symbol_tree_node * & entity_scope_output, symbol_tree_entity * & entity_output);
53 #include <frith/class.hpp>
54 #include <frith/module.hpp>