generating native executable
[ozulis.git] / src / ast / scope.hh
blob61d78c13f0afbc402da76aa9af71a68d20d48818
1 #ifndef SCOPE_HH
2 # define SCOPE_HH
4 # include <map>
6 # include "ast.hh"
8 namespace ast
10 class Scope
12 public:
13 Scope();
15 bool addSymbol(Symbol * symbol);
16 Symbol * findSymbol(const std::string & name) const;
17 inline void setParent(Scope * parent);
18 inline Scope * parent();
19 inline const Scope * parent() const;
21 protected:
22 typedef std::map<std::string, Symbol *> symbols_t;
23 symbols_t symbols_;
24 Scope * parent_;
28 extern template class std::map<std::string, ast::Symbol>;
30 # include "scope.hxx"
32 #endif /* !SCOPE_HH */