zenilib: TSymbolTable Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
TSymbolTable Class Reference

`#include <SymbolTable.h>`

## Public Member Functions

| TSymbolTable ()
| ~TSymbolTable ()
bool | atBuiltInLevel ()
bool | atGlobalLevel ()
void | dump (TInfoSink &infoSink) const
TSymbol * | find (const TString &name, bool *builtIn=0, bool *sameScope=0)
TSymbol * | findBuiltIn (const TString &name)
TPrecision | getDefaultPrecision (TBasicType type)
TSymbolTableLevel * | getGlobalLevel ()
int | getMaxSymbolId ()
TSymbolTableLevel * | getOuterLevel ()
bool | insert (TSymbol &symbol)
bool | insertBuiltIn (TType *rvalue, const char *name, TType *ptype1, TType *ptype2=0, TType *ptype3=0)
bool | insertConstInt (const char *name, int value)
bool | isEmpty ()
void | pop ()
void | push ()
void | relateToExtension (const char *name, const TString &ext)
void | relateToOperator (const char *name, TOperator op)
bool | setDefaultPrecision (const TPublicType &type, TPrecision prec)

## Protected Types

typedef std::map< TBasicType, TPrecision > | PrecisionStackLevel

## Protected Member Functions

int | currentLevel () const

## Protected Attributes

std::vector< PrecisionStackLevel > | precisionStack
std::vector< TSymbolTableLevel * > | table
int | uniqueId

## Detailed Description

Definition at line 237 of file SymbolTable.h.

## Member Typedef Documentation

typedef std::map< TBasicType, TPrecision > TSymbolTable::PrecisionStackLevel

protected

Definition at line 385 of file SymbolTable.h.

## Constructor & Destructor Documentation

TSymbolTable::TSymbolTable | ( |  | ) |

inline

Definition at line 239 of file SymbolTable.h.

TSymbolTable::~TSymbolTable | ( |  | ) |

inline

Definition at line 248 of file SymbolTable.h.

References pop().

## Member Function Documentation

bool TSymbolTable::atBuiltInLevel | ( |  | ) |

inline

Definition at line 261 of file SymbolTable.h.

Referenced by TCompiler::compile(), and TParseContext::reservedErrorCheck().

bool TSymbolTable::atGlobalLevel | ( |  | ) |

inline

Definition at line 262 of file SymbolTable.h.

Referenced by TCompiler::compile().

int TSymbolTable::currentLevel | ( |  | ) | const

inlineprotected

Definition at line 382 of file SymbolTable.h.

Referenced by dump(), find(), getOuterLevel(), insert(), and pop().

void TSymbolTable::dump | ( | TInfoSink & | infoSink | ) | const

Definition at line 151 of file SymbolTable.cpp.

References currentLevel(), and TInfoSink::debug.

TSymbol* TSymbolTable::find | ( | const TString & | name,
|  | bool * | builtIn = `0`,
|  | bool * | sameScope = `0`
| ) |  |

inline

Definition at line 311 of file SymbolTable.h.

References currentLevel().

Referenced by TParseContext::arrayErrorCheck(), TParseContext::executeInitializer(), and TParseContext::findFunction().

TSymbol* TSymbolTable::findBuiltIn | ( | const TString & | name | ) |

inline

Definition at line 327 of file SymbolTable.h.

Referenced by TOutputGLSLBase::hashFunctionName(), TOutputGLSLBase::hashVariableName(), and TOutputGLSLBase::visitBinary().

TPrecision TSymbolTable::getDefaultPrecision | ( | TBasicType | type | ) |

inline

Definition at line 364 of file SymbolTable.h.

References assert, EbpUndefined, EbtFloat, EbtInt, prec, and precisionStack.

TSymbolTableLevel* TSymbolTable::getGlobalLevel | ( |  | ) |

inline

Definition at line 332 of file SymbolTable.h.

References assert.

int TSymbolTable::getMaxSymbolId | ( |  | ) |

inline

Definition at line 348 of file SymbolTable.h.

References uniqueId.

TSymbolTableLevel* TSymbolTable::getOuterLevel | ( |  | ) |

inline

Definition at line 337 of file SymbolTable.h.

References assert, and currentLevel().

bool TSymbolTable::insert | ( | TSymbol & | symbol | ) |

inline

Definition at line 276 of file SymbolTable.h.

References currentLevel(), TSymbol::setUniqueId(), and uniqueId.

Referenced by TParseContext::arrayErrorCheck(), TParseContext::executeInitializer(), IdentifyBuiltIns(), insertBuiltIn(), InsertBuiltInFunctions(), insertConstInt(), and TParseContext::nonInitErrorCheck().

bool TSymbolTable::insertBuiltIn | ( | TType * | rvalue,
|  | const char * | name,
|  | TType * | ptype1,
|  | TType * | ptype2 = `0`,
|  | TType * | ptype3 = `0`
| ) |  |

inline

Definition at line 289 of file SymbolTable.h.

References insert(), NewPoolTString(), and NULL.

Referenced by InsertBuiltInFunctions().

bool TSymbolTable::insertConstInt | ( | const char * | name,
|  | int | value
| ) |  |

inline

Definition at line 282 of file SymbolTable.h.

References EbpUndefined, EbtInt, EvqConst, TVariable::getConstPointer(), insert(), NewPoolTString(), and ConstantUnion::setIConst().

Referenced by InsertBuiltInFunctions().

bool TSymbolTable::isEmpty | ( |  | ) |

inline

Definition at line 260 of file SymbolTable.h.

Referenced by TCompiler::InitBuiltInSymbolTable().

void TSymbolTable::pop | ( |  | ) |

inline

Definition at line 269 of file SymbolTable.h.

References currentLevel(), and precisionStack.

Referenced by TCompiler::compile(), and ~TSymbolTable().

void TSymbolTable::push | ( |  | ) |

inline

Definition at line 263 of file SymbolTable.h.

References precisionStack.

Referenced by TCompiler::compile(), and TCompiler::InitBuiltInSymbolTable().

void TSymbolTable::relateToExtension | ( | const char * | name,
|  | const TString & | ext
| ) |  |

inline

Definition at line 345 of file SymbolTable.h.

Referenced by IdentifyBuiltIns().

void TSymbolTable::relateToOperator | ( | const char * | name,
|  | TOperator | op
| ) |  |

inline

Definition at line 342 of file SymbolTable.h.

Referenced by IdentifyBuiltIns().

bool TSymbolTable::setDefaultPrecision | ( | const TPublicType & | type,
|  | TPrecision | prec
| ) |  |

inline

Definition at line 351 of file SymbolTable.h.

References TPublicType::array, EbtFloat, EbtInt, IsSampler(), TPublicType::matrix, prec, precisionStack, TPublicType::size, and TPublicType::type.

Referenced by TCompiler::InitBuiltInSymbolTable().

## Member Data Documentation

std::vector< PrecisionStackLevel > TSymbolTable::precisionStack

protected

Definition at line 386 of file SymbolTable.h.

Referenced by getDefaultPrecision(), pop(), push(), and setDefaultPrecision().

std::vector<TSymbolTableLevel*> TSymbolTable::table

protected

Definition at line 384 of file SymbolTable.h.

int TSymbolTable::uniqueId

protected

Definition at line 387 of file SymbolTable.h.

Referenced by getMaxSymbolId(), and insert().

The documentation for this class was generated from the following files:

- zenilib/jni/external/angle/src/compiler/SymbolTable.h
- zenilib/jni/external/angle/src/compiler/SymbolTable.cpp