|
Colobot
|
The CBotCStack class Management of the stack of compilation. More...
#include <src/CBot/CBotCStack.h>
Classes | |
| struct | Data |
Public Member Functions | |
| CBotCStack (CBotCStack *ppapa) | |
| CBotCStack. | |
| ~CBotCStack () | |
| CBotCStack Destructor. | |
| bool | IsOk () |
| IsOk. | |
| CBotError | GetError () |
| GetError. | |
| CBotError | GetError (int &start, int &end) |
| GetError Gives error number. | |
| void | SetType (CBotTypResult &type) |
| SetType Set the type of instruction on the stack. | |
| CBotTypResult | GetTypResult (CBotVar::GetTypeMode mode=CBotVar::GetTypeMode::NORMAL) |
| GetTypResult Gives the type of value on the stack. Type of instruction on the stack. | |
| int | GetType (CBotVar::GetTypeMode mode=CBotVar::GetTypeMode::NORMAL) |
| GetType Gives the type of value on the stack. | |
| CBotClass * | GetClass () |
| GetClass Gives the class of the value on the stack. | |
| void | AddVar (CBotVar *p) |
| AddVar Adds a local variable. | |
| void | CreateVarThis (CBotClass *pClass) |
| Create 'this' as a local variable. | |
| void | CreateVarSuper (CBotClass *pClass) |
| Create 'super' as a local variable. | |
| void | CreateMemberVars (CBotClass *pClass, bool setDefined) |
| Create member variables of the current class as local variables. | |
| CBotVar * | 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. | |
| CBotVar * | FindVar (CBotToken &Token) |
| FindVar. | |
| bool | CheckVarLocal (CBotToken *&pToken) |
| CheckVarLocal Test whether a variable is already defined locally. | |
| CBotVar * | CopyVar (CBotToken &Token) |
| CopyVar Finds and makes a copy. | |
| CBotCStack * | TokenStack (CBotToken *pToken=nullptr, bool bBlock=false) |
| TokenStack Used only at compile. | |
| void | DeleteNext () |
| Deletes all subsequent stack frames created by TokenStack. | |
| CBotInstr * | Return (CBotInstr *p, CBotCStack *pParent) |
| Return Transmits the result upper. | |
| CBotFunction * | ReturnFunc (CBotFunction *p, CBotCStack *pParent) |
| ReturnFunc Transmits the result upper. | |
| void | SetVar (CBotVar *var) |
| SetVar. | |
| void | SetCopyVar (CBotVar *var) |
| SetCopyVar Puts on the stack a copy of a variable. | |
| CBotVar * | GetVar () |
| GetVar. | |
| void | SetStartError (int pos) |
| SetStartError. | |
| void | SetError (CBotError n, int pos) |
| SetError. | |
| void | SetError (CBotError n, CBotToken *p) |
| SetError. | |
| void | ResetError (CBotError n, int start, int end) |
| ResetError. | |
| void | SetRetType (CBotTypResult &type) |
| SetRetType. | |
| CBotTypResult | GetRetType () |
| GetRetType. | |
| void | SetProgram (CBotProgram *p) |
| SetProgram. | |
| CBotProgram * | GetProgram () |
| GetProgram. | |
| CBotTypResult | CompileCall (CBotToken *&p, CBotVar **ppVars, long &nIdent) |
| CompileCall. | |
| bool | CheckCall (CBotToken *&pToken, CBotDefParam *pParam, const std::string &className) |
| CheckCall Test if a procedure name is already defined somewhere. | |
| bool | NextToken (CBotToken *&p) |
| NextToken. | |
The CBotCStack class Management of the stack of compilation.
| CBot::CBotCStack::CBotCStack | ( | CBotCStack * | ppapa | ) |
| ppapa |
| CBot::CBotCStack::~CBotCStack | ( | ) |
CBotCStack Destructor.
| bool CBot::CBotCStack::IsOk | ( | ) |
IsOk.
| CBotError CBot::CBotCStack::GetError | ( | ) |
GetError.
| CBotError CBot::CBotCStack::GetError | ( | int & | start, |
| int & | end | ||
| ) |
GetError Gives error number.
| start | |
| end |
| void CBot::CBotCStack::SetType | ( | CBotTypResult & | type | ) |
SetType Set the type of instruction on the stack.
| 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.
| mode |
| int CBot::CBotCStack::GetType | ( | CBotVar::GetTypeMode | mode = CBotVar::GetTypeMode::NORMAL | ) |
GetType Gives the type of value on the stack.
| mode |
| CBotClass * CBot::CBotCStack::GetClass | ( | ) |
GetClass Gives the class of the value on the stack.
| void CBot::CBotCStack::AddVar | ( | CBotVar * | p | ) |
AddVar Adds a local variable.
| p |
| void CBot::CBotCStack::CreateVarThis | ( | CBotClass * | pClass | ) |
Create 'this' as a local variable.
| pClass | The current class referred to by 'this' |
| void CBot::CBotCStack::CreateVarSuper | ( | CBotClass * | pClass | ) |
Create 'super' as a local variable.
| pClass | The parent class referred to by 'super' |
| void CBot::CBotCStack::CreateMemberVars | ( | CBotClass * | pClass, |
| bool | setDefined | ||
| ) |
Create member variables of the current class as local variables.
| pClass | The current class. |
| setDefined | Whether to mark the variables as initialized. |
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.
| p |
| bool CBot::CBotCStack::CheckVarLocal | ( | CBotToken *& | pToken | ) |
CheckVarLocal Test whether a variable is already defined locally.
| pToken |
CopyVar Finds and makes a copy.
| Token |
| CBotCStack * CBot::CBotCStack::TokenStack | ( | CBotToken * | pToken = nullptr, |
| bool | bBlock = false |
||
| ) |
TokenStack Used only at compile.
| pToken | |
| bBlock |
| void CBot::CBotCStack::DeleteNext | ( | ) |
Deletes all subsequent stack frames created by TokenStack.
| CBotInstr * CBot::CBotCStack::Return | ( | CBotInstr * | p, |
| CBotCStack * | pParent | ||
| ) |
Return Transmits the result upper.
| p | |
| pParent |
| CBotFunction * CBot::CBotCStack::ReturnFunc | ( | CBotFunction * | p, |
| CBotCStack * | pParent | ||
| ) |
ReturnFunc Transmits the result upper.
| p | |
| pParent |
| void CBot::CBotCStack::SetVar | ( | CBotVar * | var | ) |
SetVar.
| var |
| void CBot::CBotCStack::SetCopyVar | ( | CBotVar * | var | ) |
SetCopyVar Puts on the stack a copy of a variable.
| var |
| CBotVar * CBot::CBotCStack::GetVar | ( | ) |
GetVar.
| void CBot::CBotCStack::SetStartError | ( | int | pos | ) |
SetStartError.
| pos |
| void CBot::CBotCStack::SetError | ( | CBotError | n, |
| int | pos | ||
| ) |
SetError.
| n | |
| pos |
| void CBot::CBotCStack::ResetError | ( | CBotError | n, |
| int | start, | ||
| int | end | ||
| ) |
ResetError.
| n | |
| start | |
| end |
| void CBot::CBotCStack::SetRetType | ( | CBotTypResult & | type | ) |
SetRetType.
| type |
| CBotTypResult CBot::CBotCStack::GetRetType | ( | ) |
GetRetType.
| void CBot::CBotCStack::SetProgram | ( | CBotProgram * | p | ) |
SetProgram.
| p |
| CBotProgram * CBot::CBotCStack::GetProgram | ( | ) |
GetProgram.
| CBotTypResult CBot::CBotCStack::CompileCall | ( | CBotToken *& | p, |
| CBotVar ** | ppVars, | ||
| long & | nIdent | ||
| ) |
CompileCall.
| p | |
| ppVars | |
| nIdent |
| bool CBot::CBotCStack::CheckCall | ( | CBotToken *& | pToken, |
| CBotDefParam * | pParam, | ||
| const std::string & | className | ||
| ) |
CheckCall Test if a procedure name is already defined somewhere.
| pToken | Token representing the name of a function. |
| pParam | List of parameters. |
| className | Name of a class when checking for methods. |
| bool CBot::CBotCStack::NextToken | ( | CBotToken *& | p | ) |
NextToken.
| p |