#include <llvmexpr/frontend/infix2postfix/SymbolTable.hpp>
Definition at line 31 of file SymbolTable.hpp.
◆ SymbolTable()
| infix2postfix::SymbolTable::SymbolTable |
( |
SymbolTable * | parent = nullptr | ) |
|
|
explicit |
◆ define()
| bool infix2postfix::SymbolTable::define |
( |
const std::shared_ptr< Symbol > & | symbol | ) |
|
Definition at line 26 of file SymbolTable.cpp.
26 {
27 if (symbols.contains(symbol->name)) {
28 return false;
29 }
30 symbols[symbol->name] = symbol;
31 return true;
32}
◆ getParent()
| SymbolTable * infix2postfix::SymbolTable::getParent |
( |
| ) |
const |
|
inlinenodiscard |
◆ getSymbols()
| const std::map< std::string, std::shared_ptr< Symbol > > & infix2postfix::SymbolTable::getSymbols |
( |
| ) |
const |
|
inlinenodiscard |
◆ resolve()
| std::shared_ptr< Symbol > infix2postfix::SymbolTable::resolve |
( |
const std::string & | name | ) |
const |
|
nodiscard |
Definition at line 34 of file SymbolTable.cpp.
34 {
35 auto it = symbols.find(name);
36 if (it != symbols.end()) {
37 return it->second;
38 }
39 if (parent != nullptr) {
40 return parent->resolve(name);
41 }
42 return nullptr;
43}
The documentation for this class was generated from the following files: