Colobot
Public Member Functions | List of all members
CBot::CBotCStack Class Reference

The CBotCStack class Management of the stack of compilation. More...

#include <CBotCStack.h>

Public Member Functions

 CBotCStack (CBotCStack *ppapa)
 CBotCStack. More...
 
 ~CBotCStack ()
 CBotCStack Destructor. More...
 
bool IsOk ()
 IsOk. More...
 
CBotError GetError ()
 GetError. More...
 
CBotError GetError (int &start, int &end)
 GetError Gives error number. More...
 
void SetType (CBotTypResult &type)
 SetType Set the type of instruction on the stack. More...
 
CBotTypResult GetTypResult (CBotVar::GetTypeMode mode=CBotVar::GetTypeMode::NORMAL)
 GetTypResult Gives the type of value on the stack. Type of instruction on the stack. More...
 
int GetType (CBotVar::GetTypeMode mode=CBotVar::GetTypeMode::NORMAL)
 GetType Gives the type of value on the stack. More...
 
CBotClassGetClass ()
 GetClass Gives the class of the value on the stack. More...
 
void AddVar (CBotVar *p)
 AddVar Adds a local variable. More...
 
CBotVarFindVar (CBotToken *&p)
 FindVar Finds a variable. Seeks a variable on the stack the token may be a result of TokenTypVar (object of a class) or a pointer in the source. More...
 
CBotVarFindVar (CBotToken &Token)
 FindVar. More...
 
bool CheckVarLocal (CBotToken *&pToken)
 CheckVarLocal Test whether a variable is already defined locally. More...
 
CBotVarCopyVar (CBotToken &Token)
 CopyVar Finds and makes a copy. More...
 
CBotCStackTokenStack (CBotToken *pToken=nullptr, bool bBlock=false)
 TokenStack Used only at compile. More...
 
CBotInstrReturn (CBotInstr *p, CBotCStack *pParent)
 Return Transmits the result upper. More...
 
CBotFunctionReturnFunc (CBotFunction *p, CBotCStack *pParent)
 ReturnFunc Transmits the result upper. More...
 
void SetVar (CBotVar *var)
 SetVar. More...
 
void SetCopyVar (CBotVar *var)
 SetCopyVar Puts on the stack a copy of a variable. More...
 
CBotVarGetVar ()
 GetVar. More...
 
void SetStartError (int pos)
 SetStartError. More...
 
void SetError (CBotError n, int pos)
 SetError. More...
 
void SetError (CBotError n, CBotToken *p)
 SetError. More...
 
void ResetError (CBotError n, int start, int end)
 ResetError. More...
 
void SetRetType (CBotTypResult &type)
 SetRetType. More...
 
CBotTypResult GetRetType ()
 GetRetType. More...
 
void SetProgram (CBotProgram *p)
 SetProgram. More...
 
CBotProgramGetProgram ()
 GetProgram. More...
 
CBotTypResult CompileCall (CBotToken *&p, CBotVar **ppVars, long &nIdent)
 CompileCall. More...
 
bool CheckCall (CBotToken *&pToken, CBotDefParam *pParam)
 CheckCall Test if a procedure name is already defined somewhere. More...
 
bool NextToken (CBotToken *&p)
 NextToken. More...
 

Detailed Description

The CBotCStack class Management of the stack of compilation.

Constructor & Destructor Documentation

CBot::CBotCStack::CBotCStack ( CBotCStack ppapa)

CBotCStack.

Parameters
ppapa
CBot::CBotCStack::~CBotCStack ( )

CBotCStack Destructor.

Member Function Documentation

bool CBot::CBotCStack::IsOk ( )

IsOk.

Returns
CBotError CBot::CBotCStack::GetError ( )

GetError.

Returns
CBotError CBot::CBotCStack::GetError ( int &  start,
int &  end 
)

GetError Gives error number.

Parameters
start
end
Returns
void CBot::CBotCStack::SetType ( CBotTypResult type)

