WSF
Us::UsCtx Class Reference

#include <UsCtx.hpp>

Collaboration diagram for Us::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
TyqType (Token *t)
TyType (Token *t)
TyqType (Ty *aTypePtr, std::pair< Ty *, Ty * > aArgs)
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)
UsSymbolSearch (const std::string &aName, int aDepth=100)
bool IsThisMethod (Token *t)
UsVal ThisValue ()
UsSymbolAddAppVariable (Ty *type, const std::string &aName)
UsSymbolAddEntry (Ty *type, Token *aIdent, int aVarFlags=0)
UsVal SymVal (UsSymbol *aSym)
UsVal Identifier (Token *aIdent)
UsVal Search (Token *aIdent)
TyRType (UsSymbol *s)
TyFuncRType ()
std::string Text (Token *t)
UsVal Op (UsVal &lhs, int op)
UsVal Ctor (Ty *aType, const UsValList &aArgs)
UsVal Op (UsVal &lhs, UsVal &idx, UsVal &rhs, int op)
UsVal Op (UsVal &lhs, UsVal &rhs, int op)
TyGetContainerKey (Ty *aType)
TyGetContainerValue (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)
TyBoolTy ()
TyVoidTy ()
TyIntTy ()
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]

◆ UsCtx() [2/2]

◆ ~UsCtx()

Us::UsCtx::~UsCtx ( )

Member Function Documentation

◆ AddAppVariable()

◆ AddEntry() [1/2]

◆ AddEntry() [2/2]

◆ AddParam()

◆ AddToInitializerList()

◆ AndCheck()

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

Referenced by Us::Parser::exp2().

◆ AndComplete()

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

References mConst.

Referenced by Us::Parser::exp2().

◆ AtDot() [1/2]

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

References mConst, and pos.

◆ AtDot() [2/2]

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

References mConst, and pos.

Referenced by Us::Parser::atom(), and Us::Parser::trailer().

◆ BeginCall()

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

◆ BeginStat()

int Us::UsCtx::BeginStat ( )

◆ BoolLiteral()

UsVal Us::UsCtx::BoolLiteral ( Token * t)

References mConst.

Referenced by Us::Parser::static_exp().

◆ BoolTy()

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

References mConst.

◆ Break()

void Us::UsCtx::Break ( )
inline

Referenced by Us::Parser::stat().

◆ Call()

◆ CallArgNext()

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

◆ Cast()

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

References ExplicitCast().

Referenced by Us::Parser::exp5().

◆ CodeOffset()

int Us::UsCtx::CodeOffset ( )
inline

◆ Continue()

void Us::UsCtx::Continue ( )
inline

Referenced by Us::Parser::stat().

◆ Ctor()

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

◆ DoCond()

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

Referenced by Us::Parser::do_stat().

◆ DoubleLiteral()

UsVal Us::UsCtx::DoubleLiteral ( Token * t)

References mConst.

Referenced by Us::Parser::static_exp().

◆ DoWhileStart()

void Us::UsCtx::DoWhileStart ( )
inline

Referenced by Us::Parser::do_stat().

◆ EndCall()

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

◆ EndContext()

void Us::UsCtx::EndContext ( )
inline

◆ EndStat()

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

Referenced by Us::Parser::stat().

◆ ExpectedType()

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

◆ ExplicitCast()

◆ ForCond()

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

Referenced by Us::Parser::stat().

◆ ForEachBegin()

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

Referenced by Us::Parser::stat().

◆ ForEnd()

void Us::UsCtx::ForEnd ( )
inline

◆ ForInc()

void Us::UsCtx::ForInc ( )
inline

Referenced by Us::Parser::stat().

◆ FuncComplete()

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

References UsCtx().

Referenced by Us::Parser::func_def().

◆ FuncDefStart()

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

References mFuncDefSym, and Us::UsVal::mSym.

Referenced by Us::Parser::func_def().

◆ FuncRType()

UsType * Us::UsCtx::FuncRType ( )

◆ GetAttribute() [1/2]

◆ GetAttribute() [2/2]

◆ GetClassMethod()

◆ GetClassVariable()

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

◆ GetContainerKey()

UsType * Us::UsCtx::GetContainerKey ( Ty * aType)

References UsType::mTemplateArgs.

Referenced by RealizeContainer().

◆ GetContainerValue()

UsType * Us::UsCtx::GetContainerValue ( Ty * aType)

References UsType::mTemplateArgs.

Referenced by Op(), and RealizeContainer().

◆ 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

Referenced by Us::Parser::stat().

◆ IfElseEnd()

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

Referenced by Us::Parser::stat().

◆ IfTrueEnd()

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

Referenced by Us::Parser::stat().

◆ ImplicitCast()

◆ IntLiteral()

UsVal Us::UsCtx::IntLiteral ( Token * t)

References mConst.

Referenced by Us::Parser::static_exp().

◆ IntTy()

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

References mConst.

◆ IsThisMethod()

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

References Us::UsObserver::cMETHOD, mConst, mSym, and Us::Token::val.

Referenced by Search().

◆ NewInitializerList()

UsVal Us::UsCtx::NewInitializerList ( )

◆ NewMirror()

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

◆ NewVal()

UsVal Us::UsCtx::NewVal ( Ty * ty)

References Us::UsVal::mType.

Referenced by RealizeContainer().

◆ NullLiteral()

UsVal Us::UsCtx::NullLiteral ( Token * t)

References mConst.

Referenced by Us::Parser::static_exp().

◆ Op() [1/3]

◆ Op() [2/3]

◆ Op() [3/3]

◆ OrCheck()

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

Referenced by Us::Parser::exp1().

◆ OrComplete()

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

References mConst.

Referenced by Us::Parser::exp1().

◆ qType() [1/2]

◆ qType() [2/2]

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

References mConst, UsType::mTypeId, and SemErr().

◆ RealizeContainer()

◆ Return()

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

Referenced by Us::Parser::stat().

◆ RType()

UsType * Us::UsCtx::RType ( UsSymbol * s)

References mConst.

◆ ScriptContext()

UsCtx * Us::UsCtx::ScriptContext ( )

◆ Search() [1/2]

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

◆ Search() [2/2]

◆ SemErr()

◆ SetBlockType()

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

◆ SetRType()

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

◆ StringLiteral()

UsVal Us::UsCtx::StringLiteral ( Token * t)

References mConst.

Referenced by Us::Parser::static_exp().

◆ SymVal()

UsVal Us::UsCtx::SymVal ( UsSymbol * aSym)

References mConst, UsSymbol::mRTypeId, and Us::UsVal::mType.

Referenced by VarDecl().

◆ Text()

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

References Us::Token::len, and Us::Token::val.

Referenced by AddEntry(), AddEntry(), and Search().

◆ ThisValue()

UsVal Us::UsCtx::ThisValue ( )

References mConst, and mSym.

Referenced by Search().

◆ Type()

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

References qType(), SemErr(), and Us::Token::val.

Referenced by Call(), and Us::Parser::type().

◆ VarDecl()

◆ VarDeclInit()

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

Referenced by Us::Parser::var_decl().

◆ VarDeclPreAssign()

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

Referenced by Us::Parser::var_decl().

◆ VoidTy()

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

References mConst.

◆ WhileCond()

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

Referenced by Us::Parser::while_stat().

◆ WhileEnd()

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

Member Data Documentation

◆ cLARGE_INT

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

Referenced by UsCtx().

◆ mAllowGlobals

bool Us::UsCtx::mAllowGlobals

Referenced by AddEntry(), UsCtx(), and UsCtx().

◆ mBlockType

BlockType Us::UsCtx::mBlockType

Referenced by ScriptContext(), UsCtx(), and UsCtx().

◆ mConst

◆ mContextFlags

int Us::UsCtx::mContextFlags

Referenced by UsCtx(), and UsCtx().

◆ mFuncDefSym

UsSymbol* Us::UsCtx::mFuncDefSym

◆ mGlobalVarMode

bool Us::UsCtx::mGlobalVarMode

◆ mParentCtx

UsCtx* Us::UsCtx::mParentCtx

Referenced by ScriptContext(), UsCtx(), and UsCtx().

◆ mSequenceNumberLimit

int Us::UsCtx::mSequenceNumberLimit

Referenced by AddEntry(), Search(), UsCtx(), UsCtx(), and VarDecl().

◆ mSym


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