110template <
class T>
class LexicalStack :
public std::stack<LexicalContext<T>> {
112 void push_context() {
120 sammine_util::abort(
"ICE: You are popping an empty lexical stack");
124 void registerNameT(
const std::string &name, T l) {
125 return this->top().registerNameT(name, l);
128 return this->top().recursiveQueryName(name);
131 T get_from_name(
const std::string &name) {
132 return this->top().get_from_name(name);
135 return this->top().queryName(name);
138 T recursive_get_from_name(
const std::string &name) {
139 return this->top().recursive_get_from_name(name);
193 if (first_location) {
194 this->location = loc;
195 first_location =
false;
197 this->get_location() |= loc;
200 bool first_location =
true;
209 Type type = Type::NonExistent();
214 change_location(ast->get_location());
219 AstBase *join_location(std::shared_ptr<Token> tok) {
224 change_location(tok->get_location());
230 if (location.source_start <= 0 && location.source_end <= 0)
233 change_location(location);
237 bool synthesized()
const {
return this->type.synthesized(); }
239 bool checked()
const {
return this->type.checked(); }
240 void set_checked() { this->type.is_checked =
true; }
A simple scoping class, doesn't differentiate between different names, like variable name,...
NameQueryResult
NameQueryResult enum.
Definition LexicalContext.h:13
LexicalContext class.
Definition LexicalContext.h:19