Dependency on WINAPI completely removed.
parent
dbd62c96aa
commit
1910219518
|
@ -12,9 +12,10 @@ find_package(SDL_image REQUIRED)
|
|||
# Build with debugging symbols
|
||||
set(CMAKE_BUILD_TYPE debug)
|
||||
|
||||
|
||||
# Global compile flags
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-w -g -O0 -Wall")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -std=gnu++0x")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-w -g -O0 -Wall -std=gnu++0x")
|
||||
|
||||
# Subdirectory with sources
|
||||
add_subdirectory(src bin)
|
||||
|
|
|
@ -13,29 +13,25 @@
|
|||
// *
|
||||
// * You should have received a copy of the GNU General Public License
|
||||
// * along with this program. If not, see http://www.gnu.org/licenses/.///////////////////////////////////////////////////////////////////////
|
||||
// Compilation of various instructions
|
||||
// Compile all routines are static
|
||||
// And return an object according to what was found as instruction
|
||||
|
||||
// Compiler principle:
|
||||
// compilation of various instructions
|
||||
// compile all routines are static
|
||||
// and return an object according to what was found as instruction
|
||||
|
||||
// compiler principle:
|
||||
// compile the routines return an object of the class corresponding to the operation found
|
||||
// This is always a subclass of CBotInstr.
|
||||
// this is always a subclass of CBotInstr.
|
||||
// (CBotInstr objects are never used directly)
|
||||
|
||||
|
||||
// Compiles if the routine returns NULL is that the statement is false
|
||||
// Or misunderstood.
|
||||
// The error is then on the stack CBotCStack :: Isok () is false
|
||||
// compiles if the routine returns NULL is that the statement is false
|
||||
// or misunderstood.
|
||||
// the error is then on the stack CBotCStack :: Isok () is false
|
||||
|
||||
|
||||
|
||||
#include "CBot.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// les divers constructeurs / destructeurs
|
||||
// pour libérer tout selon l'arbre établi
|
||||
CBotInstr::CBotInstr()
|
||||
{
|
||||
name = "CBotInstr";
|
||||
|
@ -53,15 +49,15 @@ CBotInstr::~CBotInstr()
|
|||
delete m_next3b;
|
||||
}
|
||||
|
||||
// compteur de boucles imbriquées,
|
||||
// pour détermniner les break et continue valides
|
||||
// et liste des labels utilisables
|
||||
// counter of nested loops,
|
||||
// to determine the break and continue valid
|
||||
// list of labels used
|
||||
|
||||
|
||||
int CBotInstr::m_LoopLvl = 0;
|
||||
CBotStringArray
|
||||
CBotInstr::m_labelLvl = CBotStringArray();
|
||||
CBotStringArray CBotInstr::m_labelLvl = CBotStringArray();
|
||||
|
||||
// ajoute un niveau avec un label
|
||||
// adds a level with a label
|
||||
void CBotInstr::IncLvl(CBotString& label)
|
||||
{
|
||||
m_labelLvl.SetSize(m_LoopLvl+1);
|
||||
|
@ -69,7 +65,7 @@ void CBotInstr::IncLvl(CBotString& label)
|
|||
m_LoopLvl++;
|
||||
}
|
||||
|
||||
// ajoute un niveau (instruction switch)
|
||||
// adds a level (switch statement)
|
||||
void CBotInstr::IncLvl()
|
||||
{
|
||||
m_labelLvl.SetSize(m_LoopLvl+1);
|
||||
|
@ -77,14 +73,14 @@ void CBotInstr::IncLvl()
|
|||
m_LoopLvl++;
|
||||
}
|
||||
|
||||
// libère un niveau
|
||||
// free a level
|
||||
void CBotInstr::DecLvl()
|
||||
{
|
||||
m_LoopLvl--;
|
||||
m_labelLvl[m_LoopLvl].Empty();
|
||||
}
|
||||
|
||||
// controle la validité d'un break ou continu
|
||||
// control validity of break and continue
|
||||
bool CBotInstr::ChkLvl(const CBotString& label, int type)
|
||||
{
|
||||
int i = m_LoopLvl;
|
||||
|
@ -104,30 +100,30 @@ bool CBotInstr::IsOfClass(CBotString n)
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// gestion de base de la classe CBotInstr
|
||||
// database management class CBotInstr
|
||||
|
||||
// définie le token correspondant à l'instruction
|
||||
// set the token corresponding to the instruction
|
||||
|
||||
void CBotInstr::SetToken(CBotToken* p)
|
||||
{
|
||||
m_token = *p;
|
||||
}
|
||||
|
||||
// rend le type du token associé à l'instruction
|
||||
// return the type of the token assicated with the instruction
|
||||
|
||||
int CBotInstr::GivTokenType()
|
||||
{
|
||||
return m_token.GivType();
|
||||
}
|
||||
|
||||
// rend le token associé
|
||||
// return associated token
|
||||
|
||||
CBotToken* CBotInstr::GivToken()
|
||||
{
|
||||
return &m_token;
|
||||
}
|
||||
|
||||
// ajoute une instruction à la suite des autres
|
||||
// adds the statement following the other
|
||||
|
||||
void CBotInstr::AddNext(CBotInstr* n)
|
||||
{
|
||||
|
@ -150,7 +146,7 @@ void CBotInstr::AddNext3b(CBotInstr* n)
|
|||
p->m_next3b = n;
|
||||
}
|
||||
|
||||
// donne l'instruction suivante
|
||||
// returns next statement
|
||||
|
||||
CBotInstr* CBotInstr::GivNext()
|
||||
{
|
||||
|
@ -168,11 +164,12 @@ CBotInstr* CBotInstr::GivNext3b()
|
|||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// compile une instruction, qui peut être
|
||||
// while, do, try, throw, if, for, switch, break, continu, return
|
||||
// compile an instruction which can be
|
||||
// while, do, try, throw, if, for, switch, break, continue, return
|
||||
// int, float, boolean, string,
|
||||
// déclaration d'une instance d'une classe
|
||||
// expression quelconque
|
||||
// declaration of an instance of a class
|
||||
// arbitrary expression
|
||||
|
||||
|
||||
CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
|
||||
{
|
||||
|
@ -180,14 +177,14 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
|
|||
|
||||
if ( p == NULL ) return NULL;
|
||||
|
||||
int type = p->GivType(); // quel est le prochaine token ?
|
||||
int type = p->GivType(); // what is the next token
|
||||
|
||||
// y a-t-il un label ?
|
||||
// is it a lable?
|
||||
if ( IsOfType( pp, TokenTypVar ) &&
|
||||
IsOfType( pp, ID_DOTS ) )
|
||||
{
|
||||
type = pp->GivType();
|
||||
// seules ces instructions acceptent un label
|
||||
// these instructions accept only lable
|
||||
if (!IsOfTypeList( pp, ID_WHILE, ID_FOR, ID_DO, ID_REPEAT, 0 ))
|
||||
{
|
||||
pStack->SetError(TX_LABEL, pp->GivStart());
|
||||
|
@ -195,7 +192,7 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
|
|||
}
|
||||
}
|
||||
|
||||
// appel la routine de compilation correspondant au token trouvé
|
||||
// call routine corresponding to the compilation token found
|
||||
switch (type)
|
||||
{
|
||||
case ID_WHILE:
|
||||
|
@ -265,9 +262,9 @@ CBotInstr* CBotInstr::Compile(CBotToken* &p, CBotCStack* pStack)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// ce peut être une définition d'instance de class
|
||||
// this might be an instance of class definnition
|
||||
CBotToken* ppp = p;
|
||||
if ( IsOfType( ppp, TokenTypVar ) /* && IsOfType( ppp, TokenTypVar )*/ )
|
||||
if (IsOfType( ppp, TokenTypVar ))
|
||||
{
|
||||
if ( CBotClass::Find(p) != NULL )
|
||||
{
|
||||
|
@ -3131,7 +3128,7 @@ CBotInstr* CBotExprVar::Compile(CBotToken* &p, CBotCStack* pStack, int privat)
|
|||
// This is an element of the current class
|
||||
// ads the equivalent of this. before
|
||||
/// \TODO need to be fixed revised and fixed after adding unit
|
||||
//tests
|
||||
///tests
|
||||
CBotToken token("this");
|
||||
inst->SetToken(&token);
|
||||
((CBotExprVar*)inst)->m_nIdent = -2; // identificator for this
|
||||
|
|
279
src/CBot/CBot.rc
279
src/CBot/CBot.rc
|
@ -1,279 +0,0 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// French (France) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_IF "if"
|
||||
ID_ELSE "else"
|
||||
ID_WHILE "while"
|
||||
ID_DO "do"
|
||||
ID_FOR "for"
|
||||
ID_BREAK "break"
|
||||
ID_CONTINUE "continue"
|
||||
ID_SWITCH "switch"
|
||||
ID_CASE "case"
|
||||
ID_DEFAULT "default"
|
||||
ID_TRY "try"
|
||||
ID_THROW "throw"
|
||||
ID_CATCH "catch"
|
||||
ID_FINALLY "finally"
|
||||
ID_TXT_AND "and"
|
||||
ID_TXT_OR "or"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_DEBUGDD "STARTDEBUGDD"
|
||||
ID_INT "int"
|
||||
ID_FLOAT "float"
|
||||
ID_BOOLEAN "boolean"
|
||||
ID_STRING "string"
|
||||
ID_VOID "void"
|
||||
ID_BOOL "bool"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_TXT_NOT "not"
|
||||
ID_RETURN "return"
|
||||
ID_CLASS "class"
|
||||
ID_EXTENDS "extends"
|
||||
ID_SYNCHO "synchronized"
|
||||
ID_NEW "new"
|
||||
ID_PUBLIC "public"
|
||||
ID_EXTERN "extern"
|
||||
ID_FINAL "final"
|
||||
ID_STATIC "static"
|
||||
ID_PROTECTED "protected"
|
||||
ID_PRIVATE "private"
|
||||
ID_REPEAT "repeat"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
TX_OPENPAR "Il manque une parenthèse ouvrante."
|
||||
TX_CLOSEPAR "Il manque une parenthèse fermante."
|
||||
TX_NOTBOOL "L'expression doit être un boolean."
|
||||
TX_UNDEFVAR "Variable non déclarée."
|
||||
TX_BADLEFT "Assignation impossible."
|
||||
TX_ENDOF "Terminateur point-virgule non trouvé."
|
||||
TX_OUTCASE "Instruction ""case"" hors d'un bloc ""switch""."
|
||||
TX_NOTERM "Instructions après la fin."
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
TX_CLOSEBLK "Il manque la fin du bloc."
|
||||
TX_ELSEWITHOUTIF "Instruction ""else"" sans ""if"" correspondant."
|
||||
TX_OPENBLK "Début d'un bloc attendu."
|
||||
TX_BADTYPE "Mauvais type de résultat pour l'assignation."
|
||||
TX_REDEFVAR "Redéfinition d'une variable."
|
||||
TX_BAD2TYPE "Les deux opérandes ne sont pas de types compatibles."
|
||||
TX_UNDEFCALL "Routine inconnue."
|
||||
TX_MISDOTS "Séparateur "" : "" attendu."
|
||||
TX_WHILE "Manque le mot ""while""."
|
||||
TX_BREAK "Instruction ""break"" en dehors d'une boucle."
|
||||
TX_LABEL "Un label ne peut se placer que devant un ""for"", un ""while"" ou un ""do""."
|
||||
TX_NOLABEL "Cette étiquette n'existe pas"
|
||||
TX_NOCASE "Manque une instruction ""case""."
|
||||
TX_BADNUM "Un nombre est attendu."
|
||||
TX_VOID "Paramètre void."
|
||||
TX_NOTYP "Déclaration de type attendu."
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
TX_DIVZERO "Division par zéro."
|
||||
TX_NOTINIT "Variable non initialisée."
|
||||
TX_BADTHROW "Valeur négative refusée pour ""throw""."
|
||||
TX_NORETVAL "La fonction n'a pas retourné de résultat"
|
||||
TX_NORUN "Pas de fonction en exécution"
|
||||
TX_NOCALL "Appel d'une fonction inexistante"
|
||||
TX_NOCLASS "Cette classe n'existe pas"
|
||||
TX_NULLPT "Pointeur nul."
|
||||
TX_OPNAN "Opération sur un ""nan"""
|
||||
TX_OUTARRAY "Accès hors du tableau"
|
||||
TX_STACKOVER "Dépassement de la pile"
|
||||
TX_DELETEDPT "Pointeur à un objet détruit"
|
||||
TX_FILEOPEN "Ouverture du fichier impossible"
|
||||
TX_NOTOPEN "Fichier pas ouvert"
|
||||
TX_ERRREAD "Erreur de lecture"
|
||||
TX_ERRWRITE "Erreur d'écriture"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
TX_NOVAR "Nom d'une variable attendu."
|
||||
TX_NOFONC "Nom de la fonction attendu."
|
||||
TX_OVERPARAM "Trop de paramètres."
|
||||
TX_REDEF "Cette fonction existe déjà."
|
||||
TX_LOWPARAM "Pas assez de paramètres."
|
||||
TX_BADPARAM "Aucune fonction de ce nom n'accepte ce(s) type(s) de paramètre(s)."
|
||||
TX_NUMPARAM "Aucune fonction de ce nom n'accepte ce nombre de paramètres."
|
||||
TX_NOITEM "Cet élément n'existe pas dans cette classe."
|
||||
TX_DOT "L'objet n'est pas une instance d'une classe."
|
||||
TX_NOCONST "Il n'y a pas de constructeur approprié."
|
||||
TX_REDEFCLASS "Cette classe existe déjà."
|
||||
TX_CLBRK """ ] "" attendu."
|
||||
TX_RESERVED "Ce mot est réservé."
|
||||
TX_BADNEW "Mauvais argument pour ""new""."
|
||||
TX_OPBRK """ [ "" attendu."
|
||||
TX_BADSTRING "Une chaîne de caractère est attendue."
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
TX_BADINDEX "Mauvais type d'index"
|
||||
TX_PRIVATE "Membre privé de la classe"
|
||||
TX_NOPUBLIC """public"" manque"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_OPENPAR "("
|
||||
ID_CLOSEPAR ")"
|
||||
ID_OPBLK "{"
|
||||
ID_CLBLK "}"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_SEP ";"
|
||||
ID_COMMA ","
|
||||
ID_DOTS ":"
|
||||
ID_DOT "."
|
||||
ID_OPBRK "["
|
||||
ID_CLBRK "]"
|
||||
ID_DBLDOTS "::"
|
||||
ID_LOGIC "?"
|
||||
ID_ADD "+"
|
||||
ID_SUB "-"
|
||||
ID_MUL "*"
|
||||
ID_DIV "/"
|
||||
ID_ASS "="
|
||||
ID_ASSADD "+="
|
||||
ID_ASSSUB "-="
|
||||
ID_ASSMUL "*="
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_TRUE "true"
|
||||
ID_FALSE "false"
|
||||
ID_NULL "null"
|
||||
ID_NAN "nan"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_ASSDIV "/="
|
||||
ID_ASSOR "|="
|
||||
ID_ASSAND "&="
|
||||
ID_ASSXOR "^="
|
||||
ID_ASSSL "<<="
|
||||
ID_ASSSR ">>>="
|
||||
ID_ASSASR ">>="
|
||||
ID_SL "<<"
|
||||
ID_SR ">>>"
|
||||
ID_ASR ">>"
|
||||
ID_INC "++"
|
||||
ID_DEC "--"
|
||||
ID_LO "<"
|
||||
ID_HI ">"
|
||||
ID_LS "<="
|
||||
ID_HS ">="
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_EQ "=="
|
||||
ID_NE "!="
|
||||
ID_AND "&"
|
||||
ID_XOR "^"
|
||||
ID_OR "|"
|
||||
ID_LOG_AND "&&"
|
||||
ID_LOG_OR "||"
|
||||
ID_LOG_NOT "!"
|
||||
ID_NOT "~"
|
||||
ID_MODULO "%"
|
||||
ID_POWER "**"
|
||||
ID_ASSMODULO "%="
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
TX_UNDEF "undefined"
|
||||
TX_NAN "not a number"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_SUPER "super"
|
||||
END
|
||||
|
||||
#endif // French (France) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
|
@ -13,64 +13,66 @@
|
|||
// *
|
||||
// * You should have received a copy of the GNU General Public License
|
||||
// * along with this program. If not, see http://www.gnu.org/licenses/.////////////////////////////////////////////////////////////////////////
|
||||
// Librairie pour l'interprétation du language CBOT
|
||||
// pour le jeu COLOBOT
|
||||
//
|
||||
#ifndef _CBOTDLL_H_
|
||||
#define _CBOTDLL_H_
|
||||
/**
|
||||
* \file CBotDll.h
|
||||
* \brief Library for interpretation of CBOT language
|
||||
*/
|
||||
|
||||
//#include "stdafx.h"
|
||||
|
||||
// #include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include "resource.h"
|
||||
#include <map>
|
||||
#include <cstring>
|
||||
|
||||
// #define DllExport __declspec( dllexport )
|
||||
|
||||
#define CBOTVERSION 104
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// quelques classes définies par ailleurs
|
||||
// forward declaration of needed classes
|
||||
|
||||
class CBotToken; // programme transformé en "jetons"
|
||||
class CBotStack; // pile pour l'exécution
|
||||
class CBotClass; // classe d'object
|
||||
class CBotInstr; // instruction à exécuter
|
||||
class CBotFunction; // les fonctions user
|
||||
class CBotVar; // les variables
|
||||
class CBotVarClass; // une instance de classe
|
||||
class CBotVarPointer; // pointeur à une instance de classe
|
||||
class CBotCall; // les fonctions
|
||||
class CBotCallMethode; // les méthodes
|
||||
class CBotDefParam; // liste de paramètres
|
||||
class CBotCStack;
|
||||
class CBotToken; // program turned into "tokens
|
||||
class CBotStack; // for the execution stack
|
||||
class CBotClass; // class of object
|
||||
class CBotInstr; // instruction to be executed
|
||||
class CBotFunction; // user functions
|
||||
class CBotVar; // variables
|
||||
class CBotVarClass; // instance of class
|
||||
class CBotVarPointer; // pointer to an instance of class
|
||||
class CBotCall; // fonctions
|
||||
class CBotCallMethode; // methods
|
||||
class CBotDefParam; // parameter list
|
||||
class CBotCStack; // stack
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Gestion des variables
|
||||
// Variables management
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ces types sont calqués sur les types Java
|
||||
// ne pas changer l'ordre de ces types
|
||||
|
||||
/** \brief CBotType Defines known types. This types are modeled on Java types. Do not change the order of elements */
|
||||
enum CBotType
|
||||
{
|
||||
CBotTypVoid = 0, // fonction retournant void
|
||||
CBotTypByte = 1, //n // nombre entier ( 8 bits)
|
||||
CBotTypShort = 2, //n // nombre entier (16 bits)
|
||||
CBotTypChar = 3, //n // caractère "unicode" (16 bits)
|
||||
CBotTypInt = 4, // nombre entier (32 bits)
|
||||
CBotTypLong = 5, //n // nombre entier (64 bits)
|
||||
CBotTypFloat = 6, // nombre décimal (32 bits)
|
||||
CBotTypDouble = 7, //n // nombre décimal (64 bits)
|
||||
CBotTypBoolean = 8, // true ou false exclusivement
|
||||
CBotTypString = 9, // chaine de caractère
|
||||
CBotTypVoid = 0,
|
||||
CBotTypByte = 1,
|
||||
CBotTypShort = 2,
|
||||
CBotTypChar = 3,
|
||||
CBotTypInt = 4,
|
||||
CBotTypLong = 5,
|
||||
CBotTypFloat = 6,
|
||||
CBotTypDouble = 7,
|
||||
CBotTypBoolean = 8,
|
||||
CBotTypString = 9,
|
||||
|
||||
CBotTypArrayPointer = 10, // un tableau de variables
|
||||
CBotTypArrayBody = 11, // idem mais crée l'instance
|
||||
CBotTypArrayPointer = 10, // array of variables
|
||||
CBotTypArrayBody = 11, // same but creates an instance
|
||||
|
||||
CBotTypPointer = 12, // pointeur à une instance
|
||||
CBotTypNullPointer = 13, // pointeur null est spécial
|
||||
|
||||
CBotTypClass = 15, // instance d'une classe
|
||||
CBotTypIntrinsic = 16 // instance d'une classe intrinsèque
|
||||
CBotTypPointer = 12, // pointer to an instance
|
||||
CBotTypNullPointer = 13, // null pointer is special
|
||||
CBotTypClass = 15,
|
||||
CBotTypIntrinsic = 16 // instance of a class intrinsic
|
||||
};
|
||||
//n = non encore implémenté
|
||||
|
||||
|
@ -93,62 +95,47 @@ private:
|
|||
|
||||
public:
|
||||
// divers constructeurs selon les besoins
|
||||
//DllExport
|
||||
CBotTypResult(int type);
|
||||
// pour les types simples (CBotTypInt à CBotTypString)
|
||||
//DllExport
|
||||
CBotTypResult(int type, const char* name);
|
||||
// pour les types pointeur et classe intrinsic
|
||||
//DllExport
|
||||
CBotTypResult(int type, CBotClass* pClass);
|
||||
// idem à partir de l'instance d'une classe
|
||||
//DllExport
|
||||
CBotTypResult(int type, CBotTypResult elem);
|
||||
// pour les tableaux de variables
|
||||
|
||||
//DllExport
|
||||
CBotTypResult(const CBotTypResult& typ);
|
||||
// pour les assignations
|
||||
//DllExport
|
||||
CBotTypResult();
|
||||
// pour par défaut
|
||||
//DllExport
|
||||
~CBotTypResult();
|
||||
|
||||
//DllExport
|
||||
int GivType(int mode = 0) const;
|
||||
// rend le type CBotTyp* du résultat
|
||||
|
||||
void SetType(int n);
|
||||
// modifie le type
|
||||
|
||||
//DllExport
|
||||
CBotClass* GivClass() const;
|
||||
// rend le pointeur à la classe (pour les CBotTypClass, CBotTypPointer)
|
||||
|
||||
//DllExport
|
||||
int GivLimite() const;
|
||||
// rend la taille limite du tableau (CBotTypArray)
|
||||
|
||||
//DllExport
|
||||
void SetLimite(int n);
|
||||
// fixe une limite au tableau
|
||||
|
||||
void SetArray(int* max );
|
||||
// idem avec une liste de dimension (tableaux de tableaux)
|
||||
|
||||
//DllExport
|
||||
CBotTypResult& GivTypElem() const;
|
||||
// rend le type des éléments du tableau (CBotTypArray)
|
||||
|
||||
//DllExport
|
||||
bool Compare(const CBotTypResult& typ) const;
|
||||
// compare si les types sont compatibles
|
||||
//DllExport
|
||||
bool Eq(int type) const;
|
||||
// compare le type
|
||||
|
||||
//DllExport
|
||||
CBotTypResult&
|
||||
operator=(const CBotTypResult& src);
|
||||
// copie un type complet dans un autre
|
||||
|
@ -256,106 +243,74 @@ public:
|
|||
|
||||
class CBotString
|
||||
{
|
||||
private:
|
||||
char* m_ptr; // pointeur à la chaine
|
||||
int m_lg; // longueur de la chaine
|
||||
// static
|
||||
// HINSTANCE m_hInstance;
|
||||
|
||||
public:
|
||||
//DllExport
|
||||
CBotString();
|
||||
//DllExport
|
||||
CBotString(const char* p);
|
||||
//DllExport
|
||||
CBotString(const CBotString& p);
|
||||
//DllExport
|
||||
~CBotString();
|
||||
|
||||
//DllExport
|
||||
void Empty();
|
||||
//DllExport
|
||||
bool IsEmpty() const;
|
||||
//DllExport
|
||||
int GivLength();
|
||||
//DllExport
|
||||
int Find(const char c);
|
||||
//DllExport
|
||||
int Find(const char* lpsz);
|
||||
//DllExport
|
||||
int ReverseFind(const char c);
|
||||
//DllExport
|
||||
int ReverseFind(const char* lpsz);
|
||||
//DllExport
|
||||
bool LoadString(unsigned int id);
|
||||
//DllExport
|
||||
CBotString Mid(int nFirst, int nCount) const;
|
||||
//DllExport
|
||||
CBotString Mid(int nFirst) const;
|
||||
//DllExport
|
||||
CBotString Mid(int start, int lg=-1);
|
||||
CBotString Left(int nCount) const;
|
||||
//DllExport
|
||||
CBotString Right(int nCount) const;
|
||||
int Compare(const char* lpsz) const;
|
||||
void MakeUpper();
|
||||
void MakeLower();
|
||||
|
||||
//DllExport
|
||||
const CBotString&
|
||||
operator=(const CBotString& stringSrc);
|
||||
//DllExport
|
||||
const CBotString&
|
||||
operator=(const char ch);
|
||||
//DllExport
|
||||
const CBotString&
|
||||
operator=(const char* pString);
|
||||
//DllExport
|
||||
const CBotString&
|
||||
operator+(const CBotString& str);
|
||||
//DllExport
|
||||
friend CBotString
|
||||
operator+(const CBotString& string, const char* lpsz);
|
||||
|
||||
//DllExport
|
||||
const CBotString&
|
||||
operator+=(const char ch);
|
||||
//DllExport
|
||||
const CBotString&
|
||||
operator+=(const CBotString& str);
|
||||
//DllExport
|
||||
/**
|
||||
* \brief Overloaded oprators to work on CBotString classes
|
||||
*/
|
||||
const CBotString& operator=(const CBotString& stringSrc);
|
||||
const CBotString& operator=(const char ch);
|
||||
const CBotString& operator=(const char* pString);
|
||||
const CBotString& operator+(const CBotString& str);
|
||||
friend CBotString operator+(const CBotString& string, const char* lpsz);
|
||||
|
||||
const CBotString& operator+=(const char ch);
|
||||
const CBotString& operator+=(const CBotString& str);
|
||||
bool operator==(const CBotString& str);
|
||||
//DllExport
|
||||
bool operator==(const char* p);
|
||||
//DllExport
|
||||
bool operator!=(const CBotString& str);
|
||||
//DllExport
|
||||
bool operator!=(const char* p);
|
||||
//DllExport
|
||||
bool operator>(const CBotString& str);
|
||||
//DllExport
|
||||
bool operator>(const char* p);
|
||||
//DllExport
|
||||
bool operator>=(const CBotString& str);
|
||||
//DllExport
|
||||
bool operator>=(const char* p);
|
||||
//DllExport
|
||||
bool operator<(const CBotString& str);
|
||||
//DllExport
|
||||
bool operator<(const char* p);
|
||||
//DllExport
|
||||
bool operator<=(const CBotString& str);
|
||||
//DllExport
|
||||
bool operator<=(const char* p);
|
||||
|
||||
//DllExport
|
||||
operator const char*() const; // as a C string
|
||||
|
||||
int Compare(const char* lpsz) const;
|
||||
|
||||
//DllExport
|
||||
CBotString Mid(int start, int lg=-1);
|
||||
private:
|
||||
|
||||
//DllExport
|
||||
void MakeUpper();
|
||||
//DllExport
|
||||
void MakeLower();
|
||||
/** \brief Pointer to string */
|
||||
char* m_ptr;
|
||||
|
||||
/** \brief Length of the string */
|
||||
int m_lg;
|
||||
|
||||
/** \brief Keeps the string corresponding to keyword ID */
|
||||
static const std::map<EID, const char const *> s_keywordString;
|
||||
|
||||
/**
|
||||
* \brief MapIdToString maps given ID to its string equivalent
|
||||
* \param id Provided identifier
|
||||
* \return string if found, else NullString
|
||||
*/
|
||||
static const char * MapIdToString(EID id);
|
||||
};
|
||||
|
||||
|
||||
|
@ -369,20 +324,13 @@ private:
|
|||
CBotString* m_pData; // ^aux données
|
||||
|
||||
public:
|
||||
//DllExport
|
||||
CBotStringArray();
|
||||
//DllExport
|
||||
~CBotStringArray();
|
||||
//DllExport
|
||||
void SetSize(int nb);
|
||||
//DllExport
|
||||
int GivSize();
|
||||
//DllExport
|
||||
void Add(const CBotString& str);
|
||||
//DllExport
|
||||
CBotString& operator[](int nIndex);
|
||||
|
||||
//DllExport
|
||||
CBotString& ElementAt(int nIndex);
|
||||
};
|
||||
|
||||
|
@ -423,30 +371,23 @@ public:
|
|||
bool m_bCompileClass;
|
||||
|
||||
public:
|
||||
//DllExport
|
||||
static
|
||||
void Init();
|
||||
// initialise le module (défini les mots clefs pour les erreurs)
|
||||
// doit être fait une fois (et une seule) au tout début
|
||||
//DllExport
|
||||
static
|
||||
void Free();
|
||||
// libère les zones mémoires statiques
|
||||
|
||||
//DllExport
|
||||
static
|
||||
int GivVersion();
|
||||
// donne la version de la librairie CBOT
|
||||
|
||||
|
||||
//DllExport
|
||||
CBotProgram();
|
||||
//DllExport
|
||||
CBotProgram(CBotVar* pInstance);
|
||||
//DllExport
|
||||
~CBotProgram();
|
||||
|
||||
//DllExport
|
||||
bool Compile( const char* program, CBotStringArray& ListFonctions, void* pUser = NULL);
|
||||
// compile le programme donné en texte
|
||||
// retourne false s'il y a une erreur à la compilation
|
||||
|
@ -454,51 +395,41 @@ public:
|
|||
// ListFonctions retourne le nom des fonctions déclarées extern
|
||||
// pUser permet de passer un pointeur pour les routines définies par AddFunction
|
||||
|
||||
//DllExport
|
||||
void SetIdent(long n);
|
||||
// associe un identificateur avec l'instance CBotProgram
|
||||
|
||||
//DllExport
|
||||
long GivIdent();
|
||||
// redonne l'identificateur
|
||||
|
||||
//DllExport
|
||||
int GivError();
|
||||
//DllExport
|
||||
bool GetError(int& code, int& start, int& end);
|
||||
//DllExport
|
||||
bool GetError(int& code, int& start, int& end, CBotProgram* &pProg);
|
||||
// si true
|
||||
// donne l'erreur trouvée à la compilation
|
||||
// ou à l'exécution
|
||||
// start et end délimite le bloc où se trouve l'erreur
|
||||
// pProg permet de savoir dans quel "module" s'est produite l'erreur d'exécution
|
||||
//DllExport
|
||||
static
|
||||
CBotString GivErrorText(int code);
|
||||
|
||||
|
||||
//DllExport
|
||||
bool Start(const char* name);
|
||||
// définie quelle fonction doit être exécutée
|
||||
// retourne false si la fontion name n'est pas trouvée
|
||||
// le programme ne fait rien, il faut appeller Run() pour cela
|
||||
|
||||
//DllExport
|
||||
bool Run(void* pUser = NULL, int timer = -1);
|
||||
// exécute le programme
|
||||
// retourne false si le programme a été suspendu
|
||||
// retourne true si le programme s'est terminé avec ou sans erreur
|
||||
// timer = 0 permet de faire une avance pas à pas
|
||||
|
||||
//DllExport
|
||||
bool GetRunPos(const char* &FunctionName, int &start, int &end);
|
||||
// donne la position dans le programme en exécution
|
||||
// retourne false si on n'est pas en exécution (programme terminé)
|
||||
// FunctionName est un pointeur rendu sur le nom de la fonction
|
||||
// start et end la position dans le texte du token en traitement
|
||||
|
||||
//DllExport
|
||||
CBotVar* GivStackVars(const char* &FunctionName, int level);
|
||||
// permet d'obtenir le pointeur aux variables sur la pile d'exécution
|
||||
// level est un paramètre d'entrée, 0 pour le dernier niveau, -1, -2, etc pour les autres niveau
|
||||
|
@ -507,18 +438,15 @@ public:
|
|||
// FunctionName donne le nom de la fonction où se trouvent ces variables
|
||||
// FunctionName == NULL signifiant qu'on est plus dans le programme (selon level)
|
||||
|
||||
//DllExport
|
||||
void Stop();
|
||||
// arrête l'exécution du programme
|
||||
// quitte donc le mode "suspendu"
|
||||
|
||||
//DllExport
|
||||
static
|
||||
void SetTimer(int n);
|
||||
// défini le nombre de pas (parties d'instructions) à faire
|
||||
// dans Run() avant de rendre la main "false"
|
||||
|
||||
//DllExport
|
||||
static
|
||||
bool AddFunction(const char* name,
|
||||
bool rExec (CBotVar* pVar, CBotVar* pResult, int& Exception, void* pUser),
|
||||
|
@ -526,21 +454,17 @@ public:
|
|||
// cet appel permet d'ajouter de manière externe (**)
|
||||
// une nouvelle fonction utilisable par le programme CBot
|
||||
|
||||
//DllExport
|
||||
static
|
||||
bool DefineNum(const char* name, long val);
|
||||
|
||||
//DllExport
|
||||
bool SaveState(FILE* pf);
|
||||
// sauvegarde l'état d'exécution dans le fichier
|
||||
// le fichier doit avoir été ouvert avec l'appel fopen de cette dll
|
||||
// sinon le système plante
|
||||
//DllExport
|
||||
bool RestoreState(FILE* pf);
|
||||
// rétablie l'état de l'exécution depuis le fichier
|
||||
// le programme compilé doit évidemment être identique
|
||||
|
||||
//DllExport
|
||||
bool GetPosition(const char* name, int& start, int& stop,
|
||||
CBotGet modestart = GetPosExtern,
|
||||
CBotGet modestop = GetPosBloc);
|
||||
|
@ -555,13 +479,9 @@ public:
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// routines pour la gestion d'un fichier (FILE*)
|
||||
//DllExport
|
||||
FILE* fOpen(const char* name, const char* mode);
|
||||
//DllExport
|
||||
int fClose(FILE* filehandle);
|
||||
//DllExport
|
||||
size_t fWrite(const void *buffer, size_t elemsize, size_t length, FILE* filehandle);
|
||||
//DllExport
|
||||
size_t fRead(void *buffer, size_t elemsize, size_t length, FILE* filehandle);
|
||||
|
||||
|
||||
|
@ -614,7 +534,6 @@ bool rMoyenne(CBotVar* pVar, CBotVar* pResult, int& Exception)
|
|||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// Classe pour la gestion des variables
|
||||
|
||||
// les méthodes marquées DllExport
|
||||
// peuvent être utile à l'exterieur du module
|
||||
// ( il n'est pour l'instant pas prévu de pouvoir créer ces objets en externe )
|
||||
|
||||
|
@ -662,18 +581,10 @@ public:
|
|||
CBotVar();
|
||||
virtual ~CBotVar( ); // destructeur
|
||||
|
||||
|
||||
/* //DllExport
|
||||
static
|
||||
CBotVar* Create( const char* name, int type, const char* ClassName = NULL);
|
||||
// crée une variable selon son type,*/
|
||||
|
||||
//DllExport
|
||||
static
|
||||
CBotVar* Create( const char* name, CBotTypResult type);
|
||||
// idem à partir du type complet
|
||||
|
||||
//DllExport
|
||||
static
|
||||
CBotVar* Create( const char* name, CBotClass* pClass);
|
||||
// idem pour une instance d'une classe connue
|
||||
|
@ -690,51 +601,38 @@ virtual ~CBotVar( ); // destructeur
|
|||
CBotVar* Create( CBotVar* pVar );
|
||||
|
||||
|
||||
//DllExport
|
||||
void SetUserPtr(void* pUser);
|
||||
// associe un pointeur utilisateur à une instance
|
||||
|
||||
//DllExport
|
||||
virtual void SetIdent(long UniqId);
|
||||
// associe un identificateur unique à une instance
|
||||
// ( c'est à l'utilisateur de s'assurer que l'id est unique)
|
||||
|
||||
//DllExport
|
||||
void* GivUserPtr();
|
||||
// rend le pointeur associé à la variable
|
||||
|
||||
//DllExport
|
||||
CBotString GivName(); // le nom de la variable, s'il est connu
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
void SetName(const char* name); // change le nom de la variable
|
||||
|
||||
//DllExport
|
||||
int GivType(int mode = 0); // rend le type de base (int) de la variable
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//DllExport
|
||||
CBotTypResult GivTypResult(int mode = 0); // rend le type complet de la variable
|
||||
|
||||
|
||||
CBotToken* GivToken();
|
||||
void SetType(CBotTypResult& type);
|
||||
|
||||
//DllExport
|
||||
void SetInit(int bInit); // met la variable dans l'état IS_UNDEF, IS_DEF, IS_NAN
|
||||
|
||||
//DllExport
|
||||
int GivInit(); // donne l'état de la variable
|
||||
|
||||
//DllExport
|
||||
void SetStatic(bool bStatic);
|
||||
//DllExport
|
||||
bool IsStatic();
|
||||
|
||||
//DllExport
|
||||
void SetPrivate(int mPrivate);
|
||||
//DllExport
|
||||
bool IsPrivate(int mode = PR_PROTECT);
|
||||
//DllExport
|
||||
int GivPrivate();
|
||||
|
||||
virtual
|
||||
|
@ -742,29 +640,23 @@ virtual ~CBotVar( ); // destructeur
|
|||
|
||||
void SetVal(CBotVar* var); // remprend une valeur
|
||||
|
||||
//DllExport
|
||||
virtual
|
||||
CBotVar* GivItem(const char* name); // rend un élément d'une classe selon son nom (*)
|
||||
virtual
|
||||
CBotVar* GivItemRef(int nIdent); // idem à partir du n° ref
|
||||
|
||||
//DllExport
|
||||
virtual
|
||||
CBotVar* GivItem(int row, bool bGrow = false);
|
||||
|
||||
//DllExport
|
||||
virtual
|
||||
CBotVar* GivItemList(); // donne la liste des éléments
|
||||
|
||||
//DllExport
|
||||
CBotVar* GivStaticVar(); // rend le pointeur à la variable si elle est statique
|
||||
|
||||
//DllExport
|
||||
bool IsElemOfClass(const char* name);
|
||||
// dit si l'élément appartient à la classe "name"
|
||||
// rend true si l'objet est d'une classe fille
|
||||
|
||||
//DllExport
|
||||
CBotVar* GivNext(); // prochaine variable dans la liste (paramètres)
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -773,24 +665,19 @@ virtual ~CBotVar( ); // destructeur
|
|||
virtual
|
||||
void Copy(CBotVar* pSrc, bool bName = true); // fait une copie de la variable
|
||||
|
||||
//DllExport
|
||||
virtual void SetValInt(int val, const char* name = NULL);
|
||||
// initialise avec une valeur entière (#)
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//DllExport
|
||||
virtual void SetValFloat(float val); // initialise avec une valeur réelle (#)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//DllExport
|
||||
virtual void SetValString(const char* p);// initialise avec une valeur chaîne (#)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//DllExport
|
||||
virtual int GivValInt(); // demande la valeur entière (#)
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//DllExport
|
||||
virtual float GivValFloat(); // demande la valeur réelle (#)
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -838,13 +725,11 @@ virtual ~CBotVar( ); // destructeur
|
|||
virtual bool Save1State(FILE* pf);
|
||||
static bool RestoreState(FILE* pf, CBotVar* &pVar);
|
||||
|
||||
//DllExport
|
||||
void debug();
|
||||
|
||||
// virtual
|
||||
// CBotVar* GivMyThis();
|
||||
|
||||
//DllExport
|
||||
virtual
|
||||
void Maj(void* pUser = NULL, bool bContinue = true);
|
||||
|
||||
|
@ -901,34 +786,27 @@ private:
|
|||
public:
|
||||
bool m_IsDef; // marque si est définie ou pas encore
|
||||
|
||||
//DllExport
|
||||
CBotClass( const char* name,
|
||||
CBotClass* pParent, bool bIntrinsic = false ); // constructeur
|
||||
// Dès qu'une classe est créée, elle est connue
|
||||
// partout dans CBot
|
||||
// le mode intrinsic donne une classe qui n'est pas gérée par des pointeurs
|
||||
|
||||
//DllExport
|
||||
~CBotClass( ); // destructeur
|
||||
|
||||
//DllExport
|
||||
bool AddFunction(const char* name,
|
||||
bool rExec (CBotVar* pThis, CBotVar* pVar, CBotVar* pResult, int& Exception),
|
||||
CBotTypResult rCompile (CBotVar* pThis, CBotVar* &pVar));
|
||||
// cet appel permet d'ajouter de manière externe (**)
|
||||
// une nouvelle méthode utilisable par les objets de cette classe
|
||||
|
||||
//DllExport
|
||||
bool AddUpdateFunc( void rMaj ( CBotVar* pThis, void* pUser ) );
|
||||
// défini la routine qui sera appellée pour mettre à jour les élements de la classe
|
||||
|
||||
//DllExport
|
||||
bool AddItem(CBotString name, CBotTypResult type, int mPrivate = PR_PUBLIC);
|
||||
// ajoute un élément à la classe
|
||||
// //DllExport
|
||||
// bool AddItem(CBotString name, CBotClass* pClass);
|
||||
// idem pour des éléments appartenant à pClass
|
||||
//DllExport
|
||||
bool AddItem(CBotVar* pVar);
|
||||
// idem en passant le pointeur à une instance d'une variable
|
||||
// l'objet est pris tel quel, il ne faut donc pas le détruire
|
||||
|
@ -938,20 +816,16 @@ public:
|
|||
// idem en donnant un élément de type CBotVar
|
||||
void AddNext(CBotClass* pClass);
|
||||
|
||||
//DllExport
|
||||
CBotString GivName(); // rend le nom de la classe
|
||||
//DllExport
|
||||
CBotClass* GivParent(); // donne la classe père (ou NULL)
|
||||
|
||||
// dit si une classe est dérivée (Extends) d'une autre
|
||||
// rend true aussi si les classes sont identiques
|
||||
//DllExport
|
||||
bool IsChildOf(CBotClass* pClass);
|
||||
|
||||
static
|
||||
CBotClass* Find(CBotToken* &pToken); // trouve une classe d'après son nom
|
||||
|
||||
//DllExport
|
||||
static
|
||||
CBotClass* Find(const char* name);
|
||||
|
||||
|
@ -978,11 +852,9 @@ public:
|
|||
static
|
||||
void Free();
|
||||
|
||||
//DllExport
|
||||
static
|
||||
bool SaveStaticState(FILE* pf);
|
||||
|
||||
//DllExport
|
||||
static
|
||||
bool RestoreStaticState(FILE* pf);
|
||||
|
||||
|
@ -1054,30 +926,21 @@ public:
|
|||
// constructeur
|
||||
~CBotToken(); // destructeur
|
||||
|
||||
//DllExport
|
||||
int GivType(); // rend le type du token
|
||||
|
||||
//DllExport
|
||||
CBotString& GivString(); // rend la chaine correspondant à ce token
|
||||
|
||||
//DllExport
|
||||
CBotString& GivSep(); // rend le séparateur suivant le token
|
||||
|
||||
//DllExport
|
||||
int GivStart(); // position du début dans le texte
|
||||
//DllExport
|
||||
int GivEnd(); // position de fin dans le texte
|
||||
|
||||
//DllExport
|
||||
CBotToken* GivNext(); // rend le suivant dans la liste
|
||||
//DllExport
|
||||
CBotToken* GivPrev(); // rend le Précédent dans la liste
|
||||
|
||||
//DllExport
|
||||
static
|
||||
CBotToken* CompileTokens(const char* p, int& error);
|
||||
// transforme tout le programme
|
||||
//DllExport
|
||||
static
|
||||
void Delete(CBotToken* pToken); // libère la liste
|
||||
|
||||
|
@ -1198,3 +1061,5 @@ bool rDoGoto( CBotVar* pVar, CBotVar* pResult, int& exception )
|
|||
}
|
||||
|
||||
#endif
|
||||
#endif //_CBOTDLL_H_
|
||||
|
||||
|
|
|
@ -13,7 +13,12 @@
|
|||
// *
|
||||
// * You should have received a copy of the GNU General Public License
|
||||
// * along with this program. If not, see http://www.gnu.org/licenses/.//////////////////////////////////////////////////////////////////////
|
||||
// gestion de la pile (stack)
|
||||
|
||||
/**
|
||||
* \file CBotStack.cpp
|
||||
* \brief Management of the stack
|
||||
*/
|
||||
|
||||
|
||||
#include "CBot.h"
|
||||
#include <cstdlib>
|
||||
|
|
|
@ -13,28 +13,120 @@
|
|||
// *
|
||||
// * You should have received a copy of the GNU General Public License
|
||||
// * along with this program. If not, see http://www.gnu.org/licenses/./////////////////////////////////////////////////////
|
||||
// gestion de chaine
|
||||
// basé sur le CString de MFC
|
||||
// mais moins complet
|
||||
|
||||
//strings management
|
||||
|
||||
#include "CBot.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
/// TODO need to be implemented to be able to load library
|
||||
// HINSTANCE CBotString::m_hInstance = (HINSTANCE)LoadLibrary("libCbot.dll"); // how to retrieve it otherwise ??
|
||||
|
||||
//Map is filled with id-string pars that are needed for CBot language parsing
|
||||
const std::map<EID, const char const *> CBotString::s_keywordString =
|
||||
{
|
||||
{ID_IF, "if"},
|
||||
{ID_ELSE, "else"},
|
||||
{ID_WHILE, "while"},
|
||||
{ID_DO, "do"},
|
||||
{ID_FOR, "for"},
|
||||
{ID_BREAK, "break"},
|
||||
{ID_CONTINUE, "continue"},
|
||||
{ID_SWITCH, "switch"},
|
||||
{ID_CASE, "case"},
|
||||
{ID_DEFAULT, "default"},
|
||||
{ID_TRY, "try"},
|
||||
{ID_THROW, "throw"},
|
||||
{ID_CATCH, "catch"},
|
||||
{ID_FINALLY, "finally"},
|
||||
{ID_TXT_AND, "and"},
|
||||
{ID_TXT_OR, "or"},
|
||||
{ID_TXT_NOT, "not"},
|
||||
{ID_RETURN, "return"},
|
||||
{ID_CLASS, "class"},
|
||||
{ID_EXTENDS, "extends"},
|
||||
{ID_SYNCHO, "synchronized"},
|
||||
{ID_NEW, "new"},
|
||||
{ID_PUBLIC, "public"},
|
||||
{ID_EXTERN, "extern"},
|
||||
{ID_FINAL, "final"},
|
||||
{ID_STATIC, "static"},
|
||||
{ID_PROTECTED, "protected"},
|
||||
{ID_PRIVATE, "private"},
|
||||
{ID_REPEAT, "repeat"},
|
||||
{ID_DEBUGDD, "STARTDEBUGDD"},
|
||||
{ID_INT, "int"},
|
||||
{ID_FLOAT, "float"},
|
||||
{ID_BOOLEAN, "boolean"},
|
||||
{ID_STRING, "string"},
|
||||
{ID_VOID, "void"},
|
||||
{ID_BOOL, "bool"},
|
||||
{ID_TRUE, "true"},
|
||||
{ID_FALSE, "false"},
|
||||
{ID_NULL, "null"},
|
||||
{ID_NAN, "nan"},
|
||||
{ID_OPENPAR, "("},
|
||||
{ID_CLOSEPAR, ")"},
|
||||
{ID_OPBLK, "{"},
|
||||
{ID_CLBLK, "}"},
|
||||
{ID_SEP, "},"},
|
||||
{ID_COMMA, ","},
|
||||
{ID_DOTS, ":"},
|
||||
{ID_DOT, "."},
|
||||
{ID_OPBRK, "["},
|
||||
{ID_CLBRK, "]"},
|
||||
{ID_DBLDOTS, "::"},
|
||||
{ID_LOGIC, "?"},
|
||||
{ID_ADD, "+"},
|
||||
{ID_SUB, "-"},
|
||||
{ID_MUL, "*"},
|
||||
{ID_DIV, "/"},
|
||||
{ID_ASS, "="},
|
||||
{ID_ASSADD, "+="},
|
||||
{ID_ASSSUB, "-="},
|
||||
{ID_ASSMUL, "*="},
|
||||
{ID_ASSDIV, "/="},
|
||||
{ID_ASSOR, "|="},
|
||||
{ID_ASSAND, "&="},
|
||||
{ID_ASSXOR, "^="},
|
||||
{ID_ASSSL, "<<="},
|
||||
{ID_ASSSR, ">>>="},
|
||||
{ID_ASSASR, ">>="},
|
||||
{ID_SL, "<<"},
|
||||
{ID_SR, ">>"},
|
||||
{ID_ASR, ">>"},
|
||||
{ID_INC, "++"},
|
||||
{ID_DEC, "--"},
|
||||
{ID_LO, "<"},
|
||||
{ID_HI, ">"},
|
||||
{ID_LS, "<<"},
|
||||
{ID_HS, ">="},
|
||||
{ID_EQ, "=="},
|
||||
{ID_NE, "!="},
|
||||
{ID_AND, "&"},
|
||||
{ID_XOR, "^"},
|
||||
{ID_OR, "|"},
|
||||
{ID_LOG_AND, "&&"},
|
||||
{ID_LOG_OR, "||"},
|
||||
{ID_LOG_NOT, "!"},
|
||||
{ID_NOT, "~"},
|
||||
{ID_MODULO, "%"},
|
||||
{ID_POWER, "**"},
|
||||
{ID_ASSMODULO, "%="},
|
||||
{TX_UNDEF, "undefined"},
|
||||
{TX_NAN, "not a number"},
|
||||
{ID_SUPER, "super"}
|
||||
};
|
||||
|
||||
CBotString::CBotString()
|
||||
{
|
||||
m_ptr = NULL; // chaine vide
|
||||
m_ptr = NULL;
|
||||
m_lg = 0;
|
||||
}
|
||||
|
||||
CBotString::~CBotString()
|
||||
{
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr); //we can call free on null pointer as it's save
|
||||
}
|
||||
|
||||
|
||||
|
@ -75,70 +167,67 @@ int CBotString::GivLength()
|
|||
|
||||
CBotString CBotString::Left(int nCount) const
|
||||
{
|
||||
char chaine[2000];
|
||||
char chain[2000];
|
||||
|
||||
int i;
|
||||
for (i = 0; i < m_lg && i < nCount && i < 1999; i++)
|
||||
size_t i;
|
||||
for (i = 0; i < m_lg && i < nCount && i < 1999; ++i)
|
||||
{
|
||||
chaine[i] = m_ptr[i];
|
||||
chain[i] = m_ptr[i];
|
||||
}
|
||||
chaine[i] = 0 ;
|
||||
chain[i] = 0 ;
|
||||
|
||||
return CBotString( chaine );
|
||||
return CBotString(chain);
|
||||
}
|
||||
|
||||
CBotString CBotString::Right(int nCount) const
|
||||
{
|
||||
char chaine[2000];
|
||||
char chain[2000];
|
||||
|
||||
int i = m_lg - nCount;
|
||||
if ( i < 0 ) i = 0;
|
||||
|
||||
int j;
|
||||
for ( j = 0 ; i < m_lg && i < 1999; i++)
|
||||
size_t j;
|
||||
for (size_t j = 0 ; i < m_lg && i < 1999; ++i)
|
||||
{
|
||||
chaine[j++] = m_ptr[i];
|
||||
chain[j++] = m_ptr[i];
|
||||
}
|
||||
chaine[j] = 0 ;
|
||||
chain[j] = 0 ;
|
||||
|
||||
return CBotString( chaine );
|
||||
return CBotString(chain);
|
||||
}
|
||||
|
||||
CBotString CBotString::Mid(int nFirst, int nCount) const
|
||||
{
|
||||
char chaine[2000];
|
||||
char chain[2000];
|
||||
|
||||
int i;
|
||||
|
||||
for ( i = nFirst; i < m_lg && i < 1999 && i <= nFirst + nCount; i++)
|
||||
size_t i;
|
||||
for (i = nFirst; i < m_lg && i < 1999 && i <= nFirst + nCount; ++i)
|
||||
{
|
||||
chaine[i] = m_ptr[i];
|
||||
chain[i] = m_ptr[i];
|
||||
}
|
||||
chaine[i] = 0 ;
|
||||
chain[i] = 0 ;
|
||||
|
||||
return CBotString( chaine );
|
||||
return CBotString(chain);
|
||||
}
|
||||
|
||||
CBotString CBotString::Mid(int nFirst) const
|
||||
{
|
||||
char chaine[2000];
|
||||
char chain[2000];
|
||||
|
||||
int i;
|
||||
|
||||
for ( i = nFirst; i < m_lg && i < 1999 ; i++)
|
||||
size_t i;
|
||||
for (i = nFirst; i < m_lg && i < 1999 ; ++i)
|
||||
{
|
||||
chaine[i] = m_ptr[i];
|
||||
chain[i] = m_ptr[i];
|
||||
}
|
||||
chaine[i] = 0 ;
|
||||
chain[i] = 0 ;
|
||||
|
||||
return CBotString( chaine );
|
||||
return CBotString(chain);
|
||||
}
|
||||
|
||||
|
||||
int CBotString::Find(const char c)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < m_lg; i++)
|
||||
for (size_t i = 0; i < m_lg; ++i)
|
||||
{
|
||||
if (m_ptr[i] == c) return i;
|
||||
}
|
||||
|
@ -147,12 +236,11 @@ int CBotString::Find(const char c)
|
|||
|
||||
int CBotString::Find(const char * lpsz)
|
||||
{
|
||||
int i, j;
|
||||
int l = strlen(lpsz);
|
||||
|
||||
for (i = 0; i <= m_lg-l; i++)
|
||||
for (size_t i = 0; i <= m_lg-l; ++i)
|
||||
{
|
||||
for (j = 0; j < l; j++)
|
||||
for (size_t j = 0; j < l; ++j)
|
||||
{
|
||||
if (m_ptr[i+j] != lpsz[j]) goto bad;
|
||||
}
|
||||
|
@ -165,7 +253,7 @@ bad:;
|
|||
int CBotString::ReverseFind(const char c)
|
||||
{
|
||||
int i;
|
||||
for (i = m_lg-1; i >= 0; i--)
|
||||
for (i = m_lg-1; i >= 0; --i)
|
||||
{
|
||||
if (m_ptr[i] == c) return i;
|
||||
}
|
||||
|
@ -177,9 +265,9 @@ int CBotString::ReverseFind(const char * lpsz)
|
|||
int i, j;
|
||||
int l = strlen(lpsz);
|
||||
|
||||
for (i = m_lg-l; i >= 0; i--)
|
||||
for (i = m_lg-l; i >= 0; --i)
|
||||
{
|
||||
for (j = 0; j < l; j++)
|
||||
for (j = 0; j < l; ++j)
|
||||
{
|
||||
if (m_ptr[i+j] != lpsz[j]) goto bad;
|
||||
}
|
||||
|
@ -207,9 +295,7 @@ CBotString CBotString::Mid(int start, int lg)
|
|||
|
||||
void CBotString::MakeUpper()
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < m_lg && i < 1999 ; i++)
|
||||
for (size_t i = 0; i < m_lg && i < 1999 ; ++i)
|
||||
{
|
||||
char c = m_ptr[i];
|
||||
if ( c >= 'a' && c <= 'z' ) m_ptr[i] = c - 'a' + 'A';
|
||||
|
@ -218,32 +304,25 @@ void CBotString::MakeUpper()
|
|||
|
||||
void CBotString::MakeLower()
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < m_lg && i < 1999 ; i++)
|
||||
for (size_t i = 0; i < m_lg && i < 1999 ; ++i)
|
||||
{
|
||||
char c = m_ptr[i];
|
||||
if ( c >= 'A' && c <= 'Z' ) m_ptr[i] = c - 'A' + 'a';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define MAXSTRING 256
|
||||
|
||||
bool CBotString::LoadString(unsigned int id)
|
||||
{
|
||||
char buffer[MAXSTRING];
|
||||
/// \TODO implement loading strings from resources. Figure out how to do it
|
||||
// m_lg = ::LoadString( m_hInstance, id, buffer, MAXSTRING );
|
||||
|
||||
const char * str = NULL;
|
||||
str = MapIdToString((EID)id);
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
|
||||
m_lg = strlen(str);
|
||||
m_ptr = NULL;
|
||||
if (m_lg > 0)
|
||||
{
|
||||
m_ptr = (char*)malloc(m_lg+1);
|
||||
strcpy(m_ptr, buffer);
|
||||
strcpy(m_ptr, str);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -252,10 +331,10 @@ bool CBotString::LoadString(unsigned int id)
|
|||
|
||||
const CBotString& CBotString::operator=(const CBotString& stringSrc)
|
||||
{
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
m_ptr = NULL;
|
||||
|
||||
m_lg = stringSrc.m_lg;
|
||||
m_ptr = NULL;
|
||||
|
||||
if (m_lg > 0)
|
||||
{
|
||||
|
@ -281,7 +360,7 @@ const CBotString& CBotString::operator+(const CBotString& stringSrc)
|
|||
char* pp = p + m_lg;
|
||||
strcpy(pp, stringSrc.m_ptr);
|
||||
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
m_ptr = p;
|
||||
m_lg += stringSrc.m_lg;
|
||||
|
||||
|
@ -290,7 +369,7 @@ const CBotString& CBotString::operator+(const CBotString& stringSrc)
|
|||
|
||||
const CBotString& CBotString::operator=(const char ch)
|
||||
{
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
|
||||
m_lg = 1;
|
||||
|
||||
|
@ -303,7 +382,7 @@ const CBotString& CBotString::operator=(const char ch)
|
|||
|
||||
const CBotString& CBotString::operator=(const char* pString)
|
||||
{
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
m_ptr = NULL;
|
||||
|
||||
if (pString != NULL)
|
||||
|
@ -329,7 +408,7 @@ const CBotString& CBotString::operator+=(const char ch)
|
|||
p[m_lg++] = ch;
|
||||
p[m_lg] = 0;
|
||||
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
|
||||
m_ptr = p;
|
||||
|
||||
|
@ -346,7 +425,7 @@ const CBotString& CBotString::operator+=(const CBotString& str)
|
|||
|
||||
m_lg = m_lg + str.m_lg;
|
||||
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
|
||||
m_ptr = p;
|
||||
|
||||
|
@ -420,7 +499,7 @@ bool CBotString::IsEmpty() const
|
|||
|
||||
void CBotString::Empty()
|
||||
{
|
||||
if (m_ptr != NULL) free(m_ptr);
|
||||
free(m_ptr);
|
||||
m_ptr = NULL;
|
||||
m_lg = 0;
|
||||
}
|
||||
|
@ -442,10 +521,20 @@ int CBotString::Compare(const char * lpsz) const
|
|||
return strcmp(p, lpsz); // wcscmp
|
||||
}
|
||||
|
||||
|
||||
const char * CBotString::MapIdToString(EID id)
|
||||
{
|
||||
if (s_keywordString.find(id) != s_keywordString.end())
|
||||
{
|
||||
return s_keywordString.at(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return emptyString;
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// tableaux de chaines
|
||||
// arrays of strings
|
||||
|
||||
CBotStringArray::CBotStringArray()
|
||||
{
|
||||
|
@ -455,7 +544,7 @@ CBotStringArray::CBotStringArray()
|
|||
|
||||
CBotStringArray::~CBotStringArray()
|
||||
{
|
||||
SetSize(0); // détruit les données !
|
||||
SetSize(0); // destroys data !
|
||||
}
|
||||
|
||||
|
||||
|
@ -471,9 +560,8 @@ void CBotStringArray::Add(const CBotString& str)
|
|||
m_pData[m_nSize-1] = str;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// routines utilitaires
|
||||
// utility routines
|
||||
|
||||
static inline void ConstructElement(CBotString* pNewData)
|
||||
{
|
||||
|
@ -520,7 +608,7 @@ static void CopyElements(CBotString* pDest, CBotString* pSrc, int nCount)
|
|||
|
||||
|
||||
|
||||
// sélect la taille du tableau
|
||||
// set the array size
|
||||
|
||||
void CBotStringArray::SetSize(int nNewSize)
|
||||
{
|
||||
|
@ -582,7 +670,7 @@ void CBotStringArray::SetSize(int nNewSize)
|
|||
ConstructElements(&pNewData[m_nSize], nNewSize-m_nSize);
|
||||
|
||||
|
||||
// Ret rid of old stuff (note: no destructors called)
|
||||
// Get rid of old stuff (note: no destructors called)
|
||||
delete[] (unsigned char *)m_pData;
|
||||
m_pData = pNewData;
|
||||
m_nSize = nNewSize;
|
||||
|
@ -601,5 +689,3 @@ CBotString& CBotStringArray::ElementAt(int nIndex)
|
|||
return m_pData[nIndex];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -464,6 +464,7 @@ bool CBotToken::GivKeyDefNum(const char* w, CBotToken* &token)
|
|||
|
||||
// reprend la liste des mots clefs dans les ressources
|
||||
|
||||
/// \todo Fixme Figure out how this should work.
|
||||
void CBotToken::LoadKeyWords()
|
||||
{
|
||||
CBotString s;
|
||||
|
|
|
@ -10,7 +10,6 @@ CBotToken.cpp
|
|||
CBotTwoOpExpr.cpp
|
||||
CBotVar.cpp
|
||||
CBotWhile.cpp
|
||||
CBot.rc
|
||||
)
|
||||
|
||||
add_library(CBot SHARED ${SOURCES})
|
||||
|
|
|
@ -15,98 +15,105 @@
|
|||
// * along with this program. If not, see http://www.gnu.org/licenses/.//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by CBot.rc
|
||||
//
|
||||
#define ID_KEYWORDS 2000
|
||||
#define ID_IF 2000
|
||||
#define ID_ELSE 2001
|
||||
#define ID_WHILE 2002
|
||||
#define ID_DO 2003
|
||||
#define ID_FOR 2004
|
||||
#define ID_BREAK 2005
|
||||
#define ID_CONTINUE 2006
|
||||
#define ID_SWITCH 2007
|
||||
#define ID_CASE 2008
|
||||
#define ID_DEFAULT 2009
|
||||
#define ID_TRY 2010
|
||||
#define ID_THROW 2011
|
||||
#define ID_CATCH 2012
|
||||
#define ID_FINALLY 2013
|
||||
#define ID_TXT_AND 2014
|
||||
#define ID_TXT_OR 2015
|
||||
#define ID_TXT_NOT 2016
|
||||
#define ID_RETURN 2017
|
||||
#define ID_CLASS 2018
|
||||
#define ID_EXTENDS 2019
|
||||
#define ID_SYNCHO 2020
|
||||
#define ID_NEW 2021
|
||||
#define ID_PUBLIC 2022
|
||||
#define ID_EXTERN 2023
|
||||
#define ID_FINAL 2024
|
||||
#define ID_STATIC 2025
|
||||
#define ID_PROTECTED 2026
|
||||
#define ID_PRIVATE 2027
|
||||
#define ID_REPEAT 2028
|
||||
#define ID_DEBUGDD 2099
|
||||
#define ID_INT 2100
|
||||
#define ID_FLOAT 2101
|
||||
#define ID_BOOLEAN 2102
|
||||
#define ID_STRING 2103
|
||||
#define ID_VOID 2104
|
||||
#define ID_BOOL 2105
|
||||
#define ID_TRUE 2200
|
||||
#define ID_FALSE 2201
|
||||
#define ID_NULL 2202
|
||||
#define ID_NAN 2203
|
||||
#define ID_OPENPAR 2300
|
||||
#define ID_CLOSEPAR 2301
|
||||
#define ID_OPBLK 2302
|
||||
#define ID_CLBLK 2303
|
||||
#define ID_SEP 2304
|
||||
#define ID_COMMA 2305
|
||||
#define ID_DOTS 2306
|
||||
#define ID_DOT 2307
|
||||
#define ID_OPBRK 2308
|
||||
#define ID_CLBRK 2309
|
||||
#define ID_DBLDOTS 2310
|
||||
#define ID_LOGIC 2311
|
||||
#define ID_ADD 2312
|
||||
#define ID_SUB 2313
|
||||
#define ID_MUL 2314
|
||||
#define ID_DIV 2315
|
||||
#define ID_ASS 2316
|
||||
#define ID_ASSADD 2317
|
||||
#define ID_ASSSUB 2318
|
||||
#define ID_ASSMUL 2319
|
||||
#define ID_ASSDIV 2320
|
||||
#define ID_ASSOR 2321
|
||||
#define ID_ASSAND 2322
|
||||
#define ID_ASSXOR 2323
|
||||
#define ID_ASSSL 2324
|
||||
#define ID_ASSSR 2325
|
||||
#define ID_ASSASR 2326
|
||||
#define ID_SL 2327
|
||||
#define ID_SR 2328
|
||||
#define ID_ASR 2329
|
||||
#define ID_INC 2330
|
||||
#define ID_DEC 2331
|
||||
#define ID_LO 2332
|
||||
#define ID_HI 2333
|
||||
#define ID_LS 2334
|
||||
#define ID_HS 2335
|
||||
#define ID_EQ 2336
|
||||
#define ID_NE 2337
|
||||
#define ID_AND 2338
|
||||
#define ID_XOR 2339
|
||||
#define ID_OR 2340
|
||||
#define ID_LOG_AND 2341
|
||||
#define ID_LOG_OR 2342
|
||||
#define ID_LOG_NOT 2343
|
||||
#define ID_NOT 2344
|
||||
#define ID_MODULO 2345
|
||||
#define ID_POWER 2346
|
||||
#define ID_ASSMODULO 2347
|
||||
#define TX_UNDEF 4000
|
||||
#define TX_NAN 4001
|
||||
#ifndef _RESOURCE_H_
|
||||
#define _RESOURCE_H_
|
||||
|
||||
enum EID
|
||||
{
|
||||
ID_IF = 2000,
|
||||
ID_ELSE,
|
||||
ID_WHILE,
|
||||
ID_DO,
|
||||
ID_FOR,
|
||||
ID_BREAK,
|
||||
ID_CONTINUE,
|
||||
ID_SWITCH,
|
||||
ID_CASE,
|
||||
ID_DEFAULT,
|
||||
ID_TRY,
|
||||
ID_THROW,
|
||||
ID_CATCH,
|
||||
ID_FINALLY,
|
||||
ID_TXT_AND,
|
||||
ID_TXT_OR,
|
||||
ID_TXT_NOT,
|
||||
ID_RETURN,
|
||||
ID_CLASS,
|
||||
ID_EXTENDS,
|
||||
ID_SYNCHO,
|
||||
ID_NEW,
|
||||
ID_PUBLIC,
|
||||
ID_EXTERN,
|
||||
ID_FINAL,
|
||||
ID_STATIC,
|
||||
ID_PROTECTED,
|
||||
ID_PRIVATE,
|
||||
ID_REPEAT,
|
||||
ID_DEBUGDD,
|
||||
ID_INT,
|
||||
ID_FLOAT,
|
||||
ID_BOOLEAN,
|
||||
ID_STRING,
|
||||
ID_VOID,
|
||||
ID_BOOL,
|
||||
|
||||
ID_TRUE = 2200,
|
||||
ID_FALSE,
|
||||
ID_NULL,
|
||||
ID_NAN,
|
||||
|
||||
ID_OPENPAR = 2300,
|
||||
ID_CLOSEPAR,
|
||||
ID_OPBLK,
|
||||
ID_CLBLK,
|
||||
ID_SEP,
|
||||
ID_COMMA,
|
||||
ID_DOTS,
|
||||
ID_DOT,
|
||||
ID_OPBRK,
|
||||
ID_CLBRK,
|
||||
ID_DBLDOTS,
|
||||
ID_LOGIC,
|
||||
ID_ADD,
|
||||
ID_SUB,
|
||||
ID_MUL,
|
||||
ID_DIV,
|
||||
ID_ASS,
|
||||
ID_ASSADD,
|
||||
ID_ASSSUB,
|
||||
ID_ASSMUL,
|
||||
ID_ASSDIV,
|
||||
ID_ASSOR,
|
||||
ID_ASSAND,
|
||||
ID_ASSXOR,
|
||||
ID_ASSSL,
|
||||
ID_ASSSR,
|
||||
ID_ASSASR,
|
||||
ID_SL,
|
||||
ID_SR,
|
||||
ID_ASR,
|
||||
ID_INC,
|
||||
ID_DEC,
|
||||
ID_LO,
|
||||
ID_HI,
|
||||
ID_LS,
|
||||
ID_HS,
|
||||
ID_EQ,
|
||||
ID_NE,
|
||||
ID_AND,
|
||||
ID_XOR,
|
||||
ID_OR,
|
||||
ID_LOG_AND,
|
||||
ID_LOG_OR,
|
||||
ID_LOG_NOT,
|
||||
ID_NOT,
|
||||
ID_MODULO,
|
||||
ID_POWER,
|
||||
ID_ASSMODULO,
|
||||
TX_UNDEF = 4000,
|
||||
TX_NAN,
|
||||
ID_SUPER = 6000
|
||||
};
|
||||
#define TX_OPENPAR 5000
|
||||
#define TX_CLOSEPAR 5001
|
||||
#define TX_NOTBOOL 5002
|
||||
|
@ -166,15 +173,6 @@
|
|||
#define TX_NOTOPEN 6013
|
||||
#define TX_ERRREAD 6014
|
||||
#define TX_ERRWRITE 6015
|
||||
#define ID_SUPER 62020
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
#endif //_RESOURCE_H_
|
||||
|
||||
|
|
Loading…
Reference in New Issue