d1ea6c60677849974f63c4e04d01e2c7ad49abbf
[sdk] / compiler / bootstrap / libec / bootstrap / firstPass.c
1 /* Code generated from eC source file: firstPass.ec */
2 #if defined(_WIN32)
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
6 #else
7 #define __runtimePlatform 2
8 #endif
9 #if defined(__GNUC__)
10 typedef long long int64;
11 typedef unsigned long long uint64;
12 #ifndef _WIN32
13 #define __declspec(x)
14 #endif
15 #elif defined(__TINYC__)
16 #include <stdarg.h>
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
20 #ifdef _WIN32
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
24 #else
25 #define __declspec(x)
26 #endif
27 typedef long long int64;
28 typedef unsigned long long uint64;
29 #else
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
32 #endif
33 #ifdef __BIG_ENDIAN__
34 #define __ENDIAN_PAD(x) (8 - (x))
35 #else
36 #define __ENDIAN_PAD(x) 0
37 #endif
38 #include <stdint.h>
39 #include <sys/types.h>
40 enum yytokentype
41 {
42 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372, WIDE_STRING_LITERAL = 373
43 };
44
45 extern unsigned int inCompiler;
46
47 extern unsigned int buildingECERECOMModule;
48
49 struct __ecereNameSpace__ecere__sys__OldList
50 {
51 void *  first;
52 void *  last;
53 int count;
54 unsigned int offset;
55 unsigned int circ;
56 } __attribute__ ((gcc_struct));
57
58 struct __ecereNameSpace__ecere__sys__BTNode;
59
60 struct __ecereNameSpace__ecere__com__DataValue
61 {
62 union
63 {
64 char c;
65 unsigned char uc;
66 short s;
67 unsigned short us;
68 int i;
69 unsigned int ui;
70 void *  p;
71 float f;
72 double d;
73 long long i64;
74 uint64 ui64;
75 } __attribute__ ((gcc_struct)) __anon1;
76 } __attribute__ ((gcc_struct));
77
78 struct __ecereNameSpace__ecere__com__SerialBuffer
79 {
80 unsigned char *  _buffer;
81 unsigned int count;
82 unsigned int _size;
83 unsigned int pos;
84 } __attribute__ ((gcc_struct));
85
86 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
87
88 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
89
90 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
91
92 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
93
94 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
95
96 struct Enumerator;
97
98 struct Pointer;
99
100 struct Initializer;
101
102 struct InitDeclarator;
103
104 struct TypeName;
105
106 struct Statement;
107
108 struct FunctionDefinition;
109
110 struct AsmField;
111
112 struct Attrib;
113
114 struct ExtDecl;
115
116 struct Attribute;
117
118 struct MembersInit;
119
120 struct MemberInit;
121
122 struct PropertyWatch;
123
124 struct DBTableEntry;
125
126 struct DBIndexItem;
127
128 struct DBTableDef;
129
130 struct CodePosition
131 {
132 int line;
133 int charPos;
134 int pos;
135 int included;
136 } __attribute__ ((gcc_struct));
137
138 extern int strtol(const char * , char * * , int base);
139
140 extern void Compiler_Error(const char *  format, ...);
141
142 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
143
144 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
145
146 struct ModuleImport;
147
148 struct ClassImport;
149
150 struct __ecereNameSpace__ecere__com__ClassProperty;
151
152 extern int strcmp(const char * , const char * );
153
154 extern char *  strcpy(char * , const char * );
155
156 extern char *  strcat(char * , const char * );
157
158 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
159
160 struct __ecereNameSpace__ecere__com__LinkList
161 {
162 void * first;
163 void * last;
164 int count;
165 } __attribute__ ((gcc_struct));
166
167 struct __ecereNameSpace__ecere__com__GlobalFunction;
168
169 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
170
171 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
172
173 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
174
175 extern struct __ecereNameSpace__ecere__sys__OldList *  ast;
176
177 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
178
179 struct Location
180 {
181 struct CodePosition start;
182 struct CodePosition end;
183 } __attribute__ ((gcc_struct));
184
185 extern struct ModuleImport * mainModule;
186
187 extern struct Location yylloc;
188
189 struct Expression;
190
191 extern void ProcessExpressionType(struct Expression * exp);
192
193 extern void ComputeExpression(struct Expression * exp);
194
195 extern void FreeExpression(struct Expression * exp);
196
197 struct Context;
198
199 extern struct Context * globalContext;
200
201 struct External;
202
203 extern struct External * curExternal;
204
205 struct __ecereNameSpace__ecere__com__Class;
206
207 struct __ecereNameSpace__ecere__com__Instance
208 {
209 void * *  _vTbl;
210 struct __ecereNameSpace__ecere__com__Class * _class;
211 int _refCount;
212 } __attribute__ ((gcc_struct));
213
214 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
215
216 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
217
218 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_AddClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  dataType, void *  setStmt, void *  getStmt);
219
220 extern void __ecereNameSpace__ecere__com__eClass_DoneAddingTemplateParameters(struct __ecereNameSpace__ecere__com__Class * base);
221
222 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
223
224 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
225
226 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
227
228 struct __ecereNameSpace__ecere__com__Property;
229
230 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
231
232 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
233
234 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
235
236 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
237
238 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  dataType, void *  setStmt, void *  getStmt, int declMode);
239
240 extern void __ecereNameSpace__ecere__com__eProperty_Watchable(struct __ecereNameSpace__ecere__com__Property * _property);
241
242 struct Declarator;
243
244 extern char *  StringFromSpecDecl(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
245
246 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
247
248 struct TemplateDatatype
249 {
250 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
251 struct Declarator * decl;
252 } __attribute__ ((gcc_struct));
253
254 struct Type;
255
256 struct __ecereNameSpace__ecere__com__Property
257 {
258 struct __ecereNameSpace__ecere__com__Property * prev;
259 struct __ecereNameSpace__ecere__com__Property * next;
260 const char *  name;
261 unsigned int isProperty;
262 int memberAccess;
263 int id;
264 struct __ecereNameSpace__ecere__com__Class * _class;
265 const char *  dataTypeString;
266 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
267 struct Type * dataType;
268 void (*  Set)(void * , int);
269 int (*  Get)(void * );
270 unsigned int (*  IsSet)(void * );
271 void *  data;
272 void *  symbol;
273 int vid;
274 unsigned int conversion;
275 unsigned int watcherOffset;
276 const char *  category;
277 unsigned int compiled;
278 unsigned int selfWatchable;
279 unsigned int isWatchable;
280 } __attribute__ ((gcc_struct));
281
282 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
283
284 extern void PrintType(struct Type * type, char *  string, unsigned int printName, unsigned int fullName);
285
286 extern void FreeType(struct Type * type);
287
288 struct __ecereNameSpace__ecere__com__DataMember;
289
290 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eMember_AddDataMember(struct __ecereNameSpace__ecere__com__DataMember * member, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
291
292 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
293
294 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eMember_New(int type, int declMode);
295
296 extern unsigned int __ecereNameSpace__ecere__com__eMember_AddMember(struct __ecereNameSpace__ecere__com__DataMember * addTo, struct __ecereNameSpace__ecere__com__DataMember * dataMember);
297
298 extern unsigned int __ecereNameSpace__ecere__com__eClass_AddMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__DataMember * dataMember);
299
300 struct Specifier;
301
302 extern void FreeSpecifier(struct Specifier * spec);
303
304 struct Symbol;
305
306 extern struct Symbol * FindType(struct Context * ctx, const char *  name);
307
308 extern struct Symbol * FindClass(const char *  name);
309
310 struct __ecereNameSpace__ecere__sys__OldLink;
311
312 struct __ecereNameSpace__ecere__sys__OldLink
313 {
314 struct __ecereNameSpace__ecere__sys__OldLink * prev;
315 struct __ecereNameSpace__ecere__sys__OldLink * next;
316 void *  data;
317 } __attribute__ ((gcc_struct));
318
319 struct __ecereNameSpace__ecere__sys__BinaryTree;
320
321 struct __ecereNameSpace__ecere__sys__BinaryTree
322 {
323 struct __ecereNameSpace__ecere__sys__BTNode * root;
324 int count;
325 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
326 void (*  FreeKey)(void *  key);
327 } __attribute__ ((gcc_struct));
328
329 struct __ecereNameSpace__ecere__com__DataMember
330 {
331 struct __ecereNameSpace__ecere__com__DataMember * prev;
332 struct __ecereNameSpace__ecere__com__DataMember * next;
333 const char *  name;
334 unsigned int isProperty;
335 int memberAccess;
336 int id;
337 struct __ecereNameSpace__ecere__com__Class * _class;
338 const char *  dataTypeString;
339 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
340 struct Type * dataType;
341 int type;
342 int offset;
343 int memberID;
344 struct __ecereNameSpace__ecere__sys__OldList members;
345 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
346 int memberOffset;
347 short structAlignment;
348 short pointerAlignment;
349 } __attribute__ ((gcc_struct));
350
351 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
352
353 struct ClassDef;
354
355 struct Operand;
356
357 struct OpTable
358 {
359 unsigned int (*  Add)(struct Expression *, struct Operand *, struct Operand *);
360 unsigned int (*  Sub)(struct Expression *, struct Operand *, struct Operand *);
361 unsigned int (*  Mul)(struct Expression *, struct Operand *, struct Operand *);
362 unsigned int (*  Div)(struct Expression *, struct Operand *, struct Operand *);
363 unsigned int (*  Mod)(struct Expression *, struct Operand *, struct Operand *);
364 unsigned int (*  Neg)(struct Expression *, struct Operand *);
365 unsigned int (*  Inc)(struct Expression *, struct Operand *);
366 unsigned int (*  Dec)(struct Expression *, struct Operand *);
367 unsigned int (*  Asign)(struct Expression *, struct Operand *, struct Operand *);
368 unsigned int (*  AddAsign)(struct Expression *, struct Operand *, struct Operand *);
369 unsigned int (*  SubAsign)(struct Expression *, struct Operand *, struct Operand *);
370 unsigned int (*  MulAsign)(struct Expression *, struct Operand *, struct Operand *);
371 unsigned int (*  DivAsign)(struct Expression *, struct Operand *, struct Operand *);
372 unsigned int (*  ModAsign)(struct Expression *, struct Operand *, struct Operand *);
373 unsigned int (*  BitAnd)(struct Expression *, struct Operand *, struct Operand *);
374 unsigned int (*  BitOr)(struct Expression *, struct Operand *, struct Operand *);
375 unsigned int (*  BitXor)(struct Expression *, struct Operand *, struct Operand *);
376 unsigned int (*  LShift)(struct Expression *, struct Operand *, struct Operand *);
377 unsigned int (*  RShift)(struct Expression *, struct Operand *, struct Operand *);
378 unsigned int (*  BitNot)(struct Expression *, struct Operand *);
379 unsigned int (*  AndAsign)(struct Expression *, struct Operand *, struct Operand *);
380 unsigned int (*  OrAsign)(struct Expression *, struct Operand *, struct Operand *);
381 unsigned int (*  XorAsign)(struct Expression *, struct Operand *, struct Operand *);
382 unsigned int (*  LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
383 unsigned int (*  RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
384 unsigned int (*  Not)(struct Expression *, struct Operand *);
385 unsigned int (*  Equ)(struct Expression *, struct Operand *, struct Operand *);
386 unsigned int (*  Nqu)(struct Expression *, struct Operand *, struct Operand *);
387 unsigned int (*  And)(struct Expression *, struct Operand *, struct Operand *);
388 unsigned int (*  Or)(struct Expression *, struct Operand *, struct Operand *);
389 unsigned int (*  Grt)(struct Expression *, struct Operand *, struct Operand *);
390 unsigned int (*  Sma)(struct Expression *, struct Operand *, struct Operand *);
391 unsigned int (*  GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
392 unsigned int (*  SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
393 unsigned int (*  Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
394 } __attribute__ ((gcc_struct));
395
396 struct Operand
397 {
398 int kind;
399 struct Type * type;
400 unsigned int ptrSize;
401 union
402 {
403 char c;
404 unsigned char uc;
405 short s;
406 unsigned short us;
407 int i;
408 unsigned int ui;
409 float f;
410 double d;
411 long long i64;
412 uint64 ui64;
413 } __attribute__ ((gcc_struct)) __anon1;
414 struct OpTable ops;
415 } __attribute__ ((gcc_struct));
416
417 extern struct Operand GetOperand(struct Expression * exp);
418
419 struct __ecereNameSpace__ecere__com__BitMember;
420
421 extern struct __ecereNameSpace__ecere__com__BitMember * __ecereNameSpace__ecere__com__eClass_AddBitMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, int bitSize, int bitPos, int declMode);
422
423 struct __ecereNameSpace__ecere__com__BitMember
424 {
425 struct __ecereNameSpace__ecere__com__BitMember * prev;
426 struct __ecereNameSpace__ecere__com__BitMember * next;
427 const char *  name;
428 unsigned int isProperty;
429 int memberAccess;
430 int id;
431 struct __ecereNameSpace__ecere__com__Class * _class;
432 const char *  dataTypeString;
433 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
434 struct Type * dataType;
435 int type;
436 int size;
437 int pos;
438 uint64 mask;
439 } __attribute__ ((gcc_struct));
440
441 struct __ecereNameSpace__ecere__com__Method;
442
443 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
444 {
445 union
446 {
447 struct
448 {
449 const char *  dataTypeString;
450 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
451 } __attribute__ ((gcc_struct)) __anon1;
452 struct __ecereNameSpace__ecere__com__DataValue expression;
453 struct
454 {
455 const char *  memberString;
456 union
457 {
458 struct __ecereNameSpace__ecere__com__DataMember * member;
459 struct __ecereNameSpace__ecere__com__Property * prop;
460 struct __ecereNameSpace__ecere__com__Method * method;
461 } __attribute__ ((gcc_struct)) __anon1;
462 } __attribute__ ((gcc_struct)) __anon2;
463 } __attribute__ ((gcc_struct)) __anon1;
464 } __attribute__ ((gcc_struct));
465
466 struct __ecereNameSpace__ecere__com__Method
467 {
468 const char *  name;
469 struct __ecereNameSpace__ecere__com__Method * parent;
470 struct __ecereNameSpace__ecere__com__Method * left;
471 struct __ecereNameSpace__ecere__com__Method * right;
472 int depth;
473 int (*  function)();
474 int vid;
475 int type;
476 struct __ecereNameSpace__ecere__com__Class * _class;
477 void *  symbol;
478 const char *  dataTypeString;
479 struct Type * dataType;
480 int memberAccess;
481 } __attribute__ ((gcc_struct));
482
483 struct Symbol
484 {
485 char *  string;
486 struct Symbol * parent;
487 struct Symbol * left;
488 struct Symbol * right;
489 int depth;
490 struct Type * type;
491 union
492 {
493 struct __ecereNameSpace__ecere__com__Method * method;
494 struct __ecereNameSpace__ecere__com__Property * _property;
495 struct __ecereNameSpace__ecere__com__Class * registered;
496 } __attribute__ ((gcc_struct)) __anon1;
497 unsigned int notYetDeclared;
498 union
499 {
500 struct
501 {
502 struct External * pointerExternal;
503 struct External * structExternal;
504 } __attribute__ ((gcc_struct)) __anon1;
505 struct
506 {
507 struct External * externalGet;
508 struct External * externalSet;
509 struct External * externalPtr;
510 struct External * externalIsSet;
511 } __attribute__ ((gcc_struct)) __anon2;
512 struct
513 {
514 struct External * methodExternal;
515 struct External * methodCodeExternal;
516 } __attribute__ ((gcc_struct)) __anon3;
517 } __attribute__ ((gcc_struct)) __anon2;
518 unsigned int imported;
519 unsigned int declaredStructSym;
520 struct __ecereNameSpace__ecere__com__Class * _class;
521 unsigned int declaredStruct;
522 unsigned int needConstructor;
523 unsigned int needDestructor;
524 char *  constructorName;
525 char *  structName;
526 char *  className;
527 char *  destructorName;
528 struct ModuleImport * module;
529 struct ClassImport * _import;
530 struct Location nameLoc;
531 unsigned int isParam;
532 unsigned int isRemote;
533 unsigned int isStruct;
534 unsigned int fireWatchersDone;
535 int declaring;
536 unsigned int classData;
537 unsigned int isStatic;
538 char *  shortName;
539 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
540 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
541 struct Context * ctx;
542 int isIterator;
543 struct Expression * propCategory;
544 unsigned int mustRegister;
545 } __attribute__ ((gcc_struct));
546
547 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, void *  function, int declMode);
548
549 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, void *  function, int declMode);
550
551 extern struct __ecereNameSpace__ecere__com__ClassTemplateParameter * __ecereNameSpace__ecere__com__eClass_AddTemplateParameter(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, int type, const void *  info, struct __ecereNameSpace__ecere__com__ClassTemplateArgument * defaultArg);
552
553 struct __ecereNameSpace__ecere__com__Module;
554
555 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
556
557 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
558
559 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char *  name, const char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
560
561 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char *  name, const char *  type, void *  func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
562
563 struct Identifier;
564
565 struct Declarator
566 {
567 struct Declarator * prev;
568 struct Declarator * next;
569 struct Location loc;
570 int type;
571 struct Symbol * symbol;
572 struct Declarator * declarator;
573 union
574 {
575 struct Identifier * identifier;
576 struct
577 {
578 struct Expression * exp;
579 struct Expression * posExp;
580 struct Attrib * attrib;
581 } __attribute__ ((gcc_struct)) structDecl;
582 struct
583 {
584 struct Expression * exp;
585 struct Specifier * enumClass;
586 } __attribute__ ((gcc_struct)) array;
587 struct
588 {
589 struct __ecereNameSpace__ecere__sys__OldList * parameters;
590 } __attribute__ ((gcc_struct)) function;
591 struct
592 {
593 struct Pointer * pointer;
594 } __attribute__ ((gcc_struct)) pointer;
595 struct
596 {
597 struct ExtDecl * extended;
598 } __attribute__ ((gcc_struct)) extended;
599 } __attribute__ ((gcc_struct)) __anon1;
600 } __attribute__ ((gcc_struct));
601
602 extern struct Identifier * GetDeclId(struct Declarator * decl);
603
604 struct Identifier
605 {
606 struct Identifier * prev;
607 struct Identifier * next;
608 struct Location loc;
609 struct Symbol * classSym;
610 struct Specifier * _class;
611 char *  string;
612 struct Identifier * badID;
613 } __attribute__ ((gcc_struct));
614
615 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
616
617 struct Instantiation;
618
619 struct Expression
620 {
621 struct Expression * prev;
622 struct Expression * next;
623 struct Location loc;
624 int type;
625 union
626 {
627 struct
628 {
629 char *  constant;
630 struct Identifier * identifier;
631 } __attribute__ ((gcc_struct)) __anon1;
632 struct Statement * compound;
633 struct Instantiation * instance;
634 struct
635 {
636 char *  string;
637 unsigned int intlString;
638 unsigned int wideString;
639 } __attribute__ ((gcc_struct)) __anon2;
640 struct __ecereNameSpace__ecere__sys__OldList *  list;
641 struct
642 {
643 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
644 struct Declarator * decl;
645 } __attribute__ ((gcc_struct)) _classExp;
646 struct
647 {
648 struct Identifier * id;
649 } __attribute__ ((gcc_struct)) classData;
650 struct
651 {
652 struct Expression * exp;
653 struct __ecereNameSpace__ecere__sys__OldList * arguments;
654 struct Location argLoc;
655 } __attribute__ ((gcc_struct)) call;
656 struct
657 {
658 struct Expression * exp;
659 struct __ecereNameSpace__ecere__sys__OldList * index;
660 } __attribute__ ((gcc_struct)) index;
661 struct
662 {
663 struct Expression * exp;
664 struct Identifier * member;
665 int memberType;
666 unsigned int thisPtr;
667 } __attribute__ ((gcc_struct)) member;
668 struct
669 {
670 int op;
671 struct Expression * exp1;
672 struct Expression * exp2;
673 } __attribute__ ((gcc_struct)) op;
674 struct TypeName * typeName;
675 struct Specifier * _class;
676 struct
677 {
678 struct TypeName * typeName;
679 struct Expression * exp;
680 } __attribute__ ((gcc_struct)) cast;
681 struct
682 {
683 struct Expression * cond;
684 struct __ecereNameSpace__ecere__sys__OldList * exp;
685 struct Expression * elseExp;
686 } __attribute__ ((gcc_struct)) cond;
687 struct
688 {
689 struct TypeName * typeName;
690 struct Expression * size;
691 } __attribute__ ((gcc_struct)) _new;
692 struct
693 {
694 struct TypeName * typeName;
695 struct Expression * size;
696 struct Expression * exp;
697 } __attribute__ ((gcc_struct)) _renew;
698 struct
699 {
700 char * table;
701 struct Identifier * id;
702 } __attribute__ ((gcc_struct)) db;
703 struct
704 {
705 struct Expression * ds;
706 struct Expression * name;
707 } __attribute__ ((gcc_struct)) dbopen;
708 struct
709 {
710 struct TypeName * typeName;
711 struct Initializer * initializer;
712 } __attribute__ ((gcc_struct)) initializer;
713 struct
714 {
715 struct Expression * exp;
716 struct TypeName * typeName;
717 } __attribute__ ((gcc_struct)) vaArg;
718 } __attribute__ ((gcc_struct)) __anon1;
719 unsigned int debugValue;
720 struct __ecereNameSpace__ecere__com__DataValue val;
721 uint64 address;
722 unsigned int hasAddress;
723 struct Type * expType;
724 struct Type * destType;
725 unsigned int usage;
726 int tempCount;
727 unsigned int byReference;
728 unsigned int isConstant;
729 unsigned int addedThis;
730 unsigned int needCast;
731 unsigned int thisPtr;
732 unsigned int opDestType;
733 unsigned int needTemplateCast;
734 } __attribute__ ((gcc_struct));
735
736 struct Instantiation
737 {
738 struct Instantiation * prev;
739 struct Instantiation * next;
740 struct Location loc;
741 struct Specifier * _class;
742 struct Expression * exp;
743 struct __ecereNameSpace__ecere__sys__OldList *  members;
744 struct Symbol * symbol;
745 unsigned int fullSet;
746 unsigned int isConstant;
747 unsigned char *  data;
748 struct Location nameLoc;
749 struct Location insideLoc;
750 unsigned int built;
751 } __attribute__ ((gcc_struct));
752
753 struct ClassFunction;
754
755 struct ClassFunction
756 {
757 struct ClassFunction * prev;
758 struct ClassFunction * next;
759 struct Location loc;
760 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
761 struct Declarator * declarator;
762 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
763 struct Statement * body;
764 struct __ecereNameSpace__ecere__com__Class * _class;
765 struct __ecereNameSpace__ecere__sys__OldList attached;
766 int declMode;
767 struct Type * type;
768 struct Symbol * propSet;
769 unsigned int isVirtual;
770 unsigned int isConstructor;
771 unsigned int isDestructor;
772 unsigned int dontMangle;
773 int id;
774 int idCode;
775 } __attribute__ ((gcc_struct));
776
777 struct ClassDefinition;
778
779 struct Context
780 {
781 struct Context * parent;
782 struct __ecereNameSpace__ecere__sys__BinaryTree types;
783 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
784 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
785 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
786 int nextID;
787 int simpleID;
788 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
789 struct ClassDefinition * classDef;
790 unsigned int templateTypesOnly;
791 unsigned int hasNameSpace;
792 } __attribute__ ((gcc_struct));
793
794 struct ClassDefinition
795 {
796 struct ClassDefinition * prev;
797 struct ClassDefinition * next;
798 struct Location loc;
799 struct Specifier * _class;
800 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
801 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
802 struct Symbol * symbol;
803 struct Location blockStart;
804 struct Location nameLoc;
805 int declMode;
806 unsigned int deleteWatchable;
807 } __attribute__ ((gcc_struct));
808
809 struct __ecereNameSpace__ecere__com__NameSpace;
810
811 struct __ecereNameSpace__ecere__com__NameSpace
812 {
813 const char *  name;
814 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
815 struct __ecereNameSpace__ecere__com__NameSpace *  left;
816 struct __ecereNameSpace__ecere__com__NameSpace *  right;
817 int depth;
818 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
819 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
820 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
821 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
822 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
823 } __attribute__ ((gcc_struct));
824
825 struct __ecereNameSpace__ecere__com__Class
826 {
827 struct __ecereNameSpace__ecere__com__Class * prev;
828 struct __ecereNameSpace__ecere__com__Class * next;
829 const char *  name;
830 int offset;
831 int structSize;
832 void * *  _vTbl;
833 int vTblSize;
834 unsigned int (*  Constructor)(void * );
835 void (*  Destructor)(void * );
836 int offsetClass;
837 int sizeClass;
838 struct __ecereNameSpace__ecere__com__Class * base;
839 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
840 struct __ecereNameSpace__ecere__sys__BinaryTree members;
841 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
842 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
843 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
844 struct __ecereNameSpace__ecere__sys__OldList derivatives;
845 int memberID;
846 int startMemberID;
847 int type;
848 struct __ecereNameSpace__ecere__com__Instance * module;
849 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
850 const char *  dataTypeString;
851 struct Type * dataType;
852 int typeSize;
853 int defaultAlignment;
854 void (*  Initialize)();
855 int memberOffset;
856 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
857 const char *  designerClass;
858 unsigned int noExpansion;
859 const char *  defaultProperty;
860 unsigned int comRedefinition;
861 int count;
862 int isRemote;
863 unsigned int internalDecl;
864 void *  data;
865 unsigned int computeSize;
866 short structAlignment;
867 short pointerAlignment;
868 int destructionWatchOffset;
869 unsigned int fixed;
870 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
871 int inheritanceAccess;
872 const char *  fullName;
873 void *  symbol;
874 struct __ecereNameSpace__ecere__sys__OldList conversions;
875 struct __ecereNameSpace__ecere__sys__OldList templateParams;
876 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
877 struct __ecereNameSpace__ecere__com__Class * templateClass;
878 struct __ecereNameSpace__ecere__sys__OldList templatized;
879 int numParams;
880 unsigned int isInstanceClass;
881 unsigned int byValueSystemClass;
882 } __attribute__ ((gcc_struct));
883
884 struct __ecereNameSpace__ecere__com__Application
885 {
886 int argc;
887 const char * *  argv;
888 int exitCode;
889 unsigned int isGUIApp;
890 struct __ecereNameSpace__ecere__sys__OldList allModules;
891 char *  parsedCommand;
892 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
893 } __attribute__ ((gcc_struct));
894
895 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
896
897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
898
899 struct __ecereNameSpace__ecere__com__Module
900 {
901 struct __ecereNameSpace__ecere__com__Instance * application;
902 struct __ecereNameSpace__ecere__sys__OldList classes;
903 struct __ecereNameSpace__ecere__sys__OldList defines;
904 struct __ecereNameSpace__ecere__sys__OldList functions;
905 struct __ecereNameSpace__ecere__sys__OldList modules;
906 struct __ecereNameSpace__ecere__com__Instance * prev;
907 struct __ecereNameSpace__ecere__com__Instance * next;
908 const char *  name;
909 void *  library;
910 void *  Unload;
911 int importType;
912 int origImportType;
913 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
914 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
915 } __attribute__ ((gcc_struct));
916
917 void __ecereUnregisterModule_firstPass(struct __ecereNameSpace__ecere__com__Instance * module)
918 {
919
920 }
921
922 struct TemplateParameter;
923
924 struct Specifier
925 {
926 struct Specifier * prev;
927 struct Specifier * next;
928 struct Location loc;
929 int type;
930 union
931 {
932 int specifier;
933 struct
934 {
935 struct ExtDecl * extDecl;
936 char *  name;
937 struct Symbol * symbol;
938 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
939 struct Specifier * nsSpec;
940 } __attribute__ ((gcc_struct)) __anon1;
941 struct
942 {
943 struct Identifier * id;
944 struct __ecereNameSpace__ecere__sys__OldList *  list;
945 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
946 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
947 unsigned int addNameSpace;
948 struct Context * ctx;
949 struct ExtDecl * extDeclStruct;
950 } __attribute__ ((gcc_struct)) __anon2;
951 struct Expression * expression;
952 struct Specifier * _class;
953 struct TemplateParameter * templateParameter;
954 } __attribute__ ((gcc_struct)) __anon1;
955 } __attribute__ ((gcc_struct));
956
957 struct Type
958 {
959 struct Type * prev;
960 struct Type * next;
961 int refCount;
962 union
963 {
964 struct Symbol * _class;
965 struct
966 {
967 struct __ecereNameSpace__ecere__sys__OldList members;
968 char *  enumName;
969 } __attribute__ ((gcc_struct)) __anon1;
970 struct
971 {
972 struct Type * returnType;
973 struct __ecereNameSpace__ecere__sys__OldList params;
974 struct Symbol * thisClass;
975 unsigned int staticMethod;
976 struct TemplateParameter * thisClassTemplate;
977 } __attribute__ ((gcc_struct)) __anon2;
978 struct
979 {
980 struct __ecereNameSpace__ecere__com__Method * method;
981 struct __ecereNameSpace__ecere__com__Class * methodClass;
982 struct __ecereNameSpace__ecere__com__Class * usedClass;
983 } __attribute__ ((gcc_struct)) __anon3;
984 struct
985 {
986 struct Type * arrayType;
987 int arraySize;
988 struct Expression * arraySizeExp;
989 unsigned int freeExp;
990 struct Symbol * enumClass;
991 } __attribute__ ((gcc_struct)) __anon4;
992 struct Type * type;
993 struct TemplateParameter * templateParameter;
994 } __attribute__ ((gcc_struct)) __anon1;
995 int kind;
996 unsigned int size;
997 char *  name;
998 char *  typeName;
999 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
1000 int classObjectType;
1001 int alignment;
1002 unsigned int offset;
1003 int bitFieldCount;
1004 int count;
1005 unsigned int isSigned : 1;
1006 unsigned int constant : 1;
1007 unsigned int truth : 1;
1008 unsigned int byReference : 1;
1009 unsigned int extraParam : 1;
1010 unsigned int directClassAccess : 1;
1011 unsigned int computing : 1;
1012 unsigned int keepCast : 1;
1013 unsigned int passAsTemplate : 1;
1014 unsigned int dllExport : 1;
1015 unsigned int attrStdcall : 1;
1016 unsigned int declaredWithStruct : 1;
1017 unsigned int typedByReference : 1;
1018 unsigned int casted : 1;
1019 unsigned int pointerAlignment : 1;
1020 unsigned int isLong : 1;
1021 } __attribute__ ((gcc_struct));
1022
1023 struct PropertyDef;
1024
1025 struct PropertyDef
1026 {
1027 struct PropertyDef * prev;
1028 struct PropertyDef * next;
1029 struct Location loc;
1030 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1031 struct Declarator * declarator;
1032 struct Identifier * id;
1033 struct Statement * getStmt;
1034 struct Statement * setStmt;
1035 struct Statement * issetStmt;
1036 struct Symbol * symbol;
1037 struct Expression * category;
1038 struct
1039 {
1040 unsigned int conversion : 1;
1041 unsigned int isWatchable : 1;
1042 unsigned int isDBProp : 1;
1043 } __attribute__ ((gcc_struct)) __anon1;
1044 } __attribute__ ((gcc_struct));
1045
1046 struct TemplateArgument;
1047
1048 struct TemplateParameter
1049 {
1050 struct TemplateParameter * prev;
1051 struct TemplateParameter * next;
1052 struct Location loc;
1053 int type;
1054 struct Identifier * identifier;
1055 union
1056 {
1057 struct TemplateDatatype * dataType;
1058 int memberType;
1059 } __attribute__ ((gcc_struct)) __anon1;
1060 struct TemplateArgument * defaultArgument;
1061 const char *  dataTypeString;
1062 struct Type * baseType;
1063 } __attribute__ ((gcc_struct));
1064
1065 struct TemplateArgument
1066 {
1067 struct TemplateArgument * prev;
1068 struct TemplateArgument * next;
1069 struct Location loc;
1070 struct Identifier * name;
1071 int type;
1072 union
1073 {
1074 struct Expression * expression;
1075 struct Identifier * identifier;
1076 struct TemplateDatatype * templateDatatype;
1077 } __attribute__ ((gcc_struct)) __anon1;
1078 } __attribute__ ((gcc_struct));
1079
1080 struct Declaration;
1081
1082 typedef union YYSTYPE
1083 {
1084 int specifierType;
1085 int i;
1086 int declMode;
1087 struct Identifier * id;
1088 struct Expression * exp;
1089 struct Specifier * specifier;
1090 struct __ecereNameSpace__ecere__sys__OldList * list;
1091 struct Enumerator * enumerator;
1092 struct Declarator * declarator;
1093 struct Pointer * pointer;
1094 struct Initializer * initializer;
1095 struct InitDeclarator * initDeclarator;
1096 struct TypeName * typeName;
1097 struct Declaration * declaration;
1098 struct Statement * stmt;
1099 struct FunctionDefinition * function;
1100 struct External * external;
1101 struct Context * context;
1102 struct AsmField * asmField;
1103 struct Attrib * attrib;
1104 struct ExtDecl * extDecl;
1105 struct Attribute * attribute;
1106 struct Instantiation * instance;
1107 struct MembersInit * membersInit;
1108 struct MemberInit * memberInit;
1109 struct ClassFunction * classFunction;
1110 struct ClassDefinition * _class;
1111 struct ClassDef * classDef;
1112 struct PropertyDef * prop;
1113 char * string;
1114 struct Symbol * symbol;
1115 struct PropertyWatch * propertyWatch;
1116 struct TemplateParameter * templateParameter;
1117 struct TemplateArgument * templateArgument;
1118 struct TemplateDatatype * templateDatatype;
1119 struct DBTableEntry * dbtableEntry;
1120 struct DBIndexItem * dbindexItem;
1121 struct DBTableDef * dbtableDef;
1122 } __attribute__ ((gcc_struct)) YYSTYPE;
1123
1124 extern YYSTYPE yylval;
1125
1126 struct ClassDef
1127 {
1128 struct ClassDef * prev;
1129 struct ClassDef * next;
1130 struct Location loc;
1131 int type;
1132 union
1133 {
1134 struct Declaration * decl;
1135 struct ClassFunction * function;
1136 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1137 struct PropertyDef * propertyDef;
1138 struct PropertyWatch * propertyWatch;
1139 char *  designer;
1140 struct Identifier * defaultProperty;
1141 struct
1142 {
1143 struct Identifier * id;
1144 struct Initializer * initializer;
1145 } __attribute__ ((gcc_struct)) __anon1;
1146 } __attribute__ ((gcc_struct)) __anon1;
1147 int memberAccess;
1148 void *  object;
1149 } __attribute__ ((gcc_struct));
1150
1151 struct Declaration
1152 {
1153 struct Declaration * prev;
1154 struct Declaration * next;
1155 struct Location loc;
1156 int type;
1157 union
1158 {
1159 struct
1160 {
1161 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1162 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1163 } __attribute__ ((gcc_struct)) __anon1;
1164 struct Instantiation * inst;
1165 struct
1166 {
1167 struct Identifier * id;
1168 struct Expression * exp;
1169 } __attribute__ ((gcc_struct)) __anon2;
1170 } __attribute__ ((gcc_struct)) __anon1;
1171 struct Specifier * extStorage;
1172 struct Symbol * symbol;
1173 int declMode;
1174 } __attribute__ ((gcc_struct));
1175
1176 struct External
1177 {
1178 struct External * prev;
1179 struct External * next;
1180 struct Location loc;
1181 int type;
1182 struct Symbol * symbol;
1183 union
1184 {
1185 struct FunctionDefinition * function;
1186 struct ClassDefinition * _class;
1187 struct Declaration * declaration;
1188 char *  importString;
1189 struct Identifier * id;
1190 struct DBTableDef * table;
1191 } __attribute__ ((gcc_struct)) __anon1;
1192 int importType;
1193 struct External * fwdDecl;
1194 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1195 struct __ecereNameSpace__ecere__com__Instance * incoming;
1196 int nonBreakableIncoming;
1197 } __attribute__ ((gcc_struct));
1198
1199 static void AddDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions)
1200 {
1201 if(definitions != (((void *)0)))
1202 {
1203 struct ClassDef * def;
1204
1205 for(def = definitions->first; def; def = def->next)
1206 {
1207 if(def->type == 2)
1208 {
1209 struct Declaration * decl = def->__anon1.decl;
1210 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
1211 struct Type * dataType;
1212
1213 if(decl->type == 0)
1214 {
1215 struct Declarator * d;
1216
1217 if(decl->__anon1.__anon1.declarators)
1218 {
1219 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1220 {
1221 struct Identifier * declId = GetDeclId(d);
1222
1223 if(declId)
1224 {
1225 if(regClass && regClass->type == 2)
1226 {
1227 struct Expression * sizeExp = (d->type == 0) ? d->__anon1.structDecl.exp : (((void *)0));
1228 struct Expression * posExp = (d->type == 0) ? d->__anon1.structDecl.posExp : (((void *)0));
1229 int bitSize = 0, bitPos = -1;
1230 char dataTypeString[8192];
1231
1232 dataTypeString[0] = (char)0;
1233 if(sizeExp)
1234 {
1235 ProcessExpressionType(sizeExp);
1236 ComputeExpression(sizeExp);
1237 if(sizeExp->isConstant)
1238 bitSize = strtol(sizeExp->__anon1.__anon1.constant, (((void *)0)), 0);
1239 FreeExpression(sizeExp);
1240 }
1241 if(posExp)
1242 {
1243 ProcessExpressionType(posExp);
1244 ComputeExpression(posExp);
1245 if(posExp->isConstant)
1246 bitPos = strtol(posExp->__anon1.__anon1.constant, (((void *)0)), 0);
1247 FreeExpression(posExp);
1248 }
1249 if(d->type == 0)
1250 {
1251 d->__anon1.structDecl.posExp = (((void *)0));
1252 d->__anon1.structDecl.exp = (((void *)0));
1253 }
1254 dataType = ProcessType(decl->__anon1.__anon1.specifiers, d);
1255 PrintType(dataType, dataTypeString, 0, 1);
1256 {
1257 struct __ecereNameSpace__ecere__com__BitMember * member = __ecereNameSpace__ecere__com__eClass_AddBitMember(regClass, declId->string, dataTypeString, 0, 0, def->memberAccess);
1258
1259 if(member)
1260 {
1261 member->size = bitSize;
1262 member->pos = bitPos;
1263 }
1264 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)member;
1265 }
1266 if(dataMember)
1267 dataMember->dataType = dataType;
1268 else
1269 {
1270 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), declId->string, regClass->name);
1271 FreeType(dataType);
1272 }
1273 }
1274 else
1275 {
1276 {
1277 char typeString[8192];
1278
1279 typeString[0] = (char)0;
1280 dataType = ProcessType(decl->__anon1.__anon1.specifiers, d);
1281 PrintType(dataType, typeString, 0, 1);
1282 if(member)
1283 {
1284 dataMember = __ecereNameSpace__ecere__com__eMember_AddDataMember(member, declId->string, typeString, 0, 0, def->memberAccess);
1285 if(!dataMember)
1286 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in member %s\n", (((void *)0))), declId->string, member->name);
1287 }
1288 else if(regClass)
1289 {
1290 dataMember = __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, declId->string, typeString, 0, 0, def->memberAccess);
1291 if(!dataMember)
1292 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), declId->string, regClass->name);
1293 }
1294 if(dataMember)
1295 dataMember->dataType = dataType;
1296 else
1297 FreeType(dataType);
1298 }
1299 }
1300 }
1301 }
1302 }
1303 else if(decl->__anon1.__anon1.specifiers)
1304 {
1305 struct Specifier * spec;
1306
1307 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1308 {
1309 if(spec->type == 3 || spec->type == 4)
1310 {
1311 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1312 {
1313 struct __ecereNameSpace__ecere__com__DataMember * dataMember = __ecereNameSpace__ecere__com__eMember_New((spec->type == 4) ? 1 : 2, def->memberAccess);
1314
1315 AddDefinitions((((void *)0)), dataMember, spec->__anon1.__anon2.definitions);
1316 if(member)
1317 {
1318 __ecereNameSpace__ecere__com__eMember_AddMember(member, dataMember);
1319 }
1320 else
1321 {
1322 __ecereNameSpace__ecere__com__eClass_AddMember(regClass, dataMember);
1323 }
1324 }
1325 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1326 {
1327 {
1328 struct Identifier * id = spec->__anon1.__anon2.id;
1329 char typeString[8192];
1330
1331 typeString[0] = (char)0;
1332 spec->__anon1.__anon2.id = (((void *)0));
1333 decl->__anon1.__anon1.declarators = MkListOne(MkDeclaratorIdentifier(id));
1334 dataType = ProcessType(decl->__anon1.__anon1.specifiers, (((void *)0)));
1335 PrintType(dataType, typeString, 0, 1);
1336 if(member)
1337 {
1338 dataMember = __ecereNameSpace__ecere__com__eMember_AddDataMember(member, id->string, typeString, 0, 0, def->memberAccess);
1339 if(!dataMember)
1340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in member %s\n", (((void *)0))), id->string, member->name);
1341 }
1342 else
1343 {
1344 dataMember = __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, id->string, typeString, 0, 0, def->memberAccess);
1345 if(!dataMember)
1346 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), id->string, regClass->name);
1347 }
1348 if(dataMember)
1349 dataMember->dataType = dataType;
1350 else
1351 FreeType(dataType);
1352 }
1353 }
1354 }
1355 }
1356 }
1357 }
1358 else if(decl->type == 2)
1359 {
1360 struct Instantiation * inst = decl->__anon1.inst;
1361 struct Expression * exp = inst->exp;
1362
1363 if(exp)
1364 {
1365 char * string = exp->__anon1.__anon1.identifier->string;
1366
1367 {
1368 struct Type * dataType = (dataType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dataType->kind = 8, dataType->__anon1._class = inst->_class->__anon1.__anon1.symbol, dataType->refCount = 1, dataType);
1369
1370 if(member)
1371 {
1372 dataMember = __ecereNameSpace__ecere__com__eMember_AddDataMember(member, string, inst->_class->__anon1.__anon1.name, 0, 0, def->memberAccess);
1373 if(!dataMember)
1374 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in member %s\n", (((void *)0))), string, member->name);
1375 }
1376 else
1377 {
1378 dataMember = __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, string, inst->_class->__anon1.__anon1.name, 0, 0, def->memberAccess);
1379 if(!dataMember)
1380 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Member with same name already exists %s in class %s\n", (((void *)0))), string, regClass->name);
1381 }
1382 if(dataMember)
1383 dataMember->dataType = dataType;
1384 else
1385 FreeType(dataType);
1386 }
1387 }
1388 }
1389 }
1390 else if(def->type == 3 && def->__anon1.propertyDef)
1391 {
1392 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
1393 struct __ecereNameSpace__ecere__com__Property * prop;
1394 char * dataTypeString = StringFromSpecDecl(propertyDef->specifiers, propertyDef->declarator);
1395
1396 prop = __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, propertyDef->__anon1.conversion ? (((void *)0)) : propertyDef->id->string, dataTypeString, inCompiler ? propertyDef->setStmt : (((void *)0)), inCompiler ? propertyDef->getStmt : (((void *)0)), def->memberAccess);
1397 (__ecereNameSpace__ecere__com__eSystem_Delete(dataTypeString), dataTypeString = 0);
1398 if(prop)
1399 {
1400 if(inCompiler)
1401 prop->IsSet = (void *)propertyDef->issetStmt;
1402 prop->compiled = 0;
1403 prop->symbol = __extension__ ({
1404 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1405
1406 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(propertyDef->symbol->string), __ecereInstance1->type = propertyDef->symbol->type, __ecereInstance1;
1407 });
1408 ((struct Symbol *)prop->symbol)->propCategory = propertyDef->category;
1409 propertyDef->category = (((void *)0));
1410 if(propertyDef->__anon1.isWatchable)
1411 __ecereNameSpace__ecere__com__eProperty_Watchable(prop);
1412 }
1413 propertyDef->symbol->__anon1._property = prop;
1414 if(propertyDef->symbol->type)
1415 propertyDef->symbol->type->refCount++;
1416 }
1417 else if(def->type == 10 && def->__anon1.propertyDef)
1418 {
1419 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
1420 char * dataTypeString = StringFromSpecDecl(propertyDef->specifiers, propertyDef->declarator);
1421
1422 __ecereNameSpace__ecere__com__eClass_AddClassProperty(regClass, propertyDef->id->string, dataTypeString, inCompiler ? propertyDef->setStmt : (((void *)0)), inCompiler ? propertyDef->getStmt : (((void *)0)));
1423 (__ecereNameSpace__ecere__com__eSystem_Delete(dataTypeString), dataTypeString = 0);
1424 }
1425 }
1426 }
1427 }
1428
1429 static void ProcessClass(int classType, struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * enumValues, struct Location * loc, struct __ecereNameSpace__ecere__sys__OldList * defs, void * after, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators, int declMode)
1430 {
1431 struct __ecereNameSpace__ecere__com__Class * regClass;
1432 struct ClassDef * def;
1433 unsigned int redefinition = 0;
1434
1435 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1436 if(regClass && !regClass->internalDecl)
1437 {
1438 if(symbol->parent || (struct Symbol *)globalContext->classes.root == symbol)
1439 {
1440 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->classes, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
1441 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), symbol);
1442 }
1443 redefinition = 1;
1444 if(inCompiler)
1445 {
1446 yylloc = *loc;
1447 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of class %s\n", (((void *)0))), symbol->string);
1448 return ;
1449 }
1450 }
1451 else
1452 {
1453 char baseName[1024] = "";
1454 unsigned int unitType = 0;
1455 unsigned int wouldBeEnum = 0;
1456 int inheritanceAccess = 1;
1457
1458 if(baseSpecs != (((void *)0)))
1459 {
1460 struct Type * baseType = ProcessType(baseSpecs, (((void *)0)));
1461
1462 PrintType(baseType, baseName, 0, 1);
1463 if(baseType->kind == 8)
1464 {
1465 if(baseType->__anon1._class->__anon1.registered && classType == 0)
1466 {
1467 if(baseType->__anon1._class->__anon1.registered->type == 3)
1468 classType = 3;
1469 else if(baseType->__anon1._class->__anon1.registered->type == 2)
1470 classType = 2;
1471 else if(baseType->__anon1._class->__anon1.registered->type == 5)
1472 classType = 5;
1473 else if(baseType->__anon1._class->__anon1.registered->type == 4)
1474 {
1475 wouldBeEnum = 1;
1476 }
1477 }
1478 }
1479 else if(baseType->kind == 9 || baseType->kind == 10)
1480 {
1481 classType = 5;
1482 baseName[0] = '\0';
1483 }
1484 else
1485 unitType = 1;
1486 FreeType(baseType);
1487 if(((struct Specifier *)baseSpecs->first)->type == 0 && ((struct Specifier *)baseSpecs->first)->__anon1.specifier == PRIVATE)
1488 inheritanceAccess = 2;
1489 }
1490 if(classType == 0)
1491 {
1492 if(unitType)
1493 classType = 3;
1494 if(definitions != (((void *)0)))
1495 {
1496 for(def = definitions->first; def; def = def->next)
1497 {
1498 if(def->type == 2)
1499 {
1500 struct Declaration * decl = def->__anon1.decl;
1501
1502 if(decl->type == 0)
1503 {
1504 if(unitType)
1505 {
1506 classType = 2;
1507 break;
1508 }
1509 if(decl->__anon1.__anon1.declarators)
1510 {
1511 struct Declarator * d;
1512
1513 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1514 {
1515 if(d->type != 0)
1516 continue;
1517 if(d->__anon1.structDecl.exp)
1518 {
1519 classType = 2;
1520 break;
1521 }
1522 }
1523 if(d)
1524 break;
1525 }
1526 }
1527 }
1528 }
1529 }
1530 }
1531 if(classType == 0 && wouldBeEnum)
1532 classType = 4;
1533 regClass = symbol->__anon1.registered = __ecereNameSpace__ecere__com__eSystem_RegisterClass((classType == 6) ? 1 : classType, symbol->string, baseName[0] ? baseName : (((void *)0)), 0, 0, (((void *)0)), (((void *)0)), privateModule, buildingECERECOMModule ? 4 : declMode, inheritanceAccess);
1534 if(regClass)
1535 regClass->symbol = symbol;
1536 }
1537 if(!redefinition)
1538 {
1539 if(classType == 6)
1540 {
1541 struct __ecereNameSpace__ecere__com__DataMember * unionMember = __ecereNameSpace__ecere__com__eMember_New(1, 1);
1542
1543 AddDefinitions(regClass, unionMember, definitions);
1544 __ecereNameSpace__ecere__com__eClass_AddMember(regClass, unionMember);
1545 }
1546 else
1547 AddDefinitions(regClass, (((void *)0)), definitions);
1548 }
1549 if(definitions != (((void *)0)))
1550 {
1551 for(def = definitions->first; def; def = def->next)
1552 {
1553 if(def->type == 0 && (def->__anon1.function->isConstructor || def->__anon1.function->isDestructor))
1554 {
1555 struct Specifier * spec = def->__anon1.function->specifiers ? (*def->__anon1.function->specifiers).last : (((void *)0));
1556
1557 if(!spec || spec->type != 1 || !spec->__anon1.__anon1.name || (strcmp(spec->__anon1.__anon1.name, regClass->name) && (!spec->__anon1.__anon1.symbol || !spec->__anon1.__anon1.symbol->__anon1.registered || strcmp(spec->__anon1.__anon1.symbol->__anon1.registered->name, regClass->name))))
1558 {
1559 yylloc = def->__anon1.function->loc;
1560 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "wrong class name specified for %s\n", (((void *)0))), def->__anon1.function->isConstructor ? __ecereNameSpace__ecere__GetTranslatedString("ec", "constructor", (((void *)0))) : __ecereNameSpace__ecere__GetTranslatedString("ec", "destructor", (((void *)0))));
1561 }
1562 FreeList(def->__anon1.function->specifiers, (void *)(FreeSpecifier));
1563 def->__anon1.function->specifiers = (((void *)0));
1564 }
1565 if(def->type == 0 && def->__anon1.function->declarator)
1566 {
1567 struct ClassFunction * func = def->__anon1.function;
1568
1569 func->_class = regClass;
1570 if(!redefinition && !func->dontMangle)
1571 {
1572 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
1573 struct Identifier * id = GetDeclId(funcDecl);
1574 struct __ecereNameSpace__ecere__com__Method * method;
1575
1576 if(func->isVirtual)
1577 {
1578 char * typeString = StringFromSpecDecl(func->specifiers, func->declarator);
1579
1580 method = __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(regClass, id->string, typeString, inCompiler ? func->declarator->symbol : (((void *)0)), def->memberAccess);
1581 (__ecereNameSpace__ecere__com__eSystem_Delete(typeString), typeString = 0);
1582 }
1583 else
1584 {
1585 char * typeString = StringFromSpecDecl(func->specifiers, func->declarator);
1586
1587 method = __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, id->string, typeString, inCompiler ? func->declarator->symbol : (((void *)0)), def->memberAccess);
1588 if(!method)
1589 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Redefinition of method %s in class %s\n", (((void *)0))), id->string, regClass->name);
1590 (__ecereNameSpace__ecere__com__eSystem_Delete(typeString), typeString = 0);
1591 }
1592 if(method && (method->type != 1 || method->_class == regClass))
1593 {
1594 method->symbol = __extension__ ({
1595 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
1596
1597 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(func->declarator->symbol->string), __ecereInstance1->type = func->declarator->symbol->type, __ecereInstance1->__anon1.method = method, __ecereInstance1;
1598 });
1599 if(func->declarator->symbol->type)
1600 func->declarator->symbol->type->refCount++;
1601 func->declarator->symbol->__anon1.method = method;
1602 }
1603 else
1604 {
1605 func->declarator->symbol->__anon1.method = method;
1606 }
1607 }
1608 }
1609 }
1610 }
1611 if(regClass && symbol->templateParams)
1612 {
1613 struct TemplateParameter * param;
1614
1615 for(param = (*symbol->templateParams).first; param; param = param->next)
1616 {
1617 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg =
1618 {
1619
1620 .__anon1 = {
1621
1622 .__anon1 = {
1623 .dataTypeString = 0
1624 }
1625 }
1626 };
1627
1628 if(param->defaultArgument)
1629 {
1630 switch(param->type)
1631 {
1632 case 0:
1633 defaultArg.__anon1.__anon1.dataTypeString = StringFromSpecDecl(param->defaultArgument->__anon1.templateDatatype->specifiers, param->defaultArgument->__anon1.templateDatatype->decl);
1634 break;
1635 case 1:
1636 {
1637 char memberString[1024];
1638
1639 memberString[0] = '\0';
1640 if(param->defaultArgument->__anon1.identifier->_class)
1641 {
1642 if(param->defaultArgument->__anon1.identifier->_class->type == 8)
1643 {
1644 if(param->defaultArgument->__anon1.identifier->_class->__anon1.templateParameter)
1645 strcpy(memberString, param->defaultArgument->__anon1.identifier->_class->__anon1.templateParameter->identifier->string);
1646 }
1647 else
1648 {
1649 if(param->defaultArgument->__anon1.identifier->_class->__anon1.__anon1.name)
1650 strcpy(memberString, param->defaultArgument->__anon1.identifier->_class->__anon1.__anon1.name);
1651 }
1652 }
1653 if(memberString[0])
1654 {
1655 strcat(memberString, "::");
1656 }
1657 strcat(memberString, param->defaultArgument->__anon1.identifier->string);
1658 defaultArg.__anon1.__anon2.memberString = __ecereNameSpace__ecere__sys__CopyString(memberString);
1659 break;
1660 }
1661 case 2:
1662 {
1663 struct Operand op;
1664
1665 param->defaultArgument->__anon1.expression->destType = ProcessType(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl);
1666 ProcessExpressionType(param->defaultArgument->__anon1.expression);
1667 ComputeExpression(param->defaultArgument->__anon1.expression);
1668 op = GetOperand(param->defaultArgument->__anon1.expression);
1669 defaultArg.__anon1.expression.__anon1.ui64 = op.__anon1.ui64;
1670 break;
1671 }
1672 }
1673 }
1674 if(param->type == 1)
1675 {
1676 __ecereNameSpace__ecere__com__eClass_AddTemplateParameter(regClass, param->identifier->string, 1, (void *)(uintptr_t)param->__anon1.memberType, &defaultArg);
1677 }
1678 else
1679 {
1680 char * typeString = param->__anon1.dataType ? StringFromSpecDecl(param->__anon1.dataType->specifiers, param->__anon1.dataType->decl) : (((void *)0));
1681
1682 __ecereNameSpace__ecere__com__eClass_AddTemplateParameter(regClass, param->identifier->string, param->type, typeString, &defaultArg);
1683 (__ecereNameSpace__ecere__com__eSystem_Delete(typeString), typeString = 0);
1684 }
1685 if(param->type == 0 || param->type == 1)
1686 (__ecereNameSpace__ecere__com__eSystem_Delete((void *)defaultArg.__anon1.__anon1.dataTypeString), defaultArg.__anon1.__anon1.dataTypeString = 0);
1687 }
1688 __ecereNameSpace__ecere__com__eClass_DoneAddingTemplateParameters(regClass);
1689 }
1690 }
1691
1692 void PrePreProcessClassDefinitions()
1693 {
1694 struct External * external, * next;
1695
1696 curExternal = (((void *)0));
1697 if(ast)
1698 {
1699 for(external = (*ast).first; external; external = next)
1700 {
1701 next = external->next;
1702 curExternal = external;
1703 if(external->type == 2)
1704 {
1705 struct ClassDefinition * _class = external->__anon1._class;
1706
1707 if((!_class->symbol->__anon1.registered || !inCompiler))
1708 {
1709 if(_class->definitions)
1710 _class->symbol->mustRegister = 1;
1711 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), _class->declMode);
1712 _class->symbol->isStatic = _class->declMode == 3;
1713 }
1714 }
1715 else if(external->type == 1)
1716 {
1717 struct Declaration * declaration = external->__anon1.declaration;
1718
1719 if(declaration->type == 1)
1720 {
1721 if(declaration->__anon1.__anon1.specifiers)
1722 {
1723 struct Specifier * specifier;
1724
1725 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
1726 {
1727 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->__anon1.__anon2.id && specifier->__anon1.__anon2.id->string && (declaration->declMode || specifier->__anon1.__anon2.baseSpecs || (specifier->type == 2 && specifier->__anon1.__anon2.definitions)))
1728 {
1729 struct Symbol * type = FindType(globalContext, specifier->__anon1.__anon2.id->string);
1730 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
1731
1732 if(type)
1733 {
1734 declaration->declMode = 0;
1735 if(symbol)
1736 {
1737 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->classes, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
1738 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), symbol);
1739 }
1740 }
1741 else if(symbol && !symbol->__anon1.registered)
1742 {
1743 int classType;
1744
1745 if(specifier->type == 2)
1746 classType = 4;
1747 else if(specifier->type == 4)
1748 classType = 6;
1749 else
1750 classType = 1;
1751 if(specifier->__anon1.__anon2.definitions || specifier->type == 2 || specifier->__anon1.__anon2.baseSpecs)
1752 symbol->mustRegister = 1;
1753 ProcessClass(classType, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, declaration->__anon1.__anon1.declarators, declaration->declMode);
1754 symbol->isStatic = declaration->declMode == 3;
1755 }
1756 }
1757 }
1758 }
1759 }
1760 }
1761 else if(external->type == 3)
1762 {
1763 }
1764 }
1765 {
1766 for(external = (*ast).first; external; external = external->next)
1767 {
1768 if(external->type == 2)
1769 {
1770 struct ClassDefinition * _class = external->__anon1._class;
1771
1772 if(_class->symbol)
1773 {
1774 struct __ecereNameSpace__ecere__sys__OldLink * link;
1775
1776 for(link = _class->symbol->templatedClasses.first; link; link = link->next)
1777 {
1778 struct Symbol * symbol = link->data;
1779
1780 symbol->__anon1.registered = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1781 }
1782 }
1783 }
1784 else if(external->type == 1)
1785 {
1786 struct Declaration * declaration = external->__anon1.declaration;
1787
1788 if(declaration->type == 1)
1789 {
1790 if(declaration->__anon1.__anon1.specifiers)
1791 {
1792 struct Specifier * specifier;
1793
1794 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
1795 {
1796 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->__anon1.__anon2.id && specifier->__anon1.__anon2.id->string && (declaration->declMode || specifier->__anon1.__anon2.baseSpecs || (specifier->type == 2 && specifier->__anon1.__anon2.definitions)))
1797 {
1798 struct Symbol * type = FindType(globalContext, specifier->__anon1.__anon2.id->string);
1799 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
1800
1801 if(type)
1802 {
1803 }
1804 else if(symbol)
1805 {
1806 struct __ecereNameSpace__ecere__sys__OldLink * link;
1807
1808 for(link = symbol->templatedClasses.first; link; link = link->next)
1809 {
1810 struct Symbol * tplSymbol = link->data;
1811
1812 tplSymbol->__anon1.registered = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, tplSymbol->string);
1813 tplSymbol->module = symbol->module ? symbol->module : mainModule;
1814 }
1815 }
1816 }
1817 }
1818 }
1819 }
1820 }
1821 }
1822 }
1823 }
1824 }
1825
1826 void __ecereRegisterModule_firstPass(struct __ecereNameSpace__ecere__com__Instance * module)
1827 {
1828 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
1829
1830 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrePreProcessClassDefinitions", "void PrePreProcessClassDefinitions(void)", PrePreProcessClassDefinitions, module, 1);
1831 }
1832