26 #include "CBotToken.h"
32 #define EOX (reinterpret_cast<CBotStack*>(-1))
117 void Reset(
void* pUser);
154 bool bModif =
false);
165 bool bModif =
false);
183 bool bModif =
false);
199 CBotStack* AddStack2(
bool bBlock =
false);
202 bool BreakReturn(
CBotStack* pfils,
const char* name = NULL);
204 bool IfContinue(
int state,
const char* name);
209 bool SetState(
int n,
int lim = -10);
211 bool IncState(
int lim = -10);
216 void SetCopyVar(
CBotVar* var );
220 bool GetRetVar(
bool bRet);
223 void SetStartError(
int pos);
224 void SetError(
int n,
CBotToken* token = NULL);
226 void ResetError(
int n,
int start,
int end);
227 void SetBreak(
int val,
const char* name);
238 bool SaveState(FILE* pf);
239 bool RestoreState(FILE* pf,
CBotStack* &pStack);
242 void SetTimer(
int n);
244 void GetRunPos(
const char* &FunctionName,
int &start,
int &end);
245 CBotVar* GetStackVars(
const char* &FunctionName,
int level);
291 inline bool CBotStack::IsOk()
293 return (m_error == 0);
296 inline int CBotStack::GetState()
339 int GetError(
int& start,
int& end);
344 int GetType(
int mode = 0);
358 void SetCopyVar(
CBotVar* var );
361 void SetStartError(
int pos);
362 void SetError(
int n,
int pos);
364 void ResetError(
int n,
int start,
int end);
379 extern bool SaveVar(FILE* pf,
CBotVar* pVar);
436 void RestoreState(
CBotStack* &pj,
bool bMain);
443 void RestoreStateVar(
CBotStack* &pile,
bool bMain);
466 bool ChkLvl(
const CBotString& label,
int type);
484 void RestoreState(
CBotStack* &pj,
bool bMain);
500 void RestoreState(
CBotStack* &pj,
bool bMain);
518 void RestoreState(
CBotStack* &pj,
bool bMain);
532 void RestoreState(
CBotStack* &pj,
bool bMain);
546 void RestoreState(
CBotStack* &pj,
bool bMain);
562 void RestoreState(
CBotStack* &pj,
bool bMain);
577 void RestoreState(
CBotStack* &pj,
bool bMain);
596 void RestoreState(
CBotStack* &pj,
bool bMain);
597 void RestoreCondState(
CBotStack* &pj,
bool bMain);
613 void RestoreState(
CBotStack* &pj,
bool bMain);
627 void RestoreState(
CBotStack* &pj,
bool bMain);
657 void RestoreState(
CBotStack* &pj,
bool bMain);
676 void RestoreState(
CBotStack* &pj,
bool bMain);
696 void RestoreState(
CBotStack* &pj,
bool bMain);
714 void RestoreState(
CBotStack* &pj,
bool bMain);
721 void RestoreState(
CBotStack* &pj,
bool bMain);
738 void RestoreState(
CBotStack* &pj,
bool bMain);
756 void RestoreState(
CBotStack* &pj,
bool bMain);
773 void RestoreState(
CBotStack* &pj,
bool bMain);
786 long m_nMethodeIdent;
794 void RestoreState(
CBotStack* &pj,
bool bMain);
825 void RestoreStateVar(
CBotStack* &pile,
bool bMain);
840 void SetUniqNum(
int num);
845 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
864 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
883 void RestoreState(
CBotStack* &pj,
bool bMain);
897 void RestoreState(
CBotStack* &pj,
bool bMain);
914 void RestoreState(
CBotStack* &pj,
bool bMain);
953 void RestoreState(
CBotStack* &pj,
bool bMain);
969 void RestoreState(
CBotStack* &pj,
bool bMain);
1001 void RestoreState(
CBotStack* &pj,
bool bMain);
1021 void RestoreState(
CBotStack* &pj,
bool bMain);
1036 long m_MethodeIdent;
1047 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
1068 void RestoreState(
CBotStack* &pj,
bool bMain);
1071 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
1086 void RestoreState(
CBotStack* &pj,
bool bMain);
1101 void RestoreState(
CBotStack* &pj,
bool bMain);
1119 void RestoreState(
CBotStack* &pj,
bool bMain);
1134 void RestoreState(
CBotStack* &pj,
bool bMain);
1147 void RestoreState(
CBotStack* &pj,
bool bMain);
1159 void RestoreState(
CBotStack* &pj,
bool bMain);
1166 long m_nMethodeIdent;
1177 void RestoreState(
CBotStack* &pj,
bool bMain);
1195 void RestoreState(
CBotStack* &pj,
bool bMain);
1212 void RestoreState(
CBotStack* &pj,
bool bMain);
1216 #define MAX(a,b) ((a>b) ? a : b)
1231 void SetValInt(
int val,
const char* s = NULL);
1232 void SetValFloat(
float val);
1234 float GetValFloat();
1237 void Copy(
CBotVar* pSrc,
bool bName=
true);
1267 bool Save0State(FILE* pf);
1268 bool Save1State(FILE* pf);
1282 void SetValInt(
int val,
const char* s = NULL);
1283 void SetValFloat(
float val);
1285 float GetValFloat();
1288 void Copy(
CBotVar* pSrc,
bool bName=
true);
1309 bool Save1State(FILE* pf);
1323 void SetValString(
const char* p);
1326 void Copy(
CBotVar* pSrc,
bool bName=
true);
1337 bool Save1State(FILE* pf);
1350 void SetValInt(
int val,
const char* s = NULL);
1351 void SetValFloat(
float val);
1353 float GetValFloat();
1356 void Copy(
CBotVar* pSrc,
bool bName=
true);
1365 bool Save1State(FILE* pf);
1386 bool m_bConstructor;
1394 void Copy(
CBotVar* pSrc,
bool bName=
true);
1397 CBotVar* GetItem(
const char* name);
1398 CBotVar* GetItemRef(
int nIdent);
1400 CBotVar* GetItem(
int n,
bool bExtend);
1405 bool Save1State(FILE* pf);
1406 void Maj(
void* pUser,
bool bContinue);
1408 void IncrementUse();
1409 void DecrementUse();
1413 void SetItemList(
CBotVar* pVar);
1415 void SetIdent(
long n);
1425 void ConstructorSet();
1442 void Copy(
CBotVar* pSrc,
bool bName=
true);
1445 CBotVar* GetItem(
const char* name);
1446 CBotVar* GetItemRef(
int nIdent);
1454 void SetIdent(
long n);
1456 void ConstructorSet();
1458 bool Save1State(FILE* pf);
1459 void Maj(
void* pUser,
bool bContinue);
1468 #define MAXARRAYSIZE 9999
1486 void Copy(
CBotVar* pSrc,
bool bName=
true);
1487 CBotVar* GetItem(
int n,
bool bGrow=
false);
1494 bool Save1State(FILE* pf);
1503 extern bool WriteWord(FILE* pf,
unsigned short w);
1504 extern bool ReadWord(FILE* pf,
unsigned short& w);
1505 extern bool ReadLong(FILE* pf,
long& w);
1506 extern bool WriteFloat(FILE* pf,
float w);
1507 extern bool WriteLong(FILE* pf,
long w);
1508 extern bool ReadFloat(FILE* pf,
float& w);
1509 extern bool WriteString(FILE* pf,
CBotString s);
1510 extern bool ReadString(FILE* pf,
CBotString& s);
1514 extern float GetNumFloat(
const char* p );
1517 extern void DEBUG(
const char* text,
int val,
CBotStack* pile );
1534 bool (*m_rExec) (
CBotVar* pVar,
CBotVar* pResult,
int& Exception,
void* pUser) ;
1536 (*m_rComp) (
CBotVar* &pVar,
void* pUser) ;
1541 bool rExec (
CBotVar* pVar,
CBotVar* pResult,
int& Exception,
void* pUser),
1546 bool AddFunction(
const char* name,
1547 bool rExec (
CBotVar* pVar,
CBotVar* pResult,
int& Exception,
void* pUser),
1554 bool CheckCall(
const char* name);
1569 static void SetPUser(
void* pUser);
1593 CompileCall(
const char* name,
CBotVar* pThis,
1622 void RestoreState(
CBotStack* &pj,
bool bMain);
1682 void RestoreCall(
long& nIdent,
const char* name,
CBotVar** ppVars,
CBotStack* pStack);
1696 bool GetPosition(
int& start,
int& stop, CBotGet modestart, CBotGet modestop);
Definition: CBotDll.h:895
CBotStack(CBotStack *ppapa)
CBotStack Constructor of the stack.
Definition: CBotStack.cpp:242
CBotVar * FindVar(CBotToken *&pToken, bool bUpdate=false, bool bModif=false)
Fetch a variable by its token.
Definition: CBotStack.cpp:473
int GetError()
GetError Get error number.
Definition: CBot.h:301
Library for interpretation of CBOT language.
Definition: CBotDll.h:361
int GetType(int mode=0)
GetType Get the type of value on the stack.
Definition: CBotStack.cpp:454
void Reset(void *pUser)
Reset Reset error at and set user.
Definition: CBotStack.cpp:352
CBotString Class used to work on strings.
Definition: CBotDll.h:255
Management of the execution stack.
Definition: CBot.h:69
CBotVar * CopyVar(CBotToken &Token, bool bUpdate=false)
Find variable by its token and returns a copy of it.
Definition: CBotStack.cpp:546
CBotTypResult GetTypResult(int mode=0)
Getes the type of complete value on the stack.
Definition: CBotStack.cpp:460
bool StackOver()
StackOver Check if end of stack is reached.
Definition: CBotStack.cpp:345
CBotTypResult class to define the complete type of a result.
Definition: CBotDll.h:86
static CBotInstr * Compile(CBotToken *&p, CBotCStack *pStack, CBotClass *pClass=NULL)
Definition: CBotClass.cpp:473
Definition: CBotDll.h:330
Definition: CBotDll.h:558
void SetType(CBotTypResult &type)
SetType Determines the type.
Definition: CBotStack.cpp:466
Definition: CBotDll.h:771
void AddVar(CBotVar *p)
Adds a local variable.
Definition: CBotStack.cpp:681
CBotInt()
CBotInstr* m_next; // several definitions chained.
Definition: CBot.cpp:913
~CBotStack()
~CBotStack Destructor
Definition: CBotStack.cpp:266