29 #include "CBotToken.h"
35 #define EOX (reinterpret_cast<CBotStack*>(-1))
120 void Reset(
void* pUser);
157 bool bModif =
false);
168 bool bModif =
false);
186 bool bModif =
false);
202 CBotStack* AddStack2(
bool bBlock =
false);
205 bool BreakReturn(
CBotStack* pfils,
const char* name = NULL);
207 bool IfContinue(
int state,
const char* name);
212 bool SetState(
int n,
int lim = -10);
214 bool IncState(
int lim = -10);
219 void SetCopyVar(
CBotVar* var );
223 bool GetRetVar(
bool bRet);
226 void SetStartError(
int pos);
227 void SetError(
int n,
CBotToken* token = NULL);
229 void ResetError(
int n,
int start,
int end);
230 void SetBreak(
int val,
const char* name);
241 bool SaveState(FILE* pf);
242 bool RestoreState(FILE* pf,
CBotStack* &pStack);
245 void SetTimer(
int n);
247 void GetRunPos(
const char* &FunctionName,
int &start,
int &end);
248 CBotVar* GetStackVars(
const char* &FunctionName,
int level);
294 inline bool CBotStack::IsOk()
296 return (m_error == 0);
299 inline int CBotStack::GetState()
342 int GetError(
int& start,
int& end);
347 int GetType(
int mode = 0);
361 void SetCopyVar(
CBotVar* var );
364 void SetStartError(
int pos);
365 void SetError(
int n,
int pos);
367 void ResetError(
int n,
int start,
int end);
382 extern bool SaveVar(FILE* pf,
CBotVar* pVar);
439 void RestoreState(
CBotStack* &pj,
bool bMain);
446 void RestoreStateVar(
CBotStack* &pile,
bool bMain);
469 bool ChkLvl(
const CBotString& label,
int type);
487 void RestoreState(
CBotStack* &pj,
bool bMain);
503 void RestoreState(
CBotStack* &pj,
bool bMain);
521 void RestoreState(
CBotStack* &pj,
bool bMain);
535 void RestoreState(
CBotStack* &pj,
bool bMain);
549 void RestoreState(
CBotStack* &pj,
bool bMain);
565 void RestoreState(
CBotStack* &pj,
bool bMain);
580 void RestoreState(
CBotStack* &pj,
bool bMain);
599 void RestoreState(
CBotStack* &pj,
bool bMain);
600 void RestoreCondState(
CBotStack* &pj,
bool bMain);
616 void RestoreState(
CBotStack* &pj,
bool bMain);
630 void RestoreState(
CBotStack* &pj,
bool bMain);
660 void RestoreState(
CBotStack* &pj,
bool bMain);
679 void RestoreState(
CBotStack* &pj,
bool bMain);
699 void RestoreState(
CBotStack* &pj,
bool bMain);
717 void RestoreState(
CBotStack* &pj,
bool bMain);
724 void RestoreState(
CBotStack* &pj,
bool bMain);
741 void RestoreState(
CBotStack* &pj,
bool bMain);
759 void RestoreState(
CBotStack* &pj,
bool bMain);
776 void RestoreState(
CBotStack* &pj,
bool bMain);
789 long m_nMethodeIdent;
797 void RestoreState(
CBotStack* &pj,
bool bMain);
828 void RestoreStateVar(
CBotStack* &pile,
bool bMain);
843 void SetUniqNum(
int num);
848 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
867 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
886 void RestoreState(
CBotStack* &pj,
bool bMain);
900 void RestoreState(
CBotStack* &pj,
bool bMain);
917 void RestoreState(
CBotStack* &pj,
bool bMain);
956 void RestoreState(
CBotStack* &pj,
bool bMain);
972 void RestoreState(
CBotStack* &pj,
bool bMain);
1004 void RestoreState(
CBotStack* &pj,
bool bMain);
1024 void RestoreState(
CBotStack* &pj,
bool bMain);
1039 long m_MethodeIdent;
1050 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
1071 void RestoreState(
CBotStack* &pj,
bool bMain);
1074 void RestoreStateVar(
CBotStack* &pj,
bool bMain);
1089 void RestoreState(
CBotStack* &pj,
bool bMain);
1104 void RestoreState(
CBotStack* &pj,
bool bMain);
1122 void RestoreState(
CBotStack* &pj,
bool bMain);
1137 void RestoreState(
CBotStack* &pj,
bool bMain);
1150 void RestoreState(
CBotStack* &pj,
bool bMain);
1162 void RestoreState(
CBotStack* &pj,
bool bMain);
1169 long m_nMethodeIdent;
1180 void RestoreState(
CBotStack* &pj,
bool bMain);
1198 void RestoreState(
CBotStack* &pj,
bool bMain);
1215 void RestoreState(
CBotStack* &pj,
bool bMain);
1219 #define MAX(a,b) ((a>b) ? a : b)
1234 void SetValInt(
int val,
const char* s = NULL);
1235 void SetValFloat(
float val);
1237 float GetValFloat();
1240 void Copy(
CBotVar* pSrc,
bool bName=
true);
1270 bool Save0State(FILE* pf);
1271 bool Save1State(FILE* pf);
1285 void SetValInt(
int val,
const char* s = NULL);
1286 void SetValFloat(
float val);
1288 float GetValFloat();
1291 void Copy(
CBotVar* pSrc,
bool bName=
true);
1312 bool Save1State(FILE* pf);
1326 void SetValString(
const char* p);
1329 void Copy(
CBotVar* pSrc,
bool bName=
true);
1340 bool Save1State(FILE* pf);
1353 void SetValInt(
int val,
const char* s = NULL);
1354 void SetValFloat(
float val);
1356 float GetValFloat();
1359 void Copy(
CBotVar* pSrc,
bool bName=
true);
1368 bool Save1State(FILE* pf);
1389 bool m_bConstructor;
1397 void Copy(
CBotVar* pSrc,
bool bName=
true);
1400 CBotVar* GetItem(
const char* name);
1401 CBotVar* GetItemRef(
int nIdent);
1403 CBotVar* GetItem(
int n,
bool bExtend);
1408 bool Save1State(FILE* pf);
1409 void Maj(
void* pUser,
bool bContinue);
1411 void IncrementUse();
1412 void DecrementUse();
1416 void SetItemList(
CBotVar* pVar);
1418 void SetIdent(
long n);
1428 void ConstructorSet();
1445 void Copy(
CBotVar* pSrc,
bool bName=
true);
1448 CBotVar* GetItem(
const char* name);
1449 CBotVar* GetItemRef(
int nIdent);
1457 void SetIdent(
long n);
1459 void ConstructorSet();
1461 bool Save1State(FILE* pf);
1462 void Maj(
void* pUser,
bool bContinue);
1471 #define MAXARRAYSIZE 9999
1489 void Copy(
CBotVar* pSrc,
bool bName=
true);
1490 CBotVar* GetItem(
int n,
bool bGrow=
false);
1497 bool Save1State(FILE* pf);
1506 extern bool WriteWord(FILE* pf,
unsigned short w);
1507 extern bool ReadWord(FILE* pf,
unsigned short& w);
1508 extern bool ReadLong(FILE* pf,
long& w);
1509 extern bool WriteFloat(FILE* pf,
float w);
1510 extern bool WriteLong(FILE* pf,
long w);
1511 extern bool ReadFloat(FILE* pf,
float& w);
1512 extern bool WriteString(FILE* pf,
CBotString s);
1513 extern bool ReadString(FILE* pf,
CBotString& s);
1517 extern float GetNumFloat(
const char* p );
1520 extern void DEBUG(
const char* text,
int val,
CBotStack* pile );
1537 bool (*m_rExec) (
CBotVar* pVar,
CBotVar* pResult,
int& Exception,
void* pUser) ;
1539 (*m_rComp) (
CBotVar* &pVar,
void* pUser) ;
1544 bool rExec (
CBotVar* pVar,
CBotVar* pResult,
int& Exception,
void* pUser),
1549 bool AddFunction(
const char* name,
1550 bool rExec (
CBotVar* pVar,
CBotVar* pResult,
int& Exception,
void* pUser),
1557 bool CheckCall(
const char* name);
1572 static void SetPUser(
void* pUser);
1596 CompileCall(
const char* name,
CBotVar* pThis,
1625 void RestoreState(
CBotStack* &pj,
bool bMain);
1685 void RestoreCall(
long& nIdent,
const char* name,
CBotVar** ppVars,
CBotStack* pStack);
1699 bool GetPosition(
int& start,
int& stop, CBotGet modestart, CBotGet modestop);
Definition: CBotDll.h:898
CBotStack(CBotStack *ppapa)
CBotStack Constructor of the stack.
Definition: CBotStack.cpp:85
CBotVar * FindVar(CBotToken *&pToken, bool bUpdate=false, bool bModif=false)
Fetch a variable by its token.
Definition: CBotStack.cpp:476
void Delete()
Delete Remove current stack.
Definition: CBotStack.cpp:96
int GetError()
GetError Get error number.
Definition: CBot.h:304
Library for interpretation of CBOT language.
Definition: CBotDll.h:364
int GetType(int mode=0)
GetType Get the type of value on the stack.
Definition: CBotStack.cpp:457
static CBotStack * FirstStack()
FirstStack Allocate first stack.
Definition: CBotStack.cpp:47
void Reset(void *pUser)
Reset Reset error at and set user.
Definition: CBotStack.cpp:355
CBotString Class used to work on strings.
Definition: CBotDll.h:258
Management of the execution stack.
Definition: CBot.h:72
CBotVar * CopyVar(CBotToken &Token, bool bUpdate=false)
Find variable by its token and returns a copy of it.
Definition: CBotStack.cpp:549
CBotTypResult GetTypResult(int mode=0)
Getes the type of complete value on the stack.
Definition: CBotStack.cpp:463
bool StackOver()
StackOver Check if end of stack is reached.
Definition: CBotStack.cpp:236
CBotTypResult class to define the complete type of a result.
Definition: CBotDll.h:89
static CBotInstr * Compile(CBotToken *&p, CBotCStack *pStack, CBotClass *pClass=NULL)
Definition: CBotClass.cpp:476
Definition: CBotDll.h:333
Definition: CBotDll.h:561
void SetType(CBotTypResult &type)
SetType Determines the type.
Definition: CBotStack.cpp:469
Definition: CBotDll.h:774
void AddVar(CBotVar *p)
Adds a local variable.
Definition: CBotStack.cpp:684
CBotInt()
CBotInstr* m_next; // several definitions chained.
Definition: CBot.cpp:916
~CBotStack()
~CBotStack Destructor
Definition: CBotStack.cpp:91