Colobot
CBotEnums.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
20 #pragma once
21 
27 namespace CBot
28 {
29 
36 {
41  CBotTypInt = 4,
47 
50 
53  CBotTypClass = 15,
55 
56  CBotTypMAX = 20
57 };
58 
62 enum CBotGet
63 {
64  GetPosExtern = 1,
65  GetPosNom = 2,
66  GetPosParam = 3,
67  GetPosBloc = 4
68 };
69 
73 enum TokenId
74 {
75  TokenKeyWord = 2000,
76  ID_IF = 2000,
77  ID_ELSE,
78  ID_WHILE,
79  ID_DO,
80  ID_FOR,
81  ID_BREAK,
82  ID_CONTINUE,
83  ID_SWITCH,
84  ID_CASE,
85  ID_DEFAULT,
86  ID_TRY,
87  ID_THROW,
88  ID_CATCH,
89  ID_FINALLY,
90  ID_TXT_AND,
91  ID_TXT_OR,
92  ID_TXT_NOT,
93  ID_RETURN,
94  ID_CLASS,
95  ID_EXTENDS,
96  ID_SYNCHO,
97  ID_NEW,
98  ID_PUBLIC,
99  ID_EXTERN,
100  ID_STATIC,
101  ID_PROTECTED,
102  ID_PRIVATE,
103  ID_INT,
104  ID_FLOAT,
105  ID_BOOLEAN,
106  ID_STRING,
107  ID_VOID,
108  ID_BOOL,
109 
110  TokenKeyVal = 2200,
111  ID_TRUE = 2200,
112  ID_FALSE,
113  ID_NULL,
114  ID_NAN,
115 
116  TokenKeyOp = 2300,
117  ID_OPENPAR = 2300,
118  ID_CLOSEPAR,
119  ID_OPBLK,
120  ID_CLBLK,
121  ID_SEP,
122  ID_COMMA,
123  ID_DOTS,
124  ID_DOT,
125  ID_OPBRK,
126  ID_CLBRK,
127  ID_DBLDOTS,
128  ID_LOGIC,
129  ID_ADD,
130  ID_SUB,
131  ID_MUL,
132  ID_DIV,
133  ID_ASS,
134  ID_ASSADD,
135  ID_ASSSUB,
136  ID_ASSMUL,
137  ID_ASSDIV,
138  ID_ASSOR,
139  ID_ASSAND,
140  ID_ASSXOR,
141  ID_ASSSL,
142  ID_ASSSR,
143  ID_ASSASR,
144  ID_SL,
145  ID_SR,
146  ID_ASR,
147  ID_INC,
148  ID_DEC,
149  ID_LO,
150  ID_HI,
151  ID_LS,
152  ID_HS,
153  ID_EQ,
154  ID_NE,
155  ID_AND,
156  ID_XOR,
157  ID_OR,
158  ID_LOG_AND,
159  ID_LOG_OR,
160  ID_LOG_NOT,
161  ID_NOT,
162  ID_MODULO,
163  ID_POWER,
164  ID_ASSMODULO,
165 
166  TX_UNDEF = 4000,
167  TX_NAN
168 };
169 
174 {
175  TokenTypNone = 0,
181 };
182 
190 enum CBotError : int
191 {
192  CBotNoErr = 0,
193 
194  // Compile errors
195  CBotErrOpenPar = 5000,
199  CBotErrBadLeft = 5004,
201  CBotErrCaseOut = 5006,
202  CBotErrNoEnd = 5007,
211  CBotErrNoWhile = 5016,
214  CBotErrLabel = 5018,
215  CBotErrNoCase = 5020,
216  CBotErrBadNum = 5021,
217  CBotErrVoid = 5022,
218  CBotErrNoType = 5023,
219  CBotErrNoVar = 5024,
220  CBotErrNoFunc = 5025,
225  CBotErrNbParam = 5030,
232  CBotErrBadNew = 5037,
236  CBotErrPrivate = 5041,
239 
240  // Runtime errors
241  CBotErrZeroDiv = 6000,
242  CBotErrNotInit = 6001,
245  CBotErrNoRun = 6004,
248  CBotErrNull = 6007,
249  CBotErrNan = 6008,
254  CBotErrNotOpen = 6013,
255  CBotErrRead = 6014,
256  CBotErrWrite = 6015,
257 
259 };
260 
261 } // namespace CBot
wrong number of parameters
Definition: CBotEnums.h:225
this class does not exist
Definition: CBotEnums.h:247
uninitialized variable
Definition: CBotEnums.h:242
index out of array
Definition: CBotEnums.h:250
missing word "public"
Definition: CBotEnums.h:237
semicolon expected
Definition: CBotEnums.h:200
variable is not a class
Definition: CBotEnums.h:227
element does not exist in the class
Definition: CBotEnums.h:226
channel not open
Definition: CBotEnums.h:254
double (NOT IMPLEMENTED)
Definition: CBotEnums.h:44
" ] " expected
Definition: CBotEnums.h:230
keywords that represent values (true, false, null, nan)
Definition: CBotEnums.h:110
missing " { "
Definition: CBotEnums.h:205
calling a function that no longer exists
Definition: CBotEnums.h:246
pointer to an object destroyed
Definition: CBotEnums.h:252
char (NOT IMPLEMENTED)
Definition: CBotEnums.h:40
this function already exists
Definition: CBotEnums.h:222
variable name expected
Definition: CBotEnums.h:219
short (NOT IMPLEMENTED)
Definition: CBotEnums.h:39
value according DefineNum
Definition: CBotEnums.h:180
Pointer to a class (CBotTypClass or CBotTypIntrinsic)
Definition: CBotEnums.h:51
missing the opening parenthesis
Definition: CBotEnums.h:195
Run() without active function.
Definition: CBotEnums.h:245
Null pointer.
Definition: CBotEnums.h:52
redefinition of the variable
Definition: CBotEnums.h:207
wrong types of parameters
Definition: CBotEnums.h:224
reserved word (for a DefineNum)
Definition: CBotEnums.h:231
expression expected after =
Definition: CBotEnums.h:238
missing " } "
Definition: CBotEnums.h:203
else without matching if
Definition: CBotEnums.h:204
Max errors.
Definition: CBotEnums.h:258
long (NOT IMPLEMENTED)
Definition: CBotEnums.h:42
expected function name
Definition: CBotEnums.h:220
" [ " expected
Definition: CBotEnums.h:233
" : " expected
Definition: CBotEnums.h:210
void
Definition: CBotEnums.h:37
Intrinsic class instance.
Definition: CBotEnums.h:54
wrong type for the assignment
Definition: CBotEnums.h:206
operators
Definition: CBotEnums.h:116
calculation with a NAN
Definition: CBotEnums.h:249
instructions after final closing brace
Definition: CBotEnums.h:202
CBotError
This enum contains possible CBot error values. Values in range 5000-5999 are compile errors...
Definition: CBotEnums.h:190
expected string
Definition: CBotEnums.h:234
TokenId
This enum contains possible token types.
Definition: CBotEnums.h:73
stack overflow
Definition: CBotEnums.h:251
cannot open the file
Definition: CBotEnums.h:253
int
Definition: CBotEnums.h:41
label udnefined
Definition: CBotEnums.h:213
protected item
Definition: CBotEnums.h:236
byte (NOT IMPLEMENTED)
Definition: CBotEnums.h:38
assignment impossible ( 5 = ... )
Definition: CBotEnums.h:199
undeclared variable
Definition: CBotEnums.h:198
error while reading
Definition: CBotEnums.h:255
too many parameters
Definition: CBotEnums.h:221
not enough parameters
Definition: CBotEnums.h:223
float
Definition: CBotEnums.h:43
break outside of a loop
Definition: CBotEnums.h:212
writing error
Definition: CBotEnums.h:256
keywords
Definition: CBotEnums.h:75
missing " case "
Definition: CBotEnums.h:215
CBotType
Defines known types. This types are modeled on Java types.
Definition: CBotEnums.h:35
class already exists
Definition: CBotEnums.h:229
division by zero
Definition: CBotEnums.h:241
routine undefined
Definition: CBotEnums.h:209
null pointer
Definition: CBotEnums.h:248
label ne peut se mettre ici (label can not get here)
Definition: CBotEnums.h:214
Two operands are incompatible.
Definition: CBotEnums.h:208
wrong index type "[ false ]"
Definition: CBotEnums.h:235
function did not return results
Definition: CBotEnums.h:244
expression must be a boolean
Definition: CBotEnums.h:197
TokenType
Types of tokens.
Definition: CBotEnums.h:173
" void " not possible here
Definition: CBotEnums.h:217
Array.
Definition: CBotEnums.h:49
CBotGet
Different modes for CBotProgram::GetPosition.
Definition: CBotEnums.h:62
string
Definition: CBotEnums.h:46
expected number
Definition: CBotEnums.h:216
"while" expected (in do..while)
Definition: CBotEnums.h:211
type declaration expected
Definition: CBotEnums.h:218
missing the closing parenthesis
Definition: CBotEnums.h:196
Pointer to an array (CBotTypArrayBody)
Definition: CBotEnums.h:48
Class instance.
Definition: CBotEnums.h:53
CBot engine.
Definition: CBotCallMethode.cpp:28
throw a negative value
Definition: CBotEnums.h:243
a variable name
Definition: CBotEnums.h:179
number
Definition: CBotEnums.h:177
bool
Definition: CBotEnums.h:45
wrong setting for new
Definition: CBotEnums.h:232
case outside a switch
Definition: CBotEnums.h:201
keyword of the language (see TokenKeyWord)
Definition: CBotEnums.h:176
no appropriate constructor
Definition: CBotEnums.h:228
string
Definition: CBotEnums.h:178