summaryrefslogtreecommitdiffstats
path: root/src/cbottoken.cpp
blob: db07edfa658acdf1daacf4c4cb70a6764a5b2303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
// cbottoken.cpp

#define STRICT
#define D3D_OVERLOADS

#include <windows.h>
#include <stdio.h>
#include <d3d.h>

#include "struct.h"
#include "D3DEngine.h"
#include "D3DMath.h"
#include "language.h"
#include "global.h"
#include "event.h"
#include "object.h"
#include "cbottoken.h"




// Cherche le nom d'un objet.

char* RetObjectName(ObjectType type)
{
	if ( type == OBJECT_PORTICO     )  return "Portico";
	if ( type == OBJECT_BASE        )  return "SpaceShip";
	if ( type == OBJECT_DERRICK     )  return "Derrick";
	if ( type == OBJECT_FACTORY     )  return "BotFactory";
	if ( type == OBJECT_STATION     )  return "PowerStation";
	if ( type == OBJECT_CONVERT     )  return "Converter";
	if ( type == OBJECT_REPAIR      )  return "RepairCenter";
	if ( type == OBJECT_DESTROYER   )  return "Destroyer";
	if ( type == OBJECT_TOWER       )  return "DefenseTower";
	if ( type == OBJECT_NEST        )  return "AlienNest";
	if ( type == OBJECT_RESEARCH    )  return "ResearchCenter";
	if ( type == OBJECT_RADAR       )  return "RadarStation";
	if ( type == OBJECT_INFO        )  return "ExchangePost";
	if ( type == OBJECT_ENERGY      )  return "PowerPlant";
	if ( type == OBJECT_LABO        )  return "AutoLab";
	if ( type == OBJECT_NUCLEAR     )  return "NuclearPlant";
	if ( type == OBJECT_PARA        )  return "PowerCaptor";
	if ( type == OBJECT_SAFE        )  return "Vault";
	if ( type == OBJECT_HUSTON      )  return "Houston";
	if ( type == OBJECT_TARGET1     )  return "Target1";
	if ( type == OBJECT_TARGET2     )  return "Target2";
	if ( type == OBJECT_START       )  return "StartArea";
	if ( type == OBJECT_END         )  return "GoalArea";
	if ( type == OBJECT_TEEN34      )  return "Stone";
	if ( type == OBJECT_STONE       )  return "TitaniumOre";
	if ( type == OBJECT_URANIUM     )  return "UraniumOre";
	if ( type == OBJECT_METAL       )  return "Titanium";
	if ( type == OBJECT_POWER       )  return "PowerCell";
	if ( type == OBJECT_ATOMIC      )  return "NuclearCell";
	if ( type == OBJECT_BULLET      )  return "OrgaMatter";
	if ( type == OBJECT_BBOX        )  return "BlackBox";
	if ( type == OBJECT_KEYa        )  return "KeyA";
	if ( type == OBJECT_KEYb        )  return "KeyB";
	if ( type == OBJECT_KEYc        )  return "KeyC";
	if ( type == OBJECT_KEYd        )  return "KeyD";
	if ( type == OBJECT_TNT         )  return "TNT";
	if ( type == OBJECT_SCRAP1      )  return "Scrap";
	if ( type == OBJECT_BOMB        )  return "Mine";
	if ( type == OBJECT_BARRIER1    )  return "Barrier";
	if ( type == OBJECT_WAYPOINT    )  return "WayPoint";
	if ( type == OBJECT_FLAGb       )  return "BlueFlag";
	if ( type == OBJECT_FLAGr       )  return "RedFlag";
	if ( type == OBJECT_FLAGg       )  return "GreenFlag";
	if ( type == OBJECT_FLAGy       )  return "YellowFlag";
	if ( type == OBJECT_FLAGv       )  return "VioletFlag";
	if ( type == OBJECT_MARKPOWER   )  return "PowerSpot";
	if ( type == OBJECT_MARKSTONE   )  return "TitaniumSpot";
	if ( type == OBJECT_MARKURANIUM )  return "UraniumSpot";
	if ( type == OBJECT_MARKKEYa    )  return "KeyASpot";
	if ( type == OBJECT_MARKKEYb    )  return "KeyBSpot";
	if ( type == OBJECT_MARKKEYc    )  return "KeyCSpot";
	if ( type == OBJECT_MARKKEYd    )  return "KeyDSpot";
	if ( type == OBJECT_MOBILEwt    )  return "PracticeBot";
	if ( type == OBJECT_MOBILEwa    )  return "WheeledGrabber";
	if ( type == OBJECT_MOBILEta    )  return "TrackedGrabber";
	if ( type == OBJECT_MOBILEfa    )  return "WingedGrabber";
	if ( type == OBJECT_MOBILEia    )  return "LeggedGrabber";
	if ( type == OBJECT_MOBILEwc    )  return "WheeledShooter";
	if ( type == OBJECT_MOBILEtc    )  return "TrackedShooter";
	if ( type == OBJECT_MOBILEfc    )  return "WingedShooter";
	if ( type == OBJECT_MOBILEic    )  return "LeggedShooter";
	if ( type == OBJECT_MOBILEwi    )  return "WheeledOrgaShooter";
	if ( type == OBJECT_MOBILEti    )  return "TrackedOrgaShooter";
	if ( type == OBJECT_MOBILEfi    )  return "WingedOrgaShooter";
	if ( type == OBJECT_MOBILEii    )  return "LeggedOrgaShooter";
	if ( type == OBJECT_MOBILEws    )  return "WheeledSniffer";
	if ( type == OBJECT_MOBILEts    )  return "TrackedSniffer";
	if ( type == OBJECT_MOBILEfs    )  return "WingedSniffer";
	if ( type == OBJECT_MOBILEis    )  return "LeggedSniffer";
	if ( type == OBJECT_MOBILErt    )  return "Thumper";
	if ( type == OBJECT_MOBILErc    )  return "PhazerShooter";
	if ( type == OBJECT_MOBILErr    )  return "Recycler";
	if ( type == OBJECT_MOBILErs    )  return "Shielder";
	if ( type == OBJECT_MOBILEsa    )  return "Subber";
	if ( type == OBJECT_MOBILEtg    )  return "TargetBot";
	if ( type == OBJECT_MOBILEdr    )  return "Scribbler";
	if ( type == OBJECT_HUMAN       )  return "Me";
	if ( type == OBJECT_TECH        )  return "Tech";
	if ( type == OBJECT_MOTHER      )  return "AlienQueen";
	if ( type == OBJECT_EGG         )  return "AlienEgg";
	if ( type == OBJECT_ANT         )  return "AlienAnt";
	if ( type == OBJECT_SPIDER      )  return "AlienSpider";
	if ( type == OBJECT_BEE         )  return "AlienWasp";
	if ( type == OBJECT_WORM        )  return "AlienWorm";
	if ( type == OBJECT_RUINmobilew1)  return "Wreck";
	return "";
}

