Colobot
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
CBot::CBotExprVar Class Reference

Expression representing a variable name. More...

#include <CBotExprVar.h>

Inheritance diagram for CBot::CBotExprVar:
Inheritance graph
[legend]

Public Member Functions

bool Execute (CBotStack *&pj) override
 Execute Execute, making the value of a variable. More...
 
void RestoreState (CBotStack *&pj, bool bMain) override
 RestoreState. More...
 
bool ExecuteVar (CBotVar *&pVar, CBotStack *&pile, CBotToken *prevToken, bool bStep)
 ExecuteVar Fetch a variable at runtime. More...
 
void RestoreStateVar (CBotStack *&pj, bool bMain) override
 RestoreStateVar Fetch variable at runtime. More...
 
- Public Member Functions inherited from CBot::CBotInstr
 CBotInstr ()
 Constructor. More...
 
virtual ~CBotInstr ()
 Destructor. More...
 
virtual bool Execute (CBotStack *&pj, CBotVar *pVar)
 Execute. More...
 
virtual bool ExecuteVar (CBotVar *&pVar, CBotCStack *&pile)
 ExecuteVar. More...
 
virtual bool ExecuteVar (CBotVar *&pVar, CBotStack *&pile, CBotToken *prevToken, bool bStep, bool bExtend)
 ExecuteVar. More...
 
virtual bool CompCase (CBotStack *&pj, int val)
 CompCase This routine is defined only for the subclass CBotCase this allows to make the call on all instructions CompCase to see if it's a case to the desired value.. More...
 
void SetToken (CBotToken *p)
 SetToken Set the token corresponding to the instruction. More...
 
int GetTokenType ()
 GetTokenType Return the type of the token assicated with the instruction. More...
 
CBotTokenGetToken ()
 GetToken Return associated token. More...
 
void AddNext (CBotInstr *n)
 AddNext Adds the statement following the other. More...
 
CBotInstrGetNext ()
 GetNext Returns next statement. More...
 
void AddNext3 (CBotInstr *n)
 AddNext3. More...
 
CBotInstrGetNext3 ()
 GetNext3. More...
 
void AddNext3b (CBotInstr *n)
 AddNext3b. More...
 
CBotInstrGetNext3b ()
 GetNext3b. More...
 

Static Public Member Functions

static CBotInstrCompile (CBotToken *&p, CBotCStack *pStack, CBotVar::ProtectionLevel privat=CBotVar::ProtectionLevel::Protected)
 Compile. More...
 
static CBotInstrCompileMethode (CBotToken *&p, CBotCStack *pStack)
 CompileMethode. More...
 
- Static Public Member Functions inherited from CBot::CBotInstr
static CBotInstrCompile (CBotToken *&p, CBotCStack *pStack)
 Compile an instruction. More...
 
static CBotInstrCompileArray (CBotToken *&p, CBotCStack *pStack, CBotTypResult type, bool first=true)
 CompileArray. More...
 
static void IncLvl (std::string &label)
 IncLvl Adds a level with a label. More...
 
static void IncLvl ()
 IncLvl Adds a level (switch statement). More...
 
static void DecLvl ()
 DecLvl Free a level. More...
 
static bool ChkLvl (const std::string &label, int type)
 ChkLvl Control validity of break and continue. More...
 

Protected Member Functions

virtual const std::string GetDebugName () override
 Returns the name of this class. More...
 
virtual std::string GetDebugData () override
 Returns additional data associated with this instruction for debugging purposes. More...
 
- Protected Member Functions inherited from CBot::CBotInstr
virtual std::map< std::string, CBotInstr * > GetDebugLinks ()
 

Friends

class CBotPostIncExpr
 
class CBotPreIncExpr
 

Additional Inherited Members

- Protected Attributes inherited from CBot::CBotInstr
CBotToken m_token
 Keeps the token. More...
 
CBotInstrm_next
 Linked command. More...
 
CBotInstrm_next2b
 Second list definition chain. More...
 
CBotInstrm_next3
 Third list for indices and fields. More...
 
CBotInstrm_next3b
 Necessary for reporting tables. More...
 
- Static Protected Attributes inherited from CBot::CBotInstr
static int m_LoopLvl = 0
 Counter of nested loops, to determine the break and continue valid. More...
 

Detailed Description

Expression representing a variable name.

Verifies that variable is known during compilation Verifies taht variable is initialized during execution

Member Function Documentation

CBotInstr * CBot::CBotExprVar::Compile ( CBotToken *&  p,
CBotCStack pStack,
CBotVar::ProtectionLevel  privat = CBotVar::ProtectionLevel::Protected 
)
static

Compile.

Parameters
p
pStack
privat
Returns
CBotInstr * CBot::CBotExprVar::CompileMethode ( CBotToken *&  p,
CBotCStack pStack 
)
static

CompileMethode.

Parameters
p
pStack
Returns
bool CBot::CBotExprVar::Execute ( CBotStack *&  pj)
overridevirtual

Execute Execute, making the value of a variable.

Parameters
pj
Returns

Reimplemented from CBot::CBotInstr.

void CBot::CBotExprVar::RestoreState ( CBotStack *&  pj,
bool  bMain 
)
overridevirtual

RestoreState.

Parameters
pj
bMain

Reimplemented from CBot::CBotInstr.

bool CBot::CBotExprVar::ExecuteVar ( CBotVar *&  pVar,
CBotStack *&  pile,
CBotToken prevToken,
bool  bStep 
)

ExecuteVar Fetch a variable at runtime.

Parameters
pVar
pile
prevToken
bStep
Returns
void CBot::CBotExprVar::RestoreStateVar ( CBotStack *&  pj,
bool  bMain 
)
overridevirtual

RestoreStateVar Fetch variable at runtime.

Parameters
pj
bMain

Reimplemented from CBot::CBotInstr.

virtual const std::string CBot::CBotExprVar::GetDebugName ( )
inlineoverrideprotectedvirtual

Returns the name of this class.

See also
CBotDebug

Implements CBot::CBotInstr.

std::string CBot::CBotExprVar::GetDebugData ( )
overrideprotectedvirtual

Returns additional data associated with this instruction for debugging purposes.

See also
CBotDebug

Reimplemented from CBot::CBotInstr.


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