SetType Set the type of instruction on the stack.

Parameters
type
CBotTypResult CBot::CBotCStack::GetTypResult ( CBotVar::GetTypeMode  mode = CBotVar::GetTypeMode::NORMAL)

GetTypResult Gives the type of value on the stack. Type of instruction on the stack.

Parameters
mode
Returns
int CBot::CBotCStack::GetType ( CBotVar::GetTypeMode  mode = CBotVar::GetTypeMode::NORMAL)

GetType Gives the type of value on the stack.

Parameters
mode
Returns
CBotClass * CBot::CBotCStack::GetClass ( )

GetClass Gives the class of the value on the stack.

Returns
void CBot::CBotCStack::AddVar ( CBotVar p)

AddVar Adds a local variable.

Parameters
p
CBotVar * CBot::CBotCStack::FindVar ( CBotToken *&  p)

FindVar Finds a variable. Seeks a variable on the stack the token may be a result of TokenTypVar (object of a class) or a pointer in the source.

Parameters
p
Returns
CBotVar * CBot::CBotCStack::FindVar ( CBotToken Token)

FindVar.

Parameters
Token
Returns
bool CBot::CBotCStack::CheckVarLocal ( CBotToken *&  pToken)

CheckVarLocal Test whether a variable is already defined locally.

Parameters
pToken
Returns
CBotVar * CBot::CBotCStack::CopyVar ( CBotToken Token)

CopyVar Finds and makes a copy.

Parameters
Token
Returns
CBotCStack * CBot::CBotCStack::TokenStack ( CBotToken pToken = nullptr,
bool  bBlock = false 
)

TokenStack Used only at compile.

Parameters
pToken
bBlock
Returns
CBotInstr * CBot::CBotCStack::Return ( CBotInstr p,
CBotCStack pParent 
)

Return Transmits the result upper.

Parameters
p
pParent
Returns
CBotFunction * CBot::CBotCStack::ReturnFunc ( CBotFunction p,
CBotCStack pParent 
)

ReturnFunc Transmits the result upper.

Parameters
p
pParent
Returns
void CBot::CBotCStack::SetVar ( CBotVar var)

SetVar.

Parameters
var
void CBot::CBotCStack::SetCopyVar ( CBotVar var)

SetCopyVar Puts on the stack a copy of a variable.

Parameters
var
CBotVar * CBot::CBotCStack::GetVar ( )

GetVar.

Returns
void CBot::CBotCStack::SetStartError ( int  pos)

SetStartError.

Parameters
pos
void CBot::CBotCStack::SetError ( CBotError  n,
int  pos 
)

SetError.

Parameters
n
pos
void CBot::CBotCStack::SetError ( CBotError  n,
CBotToken p 
)

SetError.

Parameters
n
p
void CBot::CBotCStack::ResetError ( CBotError  n,
int  start,
int  end 
)

ResetError.

Parameters
n
start
end
void CBot::CBotCStack::SetRetType ( CBotTypResult type)

SetRetType.

Parameters
type
CBotTypResult CBot::CBotCStack::GetRetType ( )

GetRetType.

Returns
void CBot::CBotCStack::SetProgram ( CBotProgram p)

SetProgram.

Parameters
p
CBotProgram * CBot::CBotCStack::GetProgram ( )

GetProgram.

Returns
CBotTypResult CBot::CBotCStack::CompileCall ( CBotToken *&  p,
CBotVar **  ppVars,
long &  nIdent 
)

CompileCall.

Parameters
p
ppVars
nIdent
Returns
bool CBot::CBotCStack::CheckCall ( CBotToken *&  pToken,
CBotDefParam pParam 
)

CheckCall Test if a procedure name is already defined somewhere.

Parameters
pToken
pParam
Returns
bool CBot::CBotCStack::NextToken ( CBotToken *&  p)

NextToken.

Parameters
p
Returns

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