1 #include <core/assert.hh>
4 template class std::map
<std::string
, ast::Symbol
>;
15 Scope::findSymbol(const std::string
& name
) const
17 symbols_t::const_iterator it
= symbols_
.find(name
);
18 if (it
== symbols_
.end())
19 return parent_
? parent_
->findSymbol(name
) : 0;
24 Scope::addSymbol(Symbol
* symbol
)
27 assert(!symbol
->name
.empty());
29 assert(symbol
->address
);
30 if (symbols_
.find(symbol
->name
) != symbols_
.end())
31 assert_msg(false, "multiple definition of the same variable");
32 symbols_
[symbol
->name
] = symbol
;