// Cherche le nom secondaire d'un objet.
// (� cause d'Otto qui pense que les allemands n'aiment pas le nucl�aire)

char* RetObjectAlias(ObjectType type)
{
	if ( type == OBJECT_NUCLEAR     )  return "FuelCellPlant";
	if ( type == OBJECT_URANIUM     )  return "PlatinumOre";
	if ( type == OBJECT_ATOMIC      )  return "FuelCell";
	if ( type == OBJECT_MARKURANIUM )  return "PlatinumSpot";
	if ( type == OBJECT_ENERGY      )  return "Disintegrator";  // pour CeeBot-K
	return "";
}


// Retourne le fichier d'aide � utiliser pour l'objet.

char* RetHelpFilename(ObjectType type)
{
	if ( type == OBJECT_BASE        )  return "help\\object\\base.txt";
	if ( type == OBJECT_DERRICK     )  return "help\\object\\derrick.txt";
	if ( type == OBJECT_FACTORY     )  return "help\\object\\factory.txt";
	if ( type == OBJECT_STATION     )  return "help\\object\\station.txt";
	if ( type == OBJECT_CONVERT     )  return "help\\object\\convert.txt";
	if ( type == OBJECT_REPAIR      )  return "help\\object\\repair.txt";
	if ( type == OBJECT_DESTROYER   )  return "help\\object\\destroy.txt";
	if ( type == OBJECT_TOWER       )  return "help\\object\\tower.txt";
	if ( type == OBJECT_NEST        )  return "help\\object\\nest.txt";
	if ( type == OBJECT_RESEARCH    )  return "help\\object\\research.txt";
	if ( type == OBJECT_RADAR       )  return "help\\object\\radar.txt";
	if ( type == OBJECT_INFO        )  return "help\\object\\exchange.txt";
	if ( type == OBJECT_ENERGY      )  return "help\\object\\energy.txt";
	if ( type == OBJECT_LABO        )  return "help\\object\\labo.txt";
	if ( type == OBJECT_NUCLEAR     )  return "help\\object\\nuclear.txt";
	if ( type == OBJECT_PARA        )  return "help\\object\\captor.txt";
	if ( type == OBJECT_SAFE        )  return "help\\object\\safe.txt";
	if ( type == OBJECT_HUSTON      )  return "help\\object\\huston.txt";
	if ( type == OBJECT_START       )  return "help\\object\\start.txt";
	if ( type == OBJECT_END         )  return "help\\object\\goal.txt";
	if ( type == OBJECT_STONE       )  return "help\\object\\titanore.txt";
	if ( type == OBJECT_URANIUM     )  return "help\\object\\uranore.txt";
	if ( type == OBJECT_METAL       )  return "help\\object\\titan.txt";
	if ( type == OBJECT_POWER       )  return "help\\object\\power.txt";
	if ( type == OBJECT_ATOMIC      )  return "help\\object\\atomic.txt";
	if ( type == OBJECT_BULLET      )  return "help\\object\\bullet.txt";
	if ( type == OBJECT_BBOX        )  return "help\\object\\bbox.txt";
	if ( type == OBJECT_KEYa        )  return "help\\object\\key.txt";
	if ( type == OBJECT_KEYb        )  return "help\\object\\key.txt";
	if ( type == OBJECT_KEYc        )  return "help\\object\\key.txt";
	if ( type == OBJECT_KEYd        )  return "help\\object\\key.txt";
	if ( type == OBJECT_TNT         )  return "help\\object\\tnt.txt";
	if ( type == OBJECT_SCRAP1      )  return "help\\object\\scrap.txt";
	if ( type == OBJECT_BOMB        )  return "help\\object\\mine.txt";
	if ( type == OBJECT_BARRIER1    )  return "help\\object\\barrier.txt";
	if ( type == OBJECT_WAYPOINT    )  return "help\\object\\waypoint.txt";
	if ( type == OBJECT_FLAGb       )  return "help\\object\\flag.txt";
	if ( type == OBJECT_FLAGr       )  return "help\\object\\flag.txt";
	if ( type == OBJECT_FLAGg       )  return "help\\object\\flag.txt";
	if ( type == OBJECT_FLAGy       )  return "help\\object\\flag.txt";
	if ( type == OBJECT_FLAGv       )  return "help\\object\\flag.txt";
	if ( type == OBJECT_MARKPOWER   )  return "help\\object\\enerspot.txt";
	if ( type == OBJECT_MARKSTONE   )  return "help\\object\\stonspot.txt";
	if ( type == OBJECT_MARKURANIUM )  return "help\\object\\uranspot.txt";
	if ( type == OBJECT_MOBILEwa    )  return "help\\object\\botgr.txt";
	if ( type == OBJECT_MOBILEta    )  return "help\\object\\botgc.txt";
	if ( type == OBJECT_MOBILEfa    )  return "help\\object\\botgj.txt";
	if ( type == OBJECT_MOBILEia    )  return "help\\object\\botgs.txt";
	if ( type == OBJECT_MOBILEws    )  return "help\\object\\botsr.txt";
	if ( type == OBJECT_MOBILEts    )  return "help\\object\\botsc.txt";
	if ( type == OBJECT_MOBILEfs    )  return "help\\object\\botsj.txt";
	if ( type == OBJECT_MOBILEis    )  return "help\\object\\botss.txt";
	if ( type == OBJECT_MOBILEwi    )  return "help\\object\\botor.txt";
	if ( type == OBJECT_MOBILEti    )  return "help\\object\\botoc.txt";
	if ( type == OBJECT_MOBILEfi    )  return "help\\object\\botoj.txt";
	if ( type == OBJECT_MOBILEii    )  return "help\\object\\botos.txt";
	if ( type == OBJECT_MOBILEwc    )  return "help\\object\\botfr.txt";
	if ( type == OBJECT_MOBILEtc    )  return "help\\object\\botfc.txt";
	if ( type == OBJECT_MOBILEfc    )  return "help\\object\\botfj.txt";
	if ( type == OBJECT_MOBILEic    )  return "help\\object\\botfs.txt";
	if ( type == OBJECT_MOBILErt    )  return "help\\object\\bottump.txt";
	if ( type == OBJECT_MOBILErc    )  return "help\\object\\botphaz.txt";
	if ( type == OBJECT_MOBILErr    )  return "help\\object\\botrecy.txt";
	if ( type == OBJECT_MOBILErs    )  return "help\\object\\botshld.txt";
	if ( type == OBJECT_MOBILEsa    )  return "help\\object\\botsub.txt";
	if ( type == OBJECT_MOBILEwt    )  return "help\\object\\bottr.txt";
	if ( type == OBJECT_MOBILEtg    )  return "help\\object\\bottarg.txt";
	if ( type == OBJECT_MOBILEdr    )  return "help\\object\\botdraw.txt";
	if ( type == OBJECT_APOLLO2     )  return "help\\object\\lrv.txt";
	if ( type == OBJECT_HUMAN       )  return "help\\object\\human.txt";
	if ( type == OBJECT_MOTHER      )  return "help\\object\\mother.txt";
	if ( type == OBJECT_EGG         )  return "help\\object\\egg.txt";
	if ( type == OBJECT_ANT         )  return "help\\object\\ant.txt";
	if ( type == OBJECT_SPIDER      )  return "help\\object\\spider.txt";
	if ( type == OBJECT_BEE         )  return "help\\object\\wasp.txt";
	if ( type == OBJECT_WORM        )  return "help\\object\\worm.txt";
	if ( type == OBJECT_RUINmobilew1)  return "help\\object\\wreck.txt";
	return "";
}


