|
WSF
|
#include <UsCtx.hpp>

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 () | |
| UsObserver * | GetObserver () const |
| Ty * | qType (Token *t) |
| Ty * | Type (Token *t) |
| Ty * | qType (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) |
| UsSymbol * | Search (const std::string &aName, int aDepth=100) |
| bool | IsThisMethod (Token *t) |
| UsVal | ThisValue () |
| UsSymbol * | AddAppVariable (Ty *type, const std::string &aName) |
| UsSymbol * | AddEntry (Ty *type, Token *aIdent, int aVarFlags=0) |
| UsVal | SymVal (UsSymbol *aSym) |
| UsVal | Identifier (Token *aIdent) |
| UsVal | Search (Token *aIdent) |
| Ty * | RType (UsSymbol *s) |
| Ty * | FuncRType () |
| 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) |
| 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 () |
| UsCtx * | ScriptContext () |
| 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< UsCtx > | NewMirror (UsConstCtx *c, UsSymbolTable *aParentSymbolTable, int aSequenceNumberLimit) |
Public Attributes | |
| UsCtx * | mParentCtx |
| UsConstCtx * | mConst |
| UsSymbolTable * | mSym |
| UsSymbol * | mFuncDefSym |
| bool | mGlobalVarMode |
| bool | mAllowGlobals |
| int | mContextFlags |
| int | mSequenceNumberLimit |
| BlockType | mBlockType |
Static Public Attributes | |
| static const int | cLARGE_INT = 0x7fffffff |
| enum Us::UsCtx::BlockType |
|
explicit |
References cLARGE_INT, cSCRIPT_BLOCK, mAllowGlobals, mBlockType, mConst, mContextFlags, mFuncDefSym, mGlobalVarMode, mParentCtx, mSequenceNumberLimit, mSym, and Us::UsConstCtx::mSymbolTablePoolPtr.
Referenced by AddEntry(), FuncComplete(), ScriptContext(), and UsCtx().
| Us::UsCtx::UsCtx | ( | UsCtx & | p, |
| UsSymbolTable::TableLinkage | aLinkage = UsSymbolTable::cNEW_SCOPE ) |
References UsSymbolTable::AddInner(), cNORMAL_BLOCK, mAllowGlobals, mBlockType, mConst, mContextFlags, mFuncDefSym, mGlobalVarMode, mParentCtx, mSequenceNumberLimit, mSym, and UsCtx().
| Us::UsCtx::~UsCtx | ( | ) |
References GetObserver(), mConst, mFuncDefSym, mSym, and Us::UsObserver::ScriptDefinition().
References UsSymbol::cSE_EXTERN, UsSymbol::cSE_NOT_APPLICABLE, UsSymbol::cSE_SCRIPT, mConst, UsSymbol::mEntryType, UsSymbol::mLexicalScopePtr, UsSymbol::mName, UsSymbol::mPosition, UsSymbol::mRTypeId, UsSymbol::mSequenceNumber, UsSymbol::mStorageType, mSym, Us::UsVal::mSym, UsSymbol::mTablePtr, Us::Token::pos, Search(), Text(), and UsCtx().
Referenced by AddParam(), Us::Parser::extern_stat(), Us::Parser::func_def(), and VarDecl().
References Us::UsVal::cEXTERN_VARIABLE, Us::UsVal::cGLOBAL_VARIABLE, Us::UsVal::cPARAMETER_VARIABLE, UsSymbol::cSE_AUTOMATIC, UsSymbol::cSE_EXTERN, UsSymbol::cSE_GLOBAL, UsSymbol::cSE_PARAMETER, UsSymbol::cSE_STATIC, UsSymbol::cSE_VARIABLE, Us::UsVal::cSTATIC_VARIABLE, GetObserver(), UsType::Id(), mAllowGlobals, mConst, UsSymbol::mEntryType, UsSymbol::mLexicalScopePtr, UsSymbol::mName, UsSymbol::mPosition, UsSymbol::mRTypeId, UsSymbol::mSequenceNumber, mSequenceNumberLimit, UsSymbol::mStorageType, mSym, UsSymbol::mTablePtr, Us::Token::pos, tbl, Text(), and Us::UsObserver::VarDecl().
Referenced by Us::Parser::exp2().
References mConst.
Referenced by Us::Parser::exp2().
|
inline |
Referenced by Us::Parser::atom(), and Us::Parser::trailer().
| void Us::UsCtx::BeginCall | ( | UsVal & | fn, |
| int | aPos ) |
References Us::UsObserver::BeginCall(), and GetObserver().
| int Us::UsCtx::BeginStat | ( | ) |
References Us::UsObserver::AtStat(), and GetObserver().
Referenced by Us::Parser::stat().
References mConst.
Referenced by Us::Parser::static_exp().
|
inline |
Referenced by Us::Parser::stat().
References UsType::FindMethod(), ImplicitCast(), UsSymbol::IsPrototype(), UsFunction::mArgs, mConst, Us::UsVal::mMethodNamePtr, UsFunction::mReturnType, UsSymbol::mRTypeId, Us::UsVal::mSym, Us::UsVal::mType, ok, RealizeContainer(), SemErr(), DynamicArray< T, ARRAY_SIZE, GROW_SIZE >::size(), Type(), and Us::UsVal::Type().
Referenced by Us::Parser::atom(), Op(), and Us::Parser::trailer().
| void Us::UsCtx::CallArgNext | ( | int | aPos | ) |
References Us::UsObserver::CallArgNext(), and GetObserver().
References ExplicitCast().
Referenced by Us::Parser::exp5().
|
inline |
|
inline |
Referenced by Us::Parser::stat().
References UsType::cCONSTRUCTIBLE, mConst, UsType::mFlags, and SemErr().
Referenced by Us::Parser::atom().
|
inline |
Referenced by Us::Parser::do_stat().
References mConst.
Referenced by Us::Parser::static_exp().
|
inline |
Referenced by Us::Parser::do_stat().
| void Us::UsCtx::EndCall | ( | UsVal & | fn, |
| int | aPos ) |
References Us::UsObserver::EndCall(), and GetObserver().
|
inline |
Referenced by Us::Parser::stat(), and Us::Parser::while_stat().
|
inline |
Referenced by Us::Parser::stat().
References UsType::mName, SemErr(), Us::UsVal::Type(), and Us::UsVal::TypeName().
References UsType::Id(), UsType::IsBaseType(), UsType::IsExplicitlyCastable(), UsType::IsImplicitlyCastable(), mConst, Us::UsVal::mType, and SemErr().
Referenced by Cast().
|
inline |
Referenced by Us::Parser::stat().
Referenced by Us::Parser::stat().
|
inline |
|
inline |
Referenced by Us::Parser::stat().
References UsCtx().
Referenced by Us::Parser::func_def().
| void Us::UsCtx::FuncDefStart | ( | UsVal & | aScriptVal | ) |
References mFuncDefSym, and Us::UsVal::mSym.
Referenced by Us::Parser::func_def().
| UsType * Us::UsCtx::FuncRType | ( | ) |
References mConst, mFuncDefSym, and UsFunction::mReturnType.
References Us::UsObserver::cMETHOD, UsFunction::cSTATIC, Us::UsObserver::cSTATIC_METHOD, mConst, Us::UsVal::mMethodNamePtr, UsType::mMethods, SemErr(), Us::UsVal::Type(), and Us::Token::val.
Referenced by Us::Parser::atom(), and Search().
References Us::UsObserver::cMETHOD, UsFunction::cSTATIC, Us::UsObserver::cSTATIC_METHOD, mConst, Us::UsVal::mMethodNamePtr, UsType::mMethods, SemErr(), Us::UsVal::Type(), and Us::Token::val.
Referenced by Us::Parser::trailer().
References Us::UsVal::mType, UsType::mVariables, SemErr(), Us::UsVal::Type(), and Us::Token::val.
Referenced by Us::Parser::trailer().
References UsType::mTemplateArgs.
Referenced by RealizeContainer().
References UsType::mTemplateArgs.
Referenced by Op(), and RealizeContainer().
References Us::UsObserver::cMETHOD, mConst, and Us::UsVal::mType.
Referenced by Us::Parser::trailer().
|
inline |
References mConst.
Referenced by AddEntry(), BeginCall(), BeginStat(), CallArgNext(), EndCall(), HitEOF(), and ~UsCtx().
|
inline |
References GetObserver(), and Us::UsObserver::HitEOF().
References COCO_STR, Us::UsVal::IsEmpty(), Search(), and SemErr().
Referenced by Us::Parser::identifier().
|
inline |
Referenced by Us::Parser::stat().
|
inline |
Referenced by Us::Parser::stat().
|
inline |
Referenced by Us::Parser::stat().
References UsType::Id(), UsType::IsBaseType(), UsType::IsImplicitlyCastable(), mConst, Us::UsVal::mInitList, UsType::mName, Us::UsVal::mType, RealizeContainer(), and SemErr().
Referenced by Call(), Op(), and RealizeContainer().
References mConst.
Referenced by Us::Parser::static_exp().
| bool Us::UsCtx::IsThisMethod | ( | Token * | t | ) |
References Us::UsObserver::cMETHOD, mConst, mSym, and Us::Token::val.
Referenced by Search().
| UsVal Us::UsCtx::NewInitializerList | ( | ) |
References Us::UsVal::mInitList.
Referenced by Us::Parser::initializer_list().
|
inlinestatic |
References UsSymbolTable::cLOCAL_SCOPE, and cTEMPORARY_SYMBOL_TABLE.
References Us::UsVal::mType.
Referenced by RealizeContainer().
References mConst.
Referenced by Us::Parser::static_exp().
References Call(), cINDEX, GetContainerValue(), Us::UsVal::mInitList, Us::UsVal::mMethodNamePtr, Us::UsVal::mType, and RealizeContainer().
References cADD, cAND, cASSIGN, cASSIGN_INITIAL, cDIVIDE, cEQ, cGE, cGT, cLE, cLT, cMULTIPLY, cNE, cOR, cSUBTRACT, ImplicitCast(), mConst, Us::UsVal::mType, and Us::UsVal::Type().
Referenced by Us::Parser::exp1().
References mConst.
Referenced by Us::Parser::exp1().
References Us::Parser::_bool, Us::Parser::_char, Us::Parser::_double, Us::Parser::_int, Us::Parser::_string, Us::Token::kind, mConst, and Us::Token::val.
Referenced by Us::Parser::IsType(), Us::Parser::IsType(), Type(), and Us::Parser::type().
References mConst, UsType::mTypeId, and SemErr().
| UsVal Us::UsCtx::RealizeContainer | ( | UsInitializerList & | aInitializer, |
| Ty * | aLhsType ) |
References UsType::cCONSTRUCTIBLE, GetContainerKey(), GetContainerValue(), UsType::Id(), ImplicitCast(), mConst, Us::UsInitializerList::mDataPtr, Us::UsInitializerListData::mEntries, UsType::mFlags, UsType::mTypeId, NewVal(), and SemErr().
Referenced by Call(), ImplicitCast(), and Op().
|
inline |
Referenced by Us::Parser::stat().
| UsCtx * Us::UsCtx::ScriptContext | ( | ) |
References cSCRIPT_BLOCK, mBlockType, mParentCtx, and UsCtx().
|
inline |
References mSequenceNumberLimit, and mSym.
Referenced by AddEntry(), Identifier(), Us::Parser::IsScript(), and Search().
| void Us::UsCtx::SemErr | ( | const char * | aMsg | ) |
References mConst.
Referenced by AddToInitializerList(), Call(), Ctor(), ExpectedType(), ExplicitCast(), GetAttribute(), GetAttribute(), GetClassMethod(), GetClassVariable(), Identifier(), ImplicitCast(), qType(), RealizeContainer(), Type(), and VarDecl().
|
inline |
Referenced by Us::Parser::do_stat(), Us::Parser::func_def(), Us::Parser::stat(), and Us::Parser::while_stat().
References UsType::Id(), and UsFunction::mReturnType.
Referenced by Us::Parser::extern_stat(), and Us::Parser::func_def().
References mConst.
Referenced by Us::Parser::static_exp().
References mConst, UsSymbol::mRTypeId, and Us::UsVal::mType.
Referenced by VarDecl().
| std::string Us::UsCtx::Text | ( | Token * | t | ) |
References Us::Token::len, and Us::Token::val.
Referenced by AddEntry(), AddEntry(), and Search().
References qType(), SemErr(), and Us::Token::val.
Referenced by Call(), and Us::Parser::type().
References AddEntry(), Us::UsVal::cEXTERN_VARIABLE, Us::UsVal::cGLOBAL_VARIABLE, Us::UsObserver::cLOCAL_VARIABLE, UsType::Id(), mConst, mGlobalVarMode, UsSymbol::mRTypeId, mSequenceNumberLimit, mSym, SemErr(), SymVal(), and Us::Token::val.
Referenced by Us::Parser::extern_stat(), Us::Parser::var_decl(), and Us::Parser::var_decl_expr().
|
inline |
Referenced by Us::Parser::var_decl().
|
inline |
Referenced by Us::Parser::var_decl().
|
inline |
Referenced by Us::Parser::while_stat().
|
inline |
|
static |
Referenced by UsCtx().
| bool Us::UsCtx::mAllowGlobals |
Referenced by AddEntry(), UsCtx(), and UsCtx().
| BlockType Us::UsCtx::mBlockType |
Referenced by ScriptContext(), UsCtx(), and UsCtx().
| UsConstCtx* Us::UsCtx::mConst |
Referenced by AddAppVariable(), AddEntry(), AddEntry(), AddParam(), AndComplete(), AtDot(), AtDot(), BoolLiteral(), BoolTy(), Call(), Ctor(), DoubleLiteral(), ExplicitCast(), FuncRType(), GetAttribute(), GetAttribute(), GetClassMethod(), GetDynAttribute(), GetObserver(), ImplicitCast(), IntLiteral(), IntTy(), IsThisMethod(), NullLiteral(), Op(), Op(), OrComplete(), qType(), qType(), RealizeContainer(), RType(), Search(), SemErr(), StringLiteral(), SymVal(), ThisValue(), UsCtx(), UsCtx(), VarDecl(), VoidTy(), and ~UsCtx().
| UsSymbol* Us::UsCtx::mFuncDefSym |
Referenced by FuncDefStart(), FuncRType(), UsCtx(), UsCtx(), and ~UsCtx().
| bool Us::UsCtx::mGlobalVarMode |
Referenced by wizard::WsfScriptParser::ProcessScript(), UsCtx(), UsCtx(), and VarDecl().
| UsCtx* Us::UsCtx::mParentCtx |
Referenced by ScriptContext(), UsCtx(), and UsCtx().
| int Us::UsCtx::mSequenceNumberLimit |
Referenced by AddEntry(), Search(), UsCtx(), UsCtx(), and VarDecl().
| UsSymbolTable* Us::UsCtx::mSym |