zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TSymbolTable Class Reference

#include <SymbolTable.h>

Public Member Functions

 TSymbolTable ()
 
 ~TSymbolTable ()
 
bool atBuiltInLevel ()
 
bool atGlobalLevel ()
 
void dump (TInfoSink &infoSink) const
 
TSymbolfind (const TString &name, bool *builtIn=0, bool *sameScope=0)
 
TSymbolfindBuiltIn (const TString &name)
 
TPrecision getDefaultPrecision (TBasicType type)
 
TSymbolTableLevelgetGlobalLevel ()
 
int getMaxSymbolId ()
 
TSymbolTableLevelgetOuterLevel ()
 
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< PrecisionStackLevelprecisionStack
 
std::vector< TSymbolTableLevel * > table
 
int uniqueId
 

Detailed Description

Definition at line 237 of file SymbolTable.h.

Member Typedef Documentation

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
TSymbol* TSymbolTable::findBuiltIn ( const TString name)
inline
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::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
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

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: