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

Compile a comma-separated list of expressions or variable definitions. More...

#include <src/CBot/CBotInstr/CBotListExpression.h>

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

Public Member Functions

bool Execute (CBotStack *&pStack) override
 Execute. More...
 
void RestoreState (CBotStack *&pj, bool bMain) override
 RestoreState. 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 void RestoreStateVar (CBotStack *&pile, bool bMain)
 RestoreStateVar. 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...
 
CBotToken * GetToken ()
 GetToken Return associated token. More...
 
void AddNext (CBotInstr *n)
 AddNext Adds the statement following the other. More...
 
CBotInstr * GetNext ()
 GetNext Returns next statement. More...
 
void AddNext3 (CBotInstr *n)
 AddNext3. More...
 
CBotInstr * GetNext3 ()
 GetNext3. More...
 
void AddNext3b (CBotInstr *n)
 AddNext3b. More...
 
CBotInstr * GetNext3b ()
 GetNext3b. More...
 
virtual bool HasReturn ()
 Check a list of instructions for a return statement. More...
 

Static Public Member Functions

static CBotInstr * Compile (CBotToken *&p, CBotCStack *pStack)
 Compile. More...
 
- Static Public Member Functions inherited from CBot::CBotInstr
static CBotInstr * Compile (CBotToken *&p, CBotCStack *pStack)
 Compile an instruction. More...
 
static CBotInstr * CompileArray (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::map< std::string, CBotInstr * > GetDebugLinks () override
 
- Protected Member Functions inherited from CBot::CBotInstr
virtual std::string GetDebugData ()
 Returns additional data associated with this instruction for debugging purposes. More...
 

Additional Inherited Members

- Protected Attributes inherited from CBot::CBotInstr
CBotToken m_token
 Keeps the token. More...
 
CBotInstr * m_next
 Linked command. More...
 
CBotInstr * m_next2b
 Second list definition chain. More...
 
CBotInstr * m_next3
 Third list for indices and fields. More...
 
CBotInstr * m_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

Compile a comma-separated list of expressions or variable definitions.

Used by for() in initialization and increment statements

Examples:

int a
a = 0
a = 0, int b = 3
a = 5, b = 7
int a = 3, b = 8 // This declares b as new variable, not assigns to it!
i++
i++, j++
int a = 5, j++
See also
CBotFor

Member Function Documentation

◆ Compile()

CBotInstr * CBot::CBotListExpression::Compile ( CBotToken *&  p,
CBotCStack *  pStack 
)
static

Compile.

Parameters
p
pStack
Returns

◆ Execute()

bool CBot::CBotListExpression::Execute ( CBotStack *&  pStack)
overridevirtual

Execute.

Parameters
pStack
Returns

Reimplemented from CBot::CBotInstr.

◆ RestoreState()

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

RestoreState.

Parameters
pj
bMain

Reimplemented from CBot::CBotInstr.

◆ GetDebugName()

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

Returns the name of this class.

See also
CBotDebug

Implements CBot::CBotInstr.

◆ GetDebugLinks()

std::map< std::string, CBotInstr * > CBot::CBotListExpression::GetDebugLinks ( )
overrideprotectedvirtual

Returns a map of all instructions connected with this one

See also
CBotDebug

Reimplemented from CBot::CBotInstr.


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