// Retourne le fichier d'aide � utiliser pour une instruction.

char* RetHelpFilename(const char *token)
{
	if ( strcmp(token, "if"            ) == 0 )  return "help\\cbot\\if.txt";
	if ( strcmp(token, "else"          ) == 0 )  return "help\\cbot\\if.txt";
	if ( strcmp(token, "repeat"        ) == 0 )  return "help\\cbot\\repeat.txt";
	if ( strcmp(token, "for"           ) == 0 )  return "help\\cbot\\for.txt";
	if ( strcmp(token, "while"         ) == 0 )  return "help\\cbot\\while.txt";
	if ( strcmp(token, "do"            ) == 0 )  return "help\\cbot\\do.txt";
	if ( strcmp(token, "break"         ) == 0 )  return "help\\cbot\\break.txt";
	if ( strcmp(token, "continue"      ) == 0 )  return "help\\cbot\\continue.txt";
	if ( strcmp(token, "return"        ) == 0 )  return "help\\cbot\\return.txt";
	if ( strcmp(token, "sizeof"        ) == 0 )  return "help\\cbot\\sizeof.txt";
	if ( strcmp(token, "int"           ) == 0 )  return "help\\cbot\\int.txt";
	if ( strcmp(token, "float"         ) == 0 )  return "help\\cbot\\float.txt";
	if ( strcmp(token, "bool"          ) == 0 )  return "help\\cbot\\bool.txt";
	if ( strcmp(token, "string"        ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "point"         ) == 0 )  return "help\\cbot\\point.txt";
	if ( strcmp(token, "object"        ) == 0 )  return "help\\cbot\\object.txt";
	if ( strcmp(token, "file"          ) == 0 )  return "help\\cbot\\file.txt";
	if ( strcmp(token, "void"          ) == 0 )  return "help\\cbot\\void.txt";
	if ( strcmp(token, "null"          ) == 0 )  return "help\\cbot\\null.txt";
	if ( strcmp(token, "nan"           ) == 0 )  return "help\\cbot\\nan.txt";
	if ( strcmp(token, "true"          ) == 0 )  return "help\\cbot\\true.txt";
	if ( strcmp(token, "false"         ) == 0 )  return "help\\cbot\\false.txt";
	if ( strcmp(token, "sin"           ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "cos"           ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "tan"           ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "asin"          ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "acos"          ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "atan"          ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "sqrt"          ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "pow"           ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "rand"          ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "abs"           ) == 0 )  return "help\\cbot\\expr.txt";
	if ( strcmp(token, "retobject"     ) == 0 )  return "help\\cbot\\retobj.txt";
	if ( strcmp(token, "search"        ) == 0 )  return "help\\cbot\\search.txt";
	if ( strcmp(token, "radar"         ) == 0 )  return "help\\cbot\\radar.txt";
	if ( strcmp(token, "direction"     ) == 0 )  return "help\\cbot\\direct.txt";
	if ( strcmp(token, "distance"      ) == 0 )  return "help\\cbot\\dist.txt";
	if ( strcmp(token, "distance2d"    ) == 0 )  return "help\\cbot\\dist2d.txt";
	if ( strcmp(token, "space"         ) == 0 )  return "help\\cbot\\space.txt";
	if ( strcmp(token, "flatground"    ) == 0 )  return "help\\cbot\\flatgrnd.txt";
	if ( strcmp(token, "wait"          ) == 0 )  return "help\\cbot\\wait.txt";
	if ( strcmp(token, "move"          ) == 0 )  return "help\\cbot\\move.txt";
	if ( strcmp(token, "turn"          ) == 0 )  return "help\\cbot\\turn.txt";
	if ( strcmp(token, "goto"          ) == 0 )  return "help\\cbot\\goto.txt";
	if ( strcmp(token, "find"          ) == 0 )  return "help\\cbot\\find.txt";
	if ( strcmp(token, "grab"          ) == 0 )  return "help\\cbot\\grab.txt";
	if ( strcmp(token, "drop"          ) == 0 )  return "help\\cbot\\drop.txt";
	if ( strcmp(token, "sniff"         ) == 0 )  return "help\\cbot\\sniff.txt";
	if ( strcmp(token, "receive"       ) == 0 )  return "help\\cbot\\receive.txt";
	if ( strcmp(token, "send"          ) == 0 )  return "help\\cbot\\send.txt";
	if ( strcmp(token, "deleteinfo"    ) == 0 )  return "help\\cbot\\delinfo.txt";
	if ( strcmp(token, "testinfo"      ) == 0 )  return "help\\cbot\\testinfo.txt";
	if ( strcmp(token, "thump"         ) == 0 )  return "help\\cbot\\thump.txt";
	if ( strcmp(token, "recycle"       ) == 0 )  return "help\\cbot\\recycle.txt";
	if ( strcmp(token, "shield"        ) == 0 )  return "help\\cbot\\shield.txt";
	if ( strcmp(token, "fire"          ) == 0 )  return "help\\cbot\\fire.txt";
	if ( strcmp(token, "antfire"       ) == 0 )  return "help\\cbot\\antfire.txt";
	if ( strcmp(token, "aim"           ) == 0 )  return "help\\cbot\\aim.txt";
	if ( strcmp(token, "motor"         ) == 0 )  return "help\\cbot\\motor.txt";
	if ( strcmp(token, "jet"           ) == 0 )  return "help\\cbot\\jet.txt";
	if ( strcmp(token, "topo"          ) == 0 )  return "help\\cbot\\topo.txt";
	if ( strcmp(token, "message"       ) == 0 )  return "help\\cbot\\message.txt";
	if ( strcmp(token, "abstime"       ) == 0 )  return "help\\cbot\\abstime.txt";
	if ( strcmp(token, "BlackArrow"    ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "RedArrow"      ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "White"         ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Black"         ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Gray"          ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "LightGray"     ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Red"           ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Pink"          ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Purple"        ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Orange"        ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Yellow"        ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Beige"         ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Brown"         ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Skin"          ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Green"         ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "LightGreen"    ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "Blue"          ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "LightBlue"     ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "InFront"       ) == 0 )  return "help\\cbot\\grab.txt";
	if ( strcmp(token, "Behind"        ) == 0 )  return "help\\cbot\\grab.txt";
	if ( strcmp(token, "EnergyCell"    ) == 0 )  return "help\\cbot\\grab.txt";
	if ( strcmp(token, "DisplayError"  ) == 0 )  return "help\\cbot\\message.txt";
	if ( strcmp(token, "DisplayWarning") == 0 )  return "help\\cbot\\message.txt";
	if ( strcmp(token, "DisplayInfo"   ) == 0 )  return "help\\cbot\\message.txt";
	if ( strcmp(token, "DisplayMessage") == 0 )  return "help\\cbot\\message.txt";
	if ( strcmp(token, "strlen"        ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strleft"       ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strright"      ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strmid"        ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strval"        ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strfind"       ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strlower"      ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "strupper"      ) == 0 )  return "help\\cbot\\string.txt";
	if ( strcmp(token, "open"          ) == 0 )  return "help\\cbot\\open.txt";
	if ( strcmp(token, "close"         ) == 0 )  return "help\\cbot\\close.txt";
	if ( strcmp(token, "writeln"       ) == 0 )  return "help\\cbot\\writeln.txt";
	if ( strcmp(token, "readln "       ) == 0 )  return "help\\cbot\\readln.txt";
	if ( strcmp(token, "eof"           ) == 0 )  return "help\\cbot\\eof.txt";
	if ( strcmp(token, "deletefile"    ) == 0 )  return "help\\cbot\\deletef.txt";
	if ( strcmp(token, "openfile"      ) == 0 )  return "help\\cbot\\openfile.txt";
	if ( strcmp(token, "pendown"       ) == 0 )  return "help\\cbot\\pendown.txt";
	if ( strcmp(token, "penup"         ) == 0 )  return "help\\cbot\\penup.txt";
	if ( strcmp(token, "pencolor"      ) == 0 )  return "help\\cbot\\pencolor.txt";
	if ( strcmp(token, "penwidth"      ) == 0 )  return "help\\cbot\\penwidth.txt";
	if ( strcmp(token, "extern"        ) == 0 )  return "help\\cbot\\extern.txt";
	if ( strcmp(token, "class"         ) == 0 )  return "help\\cbot\\class.txt";
	if ( strcmp(token, "static"        ) == 0 )  return "help\\cbot\\static.txt";
	if ( strcmp(token, "public"        ) == 0 )  return "help\\cbot\\public.txt";
	if ( strcmp(token, "private"       ) == 0 )  return "help\\cbot\\private.txt";
	if ( strcmp(token, "synchronized"  ) == 0 )  return "help\\cbot\\synchro.txt";
	if ( strcmp(token, "new"           ) == 0 )  return "help\\cbot\\new.txt";
	if ( strcmp(token, "this"          ) == 0 )  return "help\\cbot\\this.txt";
	return "";
}


// Teste si un mot cl� est un type de variable.

BOOL IsType(const char *token)
{
	if ( strcmp(token, "void"   ) == 0 )  return TRUE;
	if ( strcmp(token, "int"    ) == 0 )  return TRUE;
	if ( strcmp(token, "float"  ) == 0 )  return TRUE;
	if ( strcmp(token, "bool"   ) == 0 )  return TRUE;
	if ( strcmp(token, "string" ) == 0 )  return TRUE;
	if ( strcmp(token, "point"  ) == 0 )  return TRUE;
	if ( strcmp(token, "object" ) == 0 )  return TRUE;
	if ( strcmp(token, "file"   ) == 0 )  return TRUE;
	if ( strcmp(token, "this"   ) == 0 )  return TRUE;
	return FALSE;
}

// Teste si un mot cl� est une fonction.

BOOL IsFunction(const char *token)
{
	if ( strcmp(token, "sin"          ) == 0 )  return TRUE;
	if ( strcmp(token, "cos"          ) == 0 )  return TRUE;
	if ( strcmp(token, "tan"          ) == 0 )  return TRUE;
	if ( strcmp(token, "asin"         ) == 0 )  return TRUE;
	if ( strcmp(token, "acos"         ) == 0 )  return TRUE;
	if ( strcmp(token, "atan"         ) == 0 )  return TRUE;
	if ( strcmp(token, "sqrt"         ) == 0 )  return TRUE;
	if ( strcmp(token, "pow"          ) == 0 )  return TRUE;
	if ( strcmp(token, "rand"         ) == 0 )  return TRUE;
	if ( strcmp(token, "abs"          ) == 0 )  return TRUE;
	if ( strcmp(token, "retobject"    ) == 0 )  return TRUE;
	if ( strcmp(token, "search"       ) == 0 )  return TRUE;
	if ( strcmp(token, "radar"        ) == 0 )  return TRUE;
	if ( strcmp(token, "detect"       ) == 0 )  return TRUE;
	if ( strcmp(token, "direction"    ) == 0 )  return TRUE;
	if ( strcmp(token, "distance"     ) == 0 )  return TRUE;
	if ( strcmp(token, "distance2d"   ) == 0 )  return TRUE;
	if ( strcmp(token, "space"        ) == 0 )  return TRUE;
	if ( strcmp(token, "flatground"   ) == 0 )  return TRUE;
	if ( strcmp(token, "wait"         ) == 0 )  return TRUE;
	if ( strcmp(token, "move"         ) == 0 )  return TRUE;
	if ( strcmp(token, "turn"         ) == 0 )  return TRUE;
	if ( strcmp(token, "goto"         ) == 0 )  return TRUE;
	if ( strcmp(token, "find"         ) == 0 )  return TRUE;
	if ( strcmp(token, "grab"         ) == 0 )  return TRUE;
	if ( strcmp(token, "drop"         ) == 0 )  return TRUE;
	if ( strcmp(token, "sniff"        ) == 0 )  return TRUE;
	if ( strcmp(token, "receive"      ) == 0 )  return TRUE;
	if ( strcmp(token, "send"         ) == 0 )  return TRUE;
	if ( strcmp(token, "deleteinfo"   ) == 0 )  return TRUE;
	if ( strcmp(token, "testinfo"     ) == 0 )  return TRUE;
	if ( strcmp(token, "thump"        ) == 0 )  return TRUE;
	if ( strcmp(token, "recycle"      ) == 0 )  return TRUE;
	if ( strcmp(token, "shield"       ) == 0 )  return TRUE;
	if ( strcmp(token, "fire"         ) == 0 )  return TRUE;
	if ( strcmp(token, "antfire"      ) == 0 )  return TRUE;
	if ( strcmp(token, "aim"          ) == 0 )  return TRUE;
	if ( strcmp(token, "motor"        ) == 0 )  return TRUE;
	if ( strcmp(token, "jet"          ) == 0 )  return TRUE;
	if ( strcmp(token, "topo"         ) == 0 )  return TRUE;
	if ( strcmp(token, "message"      ) == 0 )  return TRUE;
	if ( strcmp(token, "abstime"      ) == 0 )  return TRUE;
	if ( strcmp(token, "ismovie"      ) == 0 )  return TRUE;
	if ( strcmp(token, "errmode"      ) == 0 )  return TRUE;
	if ( strcmp(token, "ipf"          ) == 0 )  return TRUE;
	if ( strcmp(token, "strlen"       ) == 0 )  return TRUE;
	if ( strcmp(token, "strleft"      ) == 0 )  return TRUE;
	if ( strcmp(token, "strright"     ) == 0 )  return TRUE;
	if ( strcmp(token, "strmid"       ) == 0 )  return TRUE;
	if ( strcmp(token, "strval"       ) == 0 )  return TRUE;
	if ( strcmp(token, "strfind"      ) == 0 )  return TRUE;
	if ( strcmp(token, "strlower"     ) == 0 )  return TRUE;
	if ( strcmp(token, "strupper"     ) == 0 )  return TRUE;
	if ( strcmp(token, "open"         ) == 0 )  return TRUE;
	if ( strcmp(token, "close"        ) == 0 )  return TRUE;
	if ( strcmp(token, "writeln"      ) == 0 )  return TRUE;
	if ( strcmp(token, "readln"       ) == 0 )  return TRUE;
	if ( strcmp(token, "eof"          ) == 0 )  return TRUE;
	if ( strcmp(token, "deletefile"   ) == 0 )  return TRUE;
	if ( strcmp(token, "openfile"     ) == 0 )  return TRUE;
	if ( strcmp(token, "pendown"      ) == 0 )  return TRUE;
	if ( strcmp(token, "penup"        ) == 0 )  return TRUE;
	if ( strcmp(token, "pencolor"     ) == 0 )  return TRUE;
	if ( strcmp(token, "penwidth"     ) == 0 )  return TRUE;
	if ( strcmp(token, "sizeof"       ) == 0 )  return TRUE;
	return FALSE;
}


// Retourne l'aide compacte pour une instruction.

char* RetHelpText(const char *token)
{
	if ( strcmp(token, "if"        ) == 0 )  return "if ( condition ) { bloc }";
	if ( strcmp(token, "else"      ) == 0 )  return "else { bloc }";
	if ( strcmp(token, "repeat"    ) == 0 )  return "repeat ( number )";
	if ( strcmp(token, "for"       ) == 0 )  return "for ( before ; condition ; end )";
	if ( strcmp(token, "while"     ) == 0 )  return "while ( condition ) { bloc }";
	if ( strcmp(token, "do"        ) == 0 )  return "do { bloc } while ( condition );";
	if ( strcmp(token, "break"     ) == 0 )  return "break;";
	if ( strcmp(token, "continue"  ) == 0 )  return "continue;";
	if ( strcmp(token, "return"    ) == 0 )  return "return;";
	if ( strcmp(token, "sizeof"    ) == 0 )  return "sizeof( array );";
	if ( strcmp(token, "int"       ) == 0 )  return "int";
	if ( strcmp(token, "sin"       ) == 0 )  return "sin ( angle );";
	if ( strcmp(token, "cos"       ) == 0 )  return "cos ( angle );";
	if ( strcmp(token, "tan"       ) == 0 )  return "tan ( angle );";
	if ( strcmp(token, "asin"      ) == 0 )  return "asin ( value );";
	if ( strcmp(token, "acos"      ) == 0 )  return "acos ( value );";
	if ( strcmp(token, "atan"      ) == 0 )  return "atan ( value );";
	if ( strcmp(token, "sqrt"      ) == 0 )  return "sqrt ( value );";
	if ( strcmp(token, "pow"       ) == 0 )  return "pow ( x, y );";
	if ( strcmp(token, "rand"      ) == 0 )  return "rand ( );";
	if ( strcmp(token, "abs"       ) == 0 )  return "abs ( value );";
	if ( strcmp(token, "retobject" ) == 0 )  return "retobjet ( );";
	if ( strcmp(token, "search"    ) == 0 )  return "search ( );";
	if ( strcmp(token, "radar"     ) == 0 )  return "radar ( cat, angle, focus, min, max, sens );";
	if ( strcmp(token, "detect"    ) == 0 )  return "detect ( cat );";
	if ( strcmp(token, "direction" ) == 0 )  return "direction ( position );";
	if ( strcmp(token, "distance2d") == 0 )  return "distance2d ( p1, p2 );";
	if ( strcmp(token, "distance"  ) == 0 )  return "distance ( p1, p2 );";
	if ( strcmp(token, "space"     ) == 0 )  return "space ( center, rmin, rmax, dist );";
	if ( strcmp(token, "flatground") == 0 )  return "flatground ( center, rmax );";
	if ( strcmp(token, "wait"      ) == 0 )  return "wait ( time );";
	if ( strcmp(token, "move"      ) == 0 )  return "move ( distance );";
	if ( strcmp(token, "turn"      ) == 0 )  return "turn ( angle );";
	if ( strcmp(token, "goto"      ) == 0 )  return "goto ( position, altitude );";
	if ( strcmp(token, "find"      ) == 0 )  return "find ( cat );";
	if ( strcmp(token, "grab"      ) == 0 )  return "grab ( order );";
	if ( strcmp(token, "drop"      ) == 0 )  return "drop ( order );";
	if ( strcmp(token, "sniff"     ) == 0 )  return "sniff ( );";
	if ( strcmp(token, "receive"   ) == 0 )  return "receive ( name, power );";
	if ( strcmp(token, "send"      ) == 0 )  return "send ( name, value, power );";
	if ( strcmp(token, "deleteinfo") == 0 )  return "deleteinfo ( name, power );";
	if ( strcmp(token, "testinfo"  ) == 0 )  return "testinfo ( name, power );";
	if ( strcmp(token, "thump"     ) == 0 )  return "thump ( );";
	if ( strcmp(token, "recycle"   ) == 0 )  return "recycle ( );";
	if ( strcmp(token, "shield"    ) == 0 )  return "shield ( oper, radius );";
	if ( strcmp(token, "fire"      ) == 0 )  return "fire ( time );";
	if ( strcmp(token, "antfire"   ) == 0 )  return "antfire ( );";
	if ( strcmp(token, "aim"       ) == 0 )  return "aim ( angle );";
	if ( strcmp(token, "motor"     ) == 0 )  return "motor ( left, right );";
	if ( strcmp(token, "jet"       ) == 0 )  return "jet ( power );";
	if ( strcmp(token, "topo"      ) == 0 )  return "topo ( position );";
	if ( strcmp(token, "message"   ) == 0 )  return "message ( string, type );";
	if ( strcmp(token, "abstime"   ) == 0 )  return "abstime ( );";
	if ( strcmp(token, "ismovie"   ) == 0 )  return "ismovie ( );";
	if ( strcmp(token, "errmode"   ) == 0 )  return "errmode ( mdoe );";
	if ( strcmp(token, "ipf"       ) == 0 )  return "ipf ( number );";
	if ( strcmp(token, "strlen"    ) == 0 )  return "strlen ( string );";
	if ( strcmp(token, "strleft"   ) == 0 )  return "strleft ( string, len );";
	if ( strcmp(token, "strright"  ) == 0 )  return "strright ( string, len );";
	if ( strcmp(token, "strmid"    ) == 0 )  return "strmid ( string, pos, len );";
	if ( strcmp(token, "strval"    ) == 0 )  return "strval ( string );";
	if ( strcmp(token, "strfind"   ) == 0 )  return "strfind ( string, substring );";
	if ( strcmp(token, "strlower"  ) == 0 )  return "strlower ( string );";
	if ( strcmp(token, "strupper"  ) == 0 )  return "strupper ( string );";
	if ( strcmp(token, "open"      ) == 0 )  return "open ( filename, mode );";
	if ( strcmp(token, "close"     ) == 0 )  return "close ( );";
	if ( strcmp(token, "writeln"   ) == 0 )  return "writeln ( string );";
	if ( strcmp(token, "readln"    ) == 0 )  return "readln ( );";
	if ( strcmp(token, "eof"       ) == 0 )  return "eof ( );";
	if ( strcmp(token, "deletefile") == 0 )  return "deletefile ( filename );";
	if ( strcmp(token, "openfile"  ) == 0 )  return "openfile ( filename, mode );";
	if ( strcmp(token, "pendown"   ) == 0 )  return "pendown ( color, width );";
	if ( strcmp(token, "penup"     ) == 0 )  return "penup ( );";
	if ( strcmp(token, "pencolor"  ) == 0 )  return "pencolor ( color );";
	if ( strcmp(token, "penwidth"  ) == 0 )  return "penwidth ( width );";
	return "";
}