|
Hormiga 1.0
|
#include <symboltable.h>

Public Member Functions | |
| SymbolTable (SymbolTable *parentContext=NULL) | |
| ~SymbolTable () | |
| SymbolTable * | getParentSymbolTable () |
| bool | populateSymbol (Operand *o) |
| Operand * | getSymbol (T_STRING &key) const |
| Operand * | getLocalSymbol (T_STRING &key) const |
| Operand * | setLocalSymbol (T_STRING &key, Operand *o) |
| Type * | getType (T_STRING &key) const |
| Type * | getLocalType (T_STRING &key) const |
| Type * | setLocalType (T_STRING &key, Type *t) |
| Unit * | getUnit (T_STRING &key) const |
| Unit * | getLocalUnit (T_STRING &key) const |
| Unit * | setLocalUnit (T_STRING &key, Unit *f) |
| Function * | getFunction (T_STRING &key) const |
| Function * | getLocalFunction (T_STRING &key) const |
| Function * | setLocalFunction (T_STRING &key, Function *f) |
| Step * | getStep (T_STRING &key) const |
| Step * | getLocalStep (T_STRING &key) const |
| Step * | setLocalStep (T_STRING &key, Step *f) |
| T_STRING | toString () |
Protected Attributes | |
| T_ST_HASH | symbols |
| T_TYPE_HASH | types |
| T_UNIT_HASH | units |
| T_FUNC_HASH | funcs |
| T_STEPS_HASH | steps |
| SymbolTable * | parent |
Definition at line 57 of file symboltable.h.
| SymbolTable::SymbolTable | ( | SymbolTable * | parentContext = NULL | ) |
Symbol Table
Definition at line 49 of file symboltable.cpp.
| SymbolTable::~SymbolTable | ( | ) |
Definition at line 54 of file symboltable.cpp.
| Function * SymbolTable::getFunction | ( | T_STRING & | key | ) | const |
Same ... but for Functions
Definition at line 208 of file symboltable.cpp.


| Function * SymbolTable::getLocalFunction | ( | T_STRING & | key | ) | const |
| Step * SymbolTable::getLocalStep | ( | T_STRING & | key | ) | const |
| Operand * SymbolTable::getLocalSymbol | ( | T_STRING & | key | ) | const |
It is like "getSymbol()" but lookup is made **only** on local scope.
Definition at line 141 of file symboltable.cpp.

| Type * SymbolTable::getLocalType | ( | T_STRING & | key | ) | const |
| Unit * SymbolTable::getLocalUnit | ( | T_STRING & | key | ) | const |
| SymbolTable * SymbolTable::getParentSymbolTable | ( | ) |
| Step * SymbolTable::getStep | ( | T_STRING & | key | ) | const |
Same ... but for Steps
Definition at line 234 of file symboltable.cpp.


| Operand * SymbolTable::getSymbol | ( | T_STRING & | key | ) | const |
Return the symbol asosiated to the key. Key should be the Operand Name. Generaly, Operands are Constans, Variables, Functions ... The search is made in local scope first, then on the parent (global) scope and so on. For local lookup only see "getLocalSymbol()" If the symbol is not founded, return NULL
Definition at line 133 of file symboltable.cpp.


| Type * SymbolTable::getType | ( | T_STRING & | key | ) | const |
Same as before, but for Types
Definition at line 158 of file symboltable.cpp.


| Unit * SymbolTable::getUnit | ( | T_STRING & | key | ) | const |
Same ... but for Units
Definition at line 183 of file symboltable.cpp.


| bool SymbolTable::populateSymbol | ( | Operand * | o | ) |
Make this symbol to 'upgrade' it's scope to the next (parent) Table. It method is used to "export" a step's variable.
Definition at line 118 of file symboltable.cpp.

Definition at line 146 of file symboltable.cpp.


| T_STRING SymbolTable::toString | ( | ) |
T_FUNC_HASH SymbolTable::funcs [protected] |
Definition at line 125 of file symboltable.h.
SymbolTable* SymbolTable::parent [protected] |
Definition at line 129 of file symboltable.h.
T_STEPS_HASH SymbolTable::steps [protected] |
Definition at line 127 of file symboltable.h.
T_ST_HASH SymbolTable::symbols [protected] |
Definition at line 119 of file symboltable.h.
T_TYPE_HASH SymbolTable::types [protected] |
Definition at line 121 of file symboltable.h.
T_UNIT_HASH SymbolTable::units [protected] |
Definition at line 123 of file symboltable.h.