WSF
UsCtx Class Reference

#include <UsCtx.hpp>

Collaboration diagram for UsCtx:

Public Types

enum  ContextFlags { cTEMPORARY_SYMBOL_TABLE = 1 }
enum  BlockType {
  cSCRIPT_BLOCK , cNORMAL_BLOCK , cWHILE_BLOCK , cDO_BLOCK ,
  cFOR_BLOCK , cFOREACH_BLOCK
}
enum  OperationId {
  cASSIGN , cASSIGN_INITIAL , cASSIGN_PLUS , cASSIGN_MINUS ,
  cASSIGN_TIMES , cASSIGN_DIV , cADD , cSUBTRACT ,
  cMULTIPLY , cDIVIDE , cOR , cAND ,
  cEQ , cNE , cLT , cGT ,
  cLE , cGE , cUNARY_MINUS , cUNARY_PLUS ,
  cINDEX , cNOT
}

Public Member Functions

 UsCtx (UsConstCtx *c)
 UsCtx (UsCtx &p, UsSymbolTable::TableLinkage aLinkage=UsSymbolTable::cNEW_SCOPE)
void EndContext ()
 ~UsCtx ()
UsObserverGetObserver () const
Ty * qType (Token *t)
Ty * qType (Ty *aTypePtr, std::pair< Ty *, Ty * > aArgs)
Ty * Type (Token *t)
void AddParam (Fn &fn, Ty *type, Token *aIdent, bool aIsFormalParam=false)
void SetRType (Fn &fn, Ty *type)
void FuncDefStart (UsVal &aScriptVal)
UsVal AddEntry (Token *aIdent, Fn &aFunc, bool aExtern, UsCtx *aFnCtx=nullptr)
UsSymbolAddEntry (Ty *type, Token *aIdent, int aVarFlags=0)
UsSymbolSearch (const std::string &aName, int aDepth=100)
UsVal Search (Token *aIdent)
bool IsThisMethod (Token *t)
UsVal ThisValue ()
UsSymbolAddAppVariable (Ty *type, const std::string &aName)
UsVal SymVal (UsSymbol *aSym)
UsVal Identifier (Token *aIdent)
Ty * RType (UsSymbol *s)
Ty * FuncRType ()
std::string Text (Token *t)
UsVal Op (UsVal &lhs, int op)
UsVal Op (UsVal &lhs, UsVal &idx, UsVal &rhs, int op)
UsVal Op (UsVal &lhs, UsVal &rhs, int op)
UsVal Ctor (Ty *aType, const UsValList &aArgs)
Ty * GetContainerKey (Ty *aType)
Ty * GetContainerValue (Ty *aType)
void AddToInitializerList (UsVal &initList, UsVal &p1, UsVal *p2)
UsVal Cast (UsVal &v, Ty *ty)
UsVal StringLiteral (Token *t)
UsVal DoubleLiteral (Token *t)
UsVal IntLiteral (Token *t)
UsVal BoolLiteral (Token *t)
UsVal NullLiteral (Token *t)
UsVal NewInitializerList ()
UsVal RealizeContainer (UsInitializerList &aInitializer, Ty *aLhsType)
UsVal ImplicitCast (UsVal v, Ty *ty)
UsVal ExplicitCast (UsVal &v, Ty *ty)
void ExpectedType (UsVal &v, Ty *t)
UsVal GetAttribute (UsVal &v, Token *t)
UsVal GetAttribute (Ty *ty, Token *t)
UsVal GetDynAttribute (UsVal &v, Token *t)
UsVal GetClassMethod (UsVal &v, Token *t)
UsVal GetClassVariable (UsVal &v, Token *t)
UsVal VarDecl (Ty *ty, Token *t, int flags=0)
UsVal Call (UsVal &fn, UsValList &args, UsVal *aReturnVal=nullptr)
void VarDeclInit (UsVal &v)
void VarDeclPreAssign (UsVal &v)
Ty * BoolTy ()
Ty * VoidTy ()
Ty * IntTy ()
void AtDot (Ty *aTypePtr, int pos)
void AtDot (const UsVal &aVal, int pos)
void HitEOF ()
UsVal AndComplete (UsVal &orResult, UsVal &rhs, int aJumpOffset)
void WhileCond (UsVal &v)
void WhileEnd (int aEnd)
int OrCheck (UsVal &aLhs, UsVal &aOrResult)
UsVal OrComplete (UsVal &orResult, UsVal &rhs, int aJumpOffset)
int AndCheck (UsVal &aLhs, UsVal &aOrResult)
int IfCond (UsVal &v)
int IfTrueEnd (int falseTarget, bool aHasElse)
void IfElseEnd (int aElseEnd)
void SetBlockType (BlockType aBlockType)
void Break ()
void Continue ()
void DoWhileStart ()
void DoCond (UsVal &v)
void ForCond (UsVal &v)
void ForInc ()
void ForEnd ()
void ForEachBegin (UsVal &key, UsVal &val, UsVal &container)
void Return (UsVal &v)
void FuncComplete (UsVal &aFnVal, UsCtx &aFnCtx)
int CodeOffset ()
UsCtxScriptContext ()
int BeginStat ()
void EndStat (int aStatNum)
void SemErr (const char *aMsg)
void BeginCall (UsVal &fn, int aPos)
void EndCall (UsVal &fn, int aPos)
void CallArgNext (int aPos)
UsVal NewVal (Ty *ty)

Static Public Member Functions

static std::unique_ptr< UsCtxNewMirror (UsConstCtx *c, UsSymbolTable *aParentSymbolTable, int aSequenceNumberLimit)

Public Attributes

UsCtxmParentCtx
UsConstCtxmConst
UsSymbolTablemSym
UsSymbolmFuncDefSym
bool mGlobalVarMode
bool mAllowGlobals
int mContextFlags
int mSequenceNumberLimit
BlockType mBlockType

Static Public Attributes

static const int cLARGE_INT = 0x7fffffff

Member Enumeration Documentation

◆ BlockType

Enumerator
cSCRIPT_BLOCK 
cNORMAL_BLOCK 
cWHILE_BLOCK 
cDO_BLOCK 
cFOR_BLOCK 
cFOREACH_BLOCK 

◆ ContextFlags

Enumerator
cTEMPORARY_SYMBOL_TABLE 

◆ OperationId

Enumerator
cASSIGN 
cASSIGN_INITIAL 
cASSIGN_PLUS 
cASSIGN_MINUS 
cASSIGN_TIMES 
cASSIGN_DIV 
cADD 
cSUBTRACT 
cMULTIPLY 
cDIVIDE 
cOR 
cAND 
cEQ 
cNE 
cLT 
cGT 
cLE 
cGE 
cUNARY_MINUS 
cUNARY_PLUS 
cINDEX 
cNOT 

Constructor & Destructor Documentation

◆ UsCtx() [1/2]

Us::UsCtx::UsCtx ( UsConstCtx * c)
explicit

◆ UsCtx() [2/2]

◆ ~UsCtx()

Member Function Documentation

◆ AddAppVariable()

UsSymbol * Us::UsCtx::AddAppVariable ( Ty * type,
const std::string & aName )

◆ AddEntry() [1/2]

UsVal Us::UsCtx::AddEntry ( Token * aIdent,
Fn & aFunc,
bool aExtern,
UsCtx * aFnCtx = nullptr )

◆ AddEntry() [2/2]

UsSymbol * Us::UsCtx::AddEntry ( Ty * type,
Token * aIdent,
int aVarFlags = 0 )

◆ AddParam()

void Us::UsCtx::AddParam ( Fn & fn,
Ty * type,
Token * aIdent,
bool aIsFormalParam = false )

◆ AddToInitializerList()

void Us::UsCtx::AddToInitializerList ( UsVal & initList,
UsVal & p1,
UsVal * p2 )

◆ AndCheck()

int Us::UsCtx::AndCheck ( UsVal & aLhs,
UsVal & aOrResult )
inline

◆ AndComplete()

UsVal Us::UsCtx::AndComplete ( UsVal & orResult,
UsVal & rhs,
int aJumpOffset )
inline

◆ AtDot() [1/2]

void Us::UsCtx::AtDot ( const UsVal & aVal,
int pos )
inline

◆ AtDot() [2/2]

void Us::UsCtx::AtDot ( Ty * aTypePtr,
int pos )
inline

◆ BeginCall()

void Us::UsCtx::BeginCall ( UsVal & fn,
int aPos )

◆ BeginStat()

◆ BoolLiteral()

◆ BoolTy()

Ty * Us::UsCtx::BoolTy ( )
inline

◆ Break()

void Us::UsCtx::Break ( )
inline

◆ Call()

UsVal Us::UsCtx::Call ( UsVal & fn,
UsValList & args,
UsVal * aReturnVal = nullptr )

◆ CallArgNext()

void Us::UsCtx::CallArgNext ( int aPos)

◆ Cast()

UsVal Us::UsCtx::Cast ( UsVal & v,
Ty * ty )

◆ CodeOffset()

int Us::UsCtx::CodeOffset ( )
inline

◆ Continue()

void Us::UsCtx::Continue ( )
inline

◆ Ctor()

UsVal Us::UsCtx::Ctor ( Ty * aType,
const UsValList & aArgs )

◆ DoCond()

void Us::UsCtx::DoCond ( UsVal & v)
inline

◆ DoubleLiteral()

◆ DoWhileStart()

void Us::UsCtx::DoWhileStart ( )
inline

◆ EndCall()

void Us::UsCtx::EndCall ( UsVal & fn,
int aPos )

◆ EndContext()

void Us::UsCtx::EndContext ( )
inline

◆ EndStat()

void Us::UsCtx::EndStat ( int aStatNum)
inline

◆ ExpectedType()

void Us::UsCtx::ExpectedType ( UsVal & v,
Ty * t )

◆ ExplicitCast()

UsVal Us::UsCtx::ExplicitCast ( UsVal & v,
Ty * ty )

◆ ForCond()

void Us::UsCtx::ForCond ( UsVal & v)
inline

◆ ForEachBegin()

void Us::UsCtx::ForEachBegin ( UsVal & key,
UsVal & val,
UsVal & container )
inline

◆ ForEnd()

void Us::UsCtx::ForEnd ( )
inline

◆ ForInc()

void Us::UsCtx::ForInc ( )
inline

◆ FuncComplete()

void Us::UsCtx::FuncComplete ( UsVal & aFnVal,
UsCtx & aFnCtx )
inline

◆ FuncDefStart()

void Us::UsCtx::FuncDefStart ( UsVal & aScriptVal)

◆ FuncRType()

◆ GetAttribute() [1/2]

UsVal Us::UsCtx::GetAttribute ( Ty * ty,
Token * t )

◆ GetAttribute() [2/2]

UsVal Us::UsCtx::GetAttribute ( UsVal & v,
Token * t )

◆ GetClassMethod()

UsVal Us::UsCtx::GetClassMethod ( UsVal & v,
Token * t )

◆ GetClassVariable()

◆ GetContainerKey()

◆ GetContainerValue()

◆ GetDynAttribute()

UsVal Us::UsCtx::GetDynAttribute ( UsVal & v,
Token * t )

◆ GetObserver()

UsObserver * Us::UsCtx::GetObserver ( ) const
inline

◆ HitEOF()

void Us::UsCtx::HitEOF ( )
inline

◆ Identifier()

UsVal Us::UsCtx::Identifier ( Token * aIdent)

◆ IfCond()

int Us::UsCtx::IfCond ( UsVal & v)
inline

◆ IfElseEnd()

void Us::UsCtx::IfElseEnd ( int aElseEnd)
inline

◆ IfTrueEnd()

int Us::UsCtx::IfTrueEnd ( int falseTarget,
bool aHasElse )
inline

◆ ImplicitCast()

◆ IntLiteral()

◆ IntTy()

Ty * Us::UsCtx::IntTy ( )
inline

◆ IsThisMethod()

bool Us::UsCtx::IsThisMethod ( Token * t)

◆ NewInitializerList()

◆ NewMirror()

std::unique_ptr< UsCtx > Us::UsCtx::NewMirror ( UsConstCtx * c,
UsSymbolTable * aParentSymbolTable,
int aSequenceNumberLimit )
inlinestatic

◆ NewVal()

◆ NullLiteral()

◆ Op() [1/3]

UsVal Us::UsCtx::Op ( UsVal & lhs,
int op )

◆ Op() [2/3]

UsVal Us::UsCtx::Op ( UsVal & lhs,
UsVal & idx,
UsVal & rhs,
int op )

◆ Op() [3/3]

UsVal Us::UsCtx::Op ( UsVal & lhs,
UsVal & rhs,
int op )

◆ OrCheck()

int Us::UsCtx::OrCheck ( UsVal & aLhs,
UsVal & aOrResult )
inline

◆ OrComplete()

UsVal Us::UsCtx::OrComplete ( UsVal & orResult,
UsVal & rhs,
int aJumpOffset )
inline

◆ qType() [1/2]

UsType * Us::UsCtx::qType ( Token * t)

◆ qType() [2/2]

UsType * Us::UsCtx::qType ( Ty * aTypePtr,
std::pair< Ty *, Ty * > aArgs )

◆ RealizeContainer()

UsVal Us::UsCtx::RealizeContainer ( UsInitializerList & aInitializer,
Ty * aLhsType )

◆ Return()

void Us::UsCtx::Return ( UsVal & v)
inline

◆ RType()

◆ ScriptContext()

◆ Search() [1/2]

UsSymbol * Us::UsCtx::Search ( const std::string & aName,
int aDepth = 100 )
inline

◆ Search() [2/2]

UsVal Us::UsCtx::Search ( Token * aIdent)

◆ SemErr()

void Us::UsCtx::SemErr ( const char * aMsg)

◆ SetBlockType()

void Us::UsCtx::SetBlockType ( BlockType aBlockType)
inline

◆ SetRType()

void Us::UsCtx::SetRType ( Fn & fn,
Ty * type )

◆ StringLiteral()

◆ SymVal()

◆ Text()

std::string Us::UsCtx::Text ( Token * t)

◆ ThisValue()

◆ Type()

Ty * Us::UsCtx::Type ( Token * t)

◆ VarDecl()

UsVal Us::UsCtx::VarDecl ( Ty * ty,
Token * t,
int flags = 0 )

◆ VarDeclInit()

void Us::UsCtx::VarDeclInit ( UsVal & v)
inline

◆ VarDeclPreAssign()

void Us::UsCtx::VarDeclPreAssign ( UsVal & v)
inline

◆ VoidTy()

Ty * Us::UsCtx::VoidTy ( )
inline

◆ WhileCond()

void Us::UsCtx::WhileCond ( UsVal & v)
inline

◆ WhileEnd()

void Us::UsCtx::WhileEnd ( int aEnd)
inline

Member Data Documentation

◆ cLARGE_INT

const int Us::UsCtx::cLARGE_INT = 0x7fffffff
static

◆ mAllowGlobals

◆ mBlockType

◆ mConst

◆ mContextFlags

◆ mFuncDefSym

◆ mGlobalVarMode

◆ mParentCtx

◆ mSequenceNumberLimit

◆ mSym


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved