compiler/libec: (#307, #70) Warning on undeclared class; Overriding namespaces
[sdk] / compiler / bootstrap / libec / bootstrap / pass0.c
1 /* Code generated from eC source file: pass0.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 int declMode;
48
49 extern int structDeclMode;
50
51 extern const char *  sourceFile;
52
53 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
54
55 struct __ecereNameSpace__ecere__sys__OldList
56 {
57 void *  first;
58 void *  last;
59 int count;
60 unsigned int offset;
61 unsigned int circ;
62 } __attribute__ ((gcc_struct));
63
64 struct __ecereNameSpace__ecere__sys__BTNode;
65
66 struct __ecereNameSpace__ecere__com__DataValue
67 {
68 union
69 {
70 char c;
71 unsigned char uc;
72 short s;
73 unsigned short us;
74 int i;
75 unsigned int ui;
76 void *  p;
77 float f;
78 double d;
79 long long i64;
80 uint64 ui64;
81 } __attribute__ ((gcc_struct)) __anon1;
82 } __attribute__ ((gcc_struct));
83
84 struct __ecereNameSpace__ecere__com__SerialBuffer
85 {
86 unsigned char *  _buffer;
87 unsigned int count;
88 unsigned int _size;
89 unsigned int pos;
90 } __attribute__ ((gcc_struct));
91
92 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
93
94 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
95
96 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsigned int size);
97
98 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
99
100 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
101
102 struct Enumerator;
103
104 struct Pointer;
105
106 struct InitDeclarator;
107
108 struct AsmField;
109
110 struct Attrib;
111
112 struct ExtDecl;
113
114 struct Attribute;
115
116 struct PropertyWatch;
117
118 struct TemplateParameter;
119
120 struct TemplateArgument;
121
122 struct TemplateDatatype;
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 char *  strcat(char * , const char * );
139
140 extern size_t strlen(const char * );
141
142 extern int strncmp(const char * , const char * , size_t n);
143
144 struct ModuleImport;
145
146 struct ClassImport;
147
148 extern void Compiler_Error(const char *  format, ...);
149
150 extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
151
152 struct __ecereNameSpace__ecere__com__LinkList
153 {
154 void * first;
155 void * last;
156 int count;
157 } __attribute__ ((gcc_struct));
158
159 extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
160
161 extern char *  strcpy(char * , const char * );
162
163 struct __ecereNameSpace__ecere__com__LinkElement
164 {
165 void * prev;
166 void * next;
167 } __attribute__ ((gcc_struct));
168
169 extern char *  strstr(const char * , const char * );
170
171 extern void Compiler_Warning(const char *  format, ...);
172
173 extern int sprintf(char * , const char * , ...);
174
175 struct __ecereNameSpace__ecere__com__GlobalFunction;
176
177 struct __ecereNameSpace__ecere__com__IteratorPointer;
178
179 extern struct __ecereNameSpace__ecere__sys__OldList *  MkList(void);
180
181 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void *  item);
182
183 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (*  FreeFunction)(void * ));
184
185 extern struct __ecereNameSpace__ecere__sys__OldList *  MkListOne(void *  item);
186
187 extern struct __ecereNameSpace__ecere__sys__OldList *  ast;
188
189 extern struct __ecereNameSpace__ecere__sys__OldList *  excludedSymbols;
190
191 extern struct __ecereNameSpace__ecere__sys__OldList *  CopyList(struct __ecereNameSpace__ecere__sys__OldList *  source, void *  (*  CopyFunction)(void * ));
192
193 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void *  prevItem, void *  item);
194
195 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
196
197 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void *  item);
198
199 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
200
201 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
202
203 extern void FreeInitDeclarator(struct InitDeclarator * decl);
204
205 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList *  attribs);
206
207 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
208
209 struct Location
210 {
211 struct CodePosition start;
212 struct CodePosition end;
213 } __attribute__ ((gcc_struct));
214
215 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
216 {
217 int c;
218 char ch;
219 int len;
220
221 for(c = 0; (ch = className[c]) && ch != '<'; c++)
222 {
223 if(ch == ':')
224 {
225 strcat(output, "__ecereNameSpace__");
226 break;
227 }
228 }
229 len = strlen(output);
230 c = 0;
231 if(!strncmp(className, "const ", 6))
232 c += 6;
233 for(; (ch = className[c]); c++)
234 {
235 if(ch == ':')
236 output[len++] = '_';
237 else if(ch == ' ')
238 output[len++] = '_';
239 else if(ch == '*')
240 {
241 output[len++] = '_';
242 output[len++] = 'P';
243 output[len++] = 'T';
244 output[len++] = 'R';
245 output[len++] = '_';
246 }
247 else if(ch == '=')
248 {
249 output[len++] = '_';
250 output[len++] = 'E';
251 output[len++] = 'Q';
252 output[len++] = 'U';
253 output[len++] = '_';
254 }
255 else if(ch == '<')
256 {
257 if(!includeTemplateParams)
258 break;
259 if(!strncmp(className + c + 1, "const ", 6))
260 c += 6;
261 output[len++] = '_';
262 output[len++] = 'T';
263 output[len++] = 'P';
264 output[len++] = 'L';
265 output[len++] = '_';
266 }
267 else if(ch == '>')
268 {
269 output[len++] = '_';
270 }
271 else if(ch == ',')
272 {
273 if(!strncmp(className + c + 1, "const ", 6))
274 c += 6;
275 output[len++] = '_';
276 }
277 else
278 output[len++] = ch;
279 }
280 output[len++] = (char)0;
281 }
282
283 extern struct Location yylloc;
284
285 struct External;
286
287 extern struct External * curExternal;
288
289 struct TopoEdge
290 {
291 struct __ecereNameSpace__ecere__com__LinkElement in;
292 struct __ecereNameSpace__ecere__com__LinkElement out;
293 struct External * from;
294 struct External * to;
295 unsigned int breakable;
296 } __attribute__ ((gcc_struct));
297
298 extern void FreeExternal(struct External * external);
299
300 extern struct External * DeclareStruct(struct External * neededBy, const char *  name, unsigned int skipNoHead, unsigned int needDereference);
301
302 struct Context;
303
304 extern struct Context * PushContext(void);
305
306 extern void PopContext(struct Context * ctx);
307
308 extern struct Context * curContext;
309
310 struct __ecereNameSpace__ecere__com__Class;
311
312 struct __ecereNameSpace__ecere__com__Instance
313 {
314 void * *  _vTbl;
315 struct __ecereNameSpace__ecere__com__Class * _class;
316 int _refCount;
317 } __attribute__ ((gcc_struct));
318
319 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
320
321 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
322
323 extern int AddMembers(struct External * neededBy, struct __ecereNameSpace__ecere__sys__OldList *  declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int *  retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int *  addedPadding);
324
325 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
326
327 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
328
329 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
330
331 int __ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext;
332
333 struct __ecereNameSpace__ecere__com__Property;
334
335 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
336
337 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);
338
339 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
340
341 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
342
343 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);
344
345 struct Declarator;
346
347 extern void FreeDeclarator(struct Declarator * decl);
348
349 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
350
351 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
352
353 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
354
355 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
356
357 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
358
359 struct __ecereNameSpace__ecere__com__BTNamedLink;
360
361 struct __ecereNameSpace__ecere__com__BTNamedLink
362 {
363 const char *  name;
364 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
365 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
366 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
367 int depth;
368 void *  data;
369 } __attribute__ ((gcc_struct));
370
371 struct Symbol;
372
373 extern struct Symbol * FindClass(const char *  name);
374
375 struct Declaration;
376
377 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
378
379 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
380
381 struct Specifier;
382
383 extern struct Specifier * MkSpecifierName(const char *  name);
384
385 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
386
387 extern void FreeSpecifier(struct Specifier * spec);
388
389 extern struct Specifier * MkSpecifier(int specifier);
390
391 extern struct Specifier * CopySpecifier(struct Specifier * spec);
392
393 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
394
395 struct Identifier;
396
397 extern struct Identifier * GetDeclId(struct Declarator * decl);
398
399 struct Identifier
400 {
401 struct Identifier * prev;
402 struct Identifier * next;
403 struct Location loc;
404 struct Symbol * classSym;
405 struct Specifier * _class;
406 char *  string;
407 struct Identifier * badID;
408 } __attribute__ ((gcc_struct));
409
410 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
411
412 extern struct Identifier * MkIdentifier(const char *  string);
413
414 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
415
416 struct Expression;
417
418 struct Specifier
419 {
420 struct Specifier * prev;
421 struct Specifier * next;
422 struct Location loc;
423 int type;
424 union
425 {
426 int specifier;
427 struct
428 {
429 struct ExtDecl * extDecl;
430 char *  name;
431 struct Symbol * symbol;
432 struct __ecereNameSpace__ecere__sys__OldList *  templateArgs;
433 struct Specifier * nsSpec;
434 } __attribute__ ((gcc_struct)) __anon1;
435 struct
436 {
437 struct Identifier * id;
438 struct __ecereNameSpace__ecere__sys__OldList *  list;
439 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
440 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
441 unsigned int addNameSpace;
442 struct Context * ctx;
443 struct ExtDecl * extDeclStruct;
444 } __attribute__ ((gcc_struct)) __anon2;
445 struct Expression * expression;
446 struct Specifier * _class;
447 struct TemplateParameter * templateParameter;
448 } __attribute__ ((gcc_struct)) __anon1;
449 } __attribute__ ((gcc_struct));
450
451 struct Declarator
452 {
453 struct Declarator * prev;
454 struct Declarator * next;
455 struct Location loc;
456 int type;
457 struct Symbol * symbol;
458 struct Declarator * declarator;
459 union
460 {
461 struct Identifier * identifier;
462 struct
463 {
464 struct Expression * exp;
465 struct Expression * posExp;
466 struct Attrib * attrib;
467 } __attribute__ ((gcc_struct)) structDecl;
468 struct
469 {
470 struct Expression * exp;
471 struct Specifier * enumClass;
472 } __attribute__ ((gcc_struct)) array;
473 struct
474 {
475 struct __ecereNameSpace__ecere__sys__OldList * parameters;
476 } __attribute__ ((gcc_struct)) function;
477 struct
478 {
479 struct Pointer * pointer;
480 } __attribute__ ((gcc_struct)) pointer;
481 struct
482 {
483 struct ExtDecl * extended;
484 } __attribute__ ((gcc_struct)) extended;
485 } __attribute__ ((gcc_struct)) __anon1;
486 } __attribute__ ((gcc_struct));
487
488 extern struct Expression * QMkExpId(const char *  id);
489
490 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
491
492 extern struct Expression * CopyExpression(struct Expression * exp);
493
494 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
495
496 extern struct Expression * MkExpIdentifier(struct Identifier * id);
497
498 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
499
500 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
501
502 struct Type;
503
504 struct __ecereNameSpace__ecere__com__Property
505 {
506 struct __ecereNameSpace__ecere__com__Property * prev;
507 struct __ecereNameSpace__ecere__com__Property * next;
508 const char *  name;
509 unsigned int isProperty;
510 int memberAccess;
511 int id;
512 struct __ecereNameSpace__ecere__com__Class * _class;
513 const char *  dataTypeString;
514 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
515 struct Type * dataType;
516 void (*  Set)(void * , int);
517 int (*  Get)(void * );
518 unsigned int (*  IsSet)(void * );
519 void *  data;
520 void *  symbol;
521 int vid;
522 unsigned int conversion;
523 unsigned int watcherOffset;
524 const char *  category;
525 unsigned int compiled;
526 unsigned int selfWatchable;
527 unsigned int isWatchable;
528 } __attribute__ ((gcc_struct));
529
530 extern struct Type * MkClassType(const char *  name);
531
532 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
533
534 extern void FreeType(struct Type * type);
535
536 struct ClassFunction;
537
538 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
539
540 struct Initializer;
541
542 struct Initializer
543 {
544 struct Initializer * prev;
545 struct Initializer * next;
546 struct Location loc;
547 int type;
548 union
549 {
550 struct Expression * exp;
551 struct __ecereNameSpace__ecere__sys__OldList *  list;
552 } __attribute__ ((gcc_struct)) __anon1;
553 unsigned int isConstant;
554 struct Identifier * id;
555 } __attribute__ ((gcc_struct));
556
557 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
558
559 extern void FreeInitializer(struct Initializer * initializer);
560
561 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
562
563 struct __ecereNameSpace__ecere__com__Method;
564
565 struct __ecereNameSpace__ecere__com__Method
566 {
567 const char *  name;
568 struct __ecereNameSpace__ecere__com__Method * parent;
569 struct __ecereNameSpace__ecere__com__Method * left;
570 struct __ecereNameSpace__ecere__com__Method * right;
571 int depth;
572 int (*  function)();
573 int vid;
574 int type;
575 struct __ecereNameSpace__ecere__com__Class * _class;
576 void *  symbol;
577 const char *  dataTypeString;
578 struct Type * dataType;
579 int memberAccess;
580 } __attribute__ ((gcc_struct));
581
582 struct Symbol
583 {
584 char *  string;
585 struct Symbol * parent;
586 struct Symbol * left;
587 struct Symbol * right;
588 int depth;
589 struct Type * type;
590 union
591 {
592 struct __ecereNameSpace__ecere__com__Method * method;
593 struct __ecereNameSpace__ecere__com__Property * _property;
594 struct __ecereNameSpace__ecere__com__Class * registered;
595 } __attribute__ ((gcc_struct)) __anon1;
596 unsigned int notYetDeclared;
597 union
598 {
599 struct
600 {
601 struct External * pointerExternal;
602 struct External * structExternal;
603 } __attribute__ ((gcc_struct)) __anon1;
604 struct
605 {
606 struct External * externalGet;
607 struct External * externalSet;
608 struct External * externalPtr;
609 struct External * externalIsSet;
610 } __attribute__ ((gcc_struct)) __anon2;
611 struct
612 {
613 struct External * methodExternal;
614 struct External * methodCodeExternal;
615 } __attribute__ ((gcc_struct)) __anon3;
616 } __attribute__ ((gcc_struct)) __anon2;
617 unsigned int imported;
618 unsigned int declaredStructSym;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 unsigned int declaredStruct;
621 unsigned int needConstructor;
622 unsigned int needDestructor;
623 char *  constructorName;
624 char *  structName;
625 char *  className;
626 char *  destructorName;
627 struct ModuleImport * module;
628 struct ClassImport * _import;
629 struct Location nameLoc;
630 unsigned int isParam;
631 unsigned int isRemote;
632 unsigned int isStruct;
633 unsigned int fireWatchersDone;
634 int declaring;
635 unsigned int classData;
636 unsigned int isStatic;
637 char *  shortName;
638 struct __ecereNameSpace__ecere__sys__OldList *  templateParams;
639 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
640 struct Context * ctx;
641 int isIterator;
642 struct Expression * propCategory;
643 unsigned int mustRegister;
644 } __attribute__ ((gcc_struct));
645
646 struct Type
647 {
648 struct Type * prev;
649 struct Type * next;
650 int refCount;
651 union
652 {
653 struct Symbol * _class;
654 struct
655 {
656 struct __ecereNameSpace__ecere__sys__OldList members;
657 char *  enumName;
658 } __attribute__ ((gcc_struct)) __anon1;
659 struct
660 {
661 struct Type * returnType;
662 struct __ecereNameSpace__ecere__sys__OldList params;
663 struct Symbol * thisClass;
664 unsigned int staticMethod;
665 struct TemplateParameter * thisClassTemplate;
666 } __attribute__ ((gcc_struct)) __anon2;
667 struct
668 {
669 struct __ecereNameSpace__ecere__com__Method * method;
670 struct __ecereNameSpace__ecere__com__Class * methodClass;
671 struct __ecereNameSpace__ecere__com__Class * usedClass;
672 } __attribute__ ((gcc_struct)) __anon3;
673 struct
674 {
675 struct Type * arrayType;
676 int arraySize;
677 struct Expression * arraySizeExp;
678 unsigned int freeExp;
679 struct Symbol * enumClass;
680 } __attribute__ ((gcc_struct)) __anon4;
681 struct Type * type;
682 struct TemplateParameter * templateParameter;
683 } __attribute__ ((gcc_struct)) __anon1;
684 int kind;
685 unsigned int size;
686 char *  name;
687 char *  typeName;
688 struct __ecereNameSpace__ecere__com__Class * thisClassFrom;
689 int classObjectType;
690 int alignment;
691 unsigned int offset;
692 int bitFieldCount;
693 int count;
694 unsigned int isSigned : 1;
695 unsigned int constant : 1;
696 unsigned int truth : 1;
697 unsigned int byReference : 1;
698 unsigned int extraParam : 1;
699 unsigned int directClassAccess : 1;
700 unsigned int computing : 1;
701 unsigned int keepCast : 1;
702 unsigned int passAsTemplate : 1;
703 unsigned int dllExport : 1;
704 unsigned int attrStdcall : 1;
705 unsigned int declaredWithStruct : 1;
706 unsigned int typedByReference : 1;
707 unsigned int casted : 1;
708 unsigned int pointerAlignment : 1;
709 } __attribute__ ((gcc_struct));
710
711 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);
712
713 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
714
715 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
716
717 struct Statement;
718
719 struct ClassFunction
720 {
721 struct ClassFunction * prev;
722 struct ClassFunction * next;
723 struct Location loc;
724 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
725 struct Declarator * declarator;
726 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
727 struct Statement * body;
728 struct __ecereNameSpace__ecere__com__Class * _class;
729 struct __ecereNameSpace__ecere__sys__OldList attached;
730 int declMode;
731 struct Type * type;
732 struct Symbol * propSet;
733 unsigned int isVirtual;
734 unsigned int isConstructor;
735 unsigned int isDestructor;
736 unsigned int dontMangle;
737 int id;
738 int idCode;
739 } __attribute__ ((gcc_struct));
740
741 struct Statement
742 {
743 struct Statement * prev;
744 struct Statement * next;
745 struct Location loc;
746 int type;
747 union
748 {
749 struct __ecereNameSpace__ecere__sys__OldList *  expressions;
750 struct
751 {
752 struct Identifier * id;
753 struct Statement * stmt;
754 } __attribute__ ((gcc_struct)) labeled;
755 struct
756 {
757 struct Expression * exp;
758 struct Statement * stmt;
759 } __attribute__ ((gcc_struct)) caseStmt;
760 struct
761 {
762 struct __ecereNameSpace__ecere__sys__OldList * declarations;
763 struct __ecereNameSpace__ecere__sys__OldList * statements;
764 struct Context * context;
765 unsigned int isSwitch;
766 } __attribute__ ((gcc_struct)) compound;
767 struct
768 {
769 struct __ecereNameSpace__ecere__sys__OldList * exp;
770 struct Statement * stmt;
771 struct Statement * elseStmt;
772 } __attribute__ ((gcc_struct)) ifStmt;
773 struct
774 {
775 struct __ecereNameSpace__ecere__sys__OldList * exp;
776 struct Statement * stmt;
777 } __attribute__ ((gcc_struct)) switchStmt;
778 struct
779 {
780 struct __ecereNameSpace__ecere__sys__OldList * exp;
781 struct Statement * stmt;
782 } __attribute__ ((gcc_struct)) whileStmt;
783 struct
784 {
785 struct __ecereNameSpace__ecere__sys__OldList * exp;
786 struct Statement * stmt;
787 } __attribute__ ((gcc_struct)) doWhile;
788 struct
789 {
790 struct Statement * init;
791 struct Statement * check;
792 struct __ecereNameSpace__ecere__sys__OldList * increment;
793 struct Statement * stmt;
794 } __attribute__ ((gcc_struct)) forStmt;
795 struct
796 {
797 struct Identifier * id;
798 } __attribute__ ((gcc_struct)) gotoStmt;
799 struct
800 {
801 struct Specifier * spec;
802 char * statements;
803 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
804 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
805 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
806 } __attribute__ ((gcc_struct)) asmStmt;
807 struct
808 {
809 struct Expression * watcher;
810 struct Expression * object;
811 struct __ecereNameSpace__ecere__sys__OldList * watches;
812 } __attribute__ ((gcc_struct)) _watch;
813 struct
814 {
815 struct Identifier * id;
816 struct __ecereNameSpace__ecere__sys__OldList * exp;
817 struct __ecereNameSpace__ecere__sys__OldList * filter;
818 struct Statement * stmt;
819 } __attribute__ ((gcc_struct)) forEachStmt;
820 struct Declaration * decl;
821 } __attribute__ ((gcc_struct)) __anon1;
822 } __attribute__ ((gcc_struct));
823
824 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
825
826 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
827
828 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
829
830 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
831
832 struct __ecereNameSpace__ecere__sys__BinaryTree;
833
834 struct __ecereNameSpace__ecere__sys__BinaryTree
835 {
836 struct __ecereNameSpace__ecere__sys__BTNode * root;
837 int count;
838 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
839 void (*  FreeKey)(void *  key);
840 } __attribute__ ((gcc_struct));
841
842 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  key);
843
844 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
845
846 struct __ecereNameSpace__ecere__com__DataMember;
847
848 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
849 {
850 union
851 {
852 struct
853 {
854 const char *  dataTypeString;
855 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
856 } __attribute__ ((gcc_struct)) __anon1;
857 struct __ecereNameSpace__ecere__com__DataValue expression;
858 struct
859 {
860 const char *  memberString;
861 union
862 {
863 struct __ecereNameSpace__ecere__com__DataMember * member;
864 struct __ecereNameSpace__ecere__com__Property * prop;
865 struct __ecereNameSpace__ecere__com__Method * method;
866 } __attribute__ ((gcc_struct)) __anon1;
867 } __attribute__ ((gcc_struct)) __anon2;
868 } __attribute__ ((gcc_struct)) __anon1;
869 } __attribute__ ((gcc_struct));
870
871 struct __ecereNameSpace__ecere__com__DataMember
872 {
873 struct __ecereNameSpace__ecere__com__DataMember * prev;
874 struct __ecereNameSpace__ecere__com__DataMember * next;
875 const char *  name;
876 unsigned int isProperty;
877 int memberAccess;
878 int id;
879 struct __ecereNameSpace__ecere__com__Class * _class;
880 const char *  dataTypeString;
881 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
882 struct Type * dataType;
883 int type;
884 int offset;
885 int memberID;
886 struct __ecereNameSpace__ecere__sys__OldList members;
887 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
888 int memberOffset;
889 short structAlignment;
890 short pointerAlignment;
891 } __attribute__ ((gcc_struct));
892
893 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);
894
895 struct __ecereNameSpace__ecere__com__Module;
896
897 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
898
899 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
900
901 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember **  subMemberStack, int *  subMemberStackPos);
902
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char *  name);
904
905 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
906
907 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, struct __ecereNameSpace__ecere__com__Instance * module);
908
909 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);
910
911 struct TypeName;
912
913 struct TypeName
914 {
915 struct TypeName * prev;
916 struct TypeName * next;
917 struct Location loc;
918 struct __ecereNameSpace__ecere__sys__OldList *  qualifiers;
919 struct Declarator * declarator;
920 int classObjectType;
921 struct Expression * bitCount;
922 } __attribute__ ((gcc_struct));
923
924 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
925
926 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
927
928 struct ClassDef;
929
930 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
931
932 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
933
934 struct ClassDefinition;
935
936 struct Context
937 {
938 struct Context * parent;
939 struct __ecereNameSpace__ecere__sys__BinaryTree types;
940 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
941 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
942 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
943 int nextID;
944 int simpleID;
945 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
946 struct ClassDefinition * classDef;
947 unsigned int templateTypesOnly;
948 unsigned int hasNameSpace;
949 } __attribute__ ((gcc_struct));
950
951 struct ClassDefinition
952 {
953 struct ClassDefinition * prev;
954 struct ClassDefinition * next;
955 struct Location loc;
956 struct Specifier * _class;
957 struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
958 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
959 struct Symbol * symbol;
960 struct Location blockStart;
961 struct Location nameLoc;
962 int declMode;
963 unsigned int deleteWatchable;
964 } __attribute__ ((gcc_struct));
965
966 struct Instantiation;
967
968 struct Expression
969 {
970 struct Expression * prev;
971 struct Expression * next;
972 struct Location loc;
973 int type;
974 union
975 {
976 struct
977 {
978 char *  constant;
979 struct Identifier * identifier;
980 } __attribute__ ((gcc_struct)) __anon1;
981 struct Statement * compound;
982 struct Instantiation * instance;
983 struct
984 {
985 char *  string;
986 unsigned int intlString;
987 unsigned int wideString;
988 } __attribute__ ((gcc_struct)) __anon2;
989 struct __ecereNameSpace__ecere__sys__OldList *  list;
990 struct
991 {
992 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
993 struct Declarator * decl;
994 } __attribute__ ((gcc_struct)) _classExp;
995 struct
996 {
997 struct Identifier * id;
998 } __attribute__ ((gcc_struct)) classData;
999 struct
1000 {
1001 struct Expression * exp;
1002 struct __ecereNameSpace__ecere__sys__OldList * arguments;
1003 struct Location argLoc;
1004 } __attribute__ ((gcc_struct)) call;
1005 struct
1006 {
1007 struct Expression * exp;
1008 struct __ecereNameSpace__ecere__sys__OldList * index;
1009 } __attribute__ ((gcc_struct)) index;
1010 struct
1011 {
1012 struct Expression * exp;
1013 struct Identifier * member;
1014 int memberType;
1015 unsigned int thisPtr;
1016 } __attribute__ ((gcc_struct)) member;
1017 struct
1018 {
1019 int op;
1020 struct Expression * exp1;
1021 struct Expression * exp2;
1022 } __attribute__ ((gcc_struct)) op;
1023 struct TypeName * typeName;
1024 struct Specifier * _class;
1025 struct
1026 {
1027 struct TypeName * typeName;
1028 struct Expression * exp;
1029 } __attribute__ ((gcc_struct)) cast;
1030 struct
1031 {
1032 struct Expression * cond;
1033 struct __ecereNameSpace__ecere__sys__OldList * exp;
1034 struct Expression * elseExp;
1035 } __attribute__ ((gcc_struct)) cond;
1036 struct
1037 {
1038 struct TypeName * typeName;
1039 struct Expression * size;
1040 } __attribute__ ((gcc_struct)) _new;
1041 struct
1042 {
1043 struct TypeName * typeName;
1044 struct Expression * size;
1045 struct Expression * exp;
1046 } __attribute__ ((gcc_struct)) _renew;
1047 struct
1048 {
1049 char * table;
1050 struct Identifier * id;
1051 } __attribute__ ((gcc_struct)) db;
1052 struct
1053 {
1054 struct Expression * ds;
1055 struct Expression * name;
1056 } __attribute__ ((gcc_struct)) dbopen;
1057 struct
1058 {
1059 struct TypeName * typeName;
1060 struct Initializer * initializer;
1061 } __attribute__ ((gcc_struct)) initializer;
1062 struct
1063 {
1064 struct Expression * exp;
1065 struct TypeName * typeName;
1066 } __attribute__ ((gcc_struct)) vaArg;
1067 } __attribute__ ((gcc_struct)) __anon1;
1068 unsigned int debugValue;
1069 struct __ecereNameSpace__ecere__com__DataValue val;
1070 uint64 address;
1071 unsigned int hasAddress;
1072 struct Type * expType;
1073 struct Type * destType;
1074 unsigned int usage;
1075 int tempCount;
1076 unsigned int byReference;
1077 unsigned int isConstant;
1078 unsigned int addedThis;
1079 unsigned int needCast;
1080 unsigned int thisPtr;
1081 unsigned int opDestType;
1082 unsigned int needTemplateCast;
1083 } __attribute__ ((gcc_struct));
1084
1085 struct Instantiation
1086 {
1087 struct Instantiation * prev;
1088 struct Instantiation * next;
1089 struct Location loc;
1090 struct Specifier * _class;
1091 struct Expression * exp;
1092 struct __ecereNameSpace__ecere__sys__OldList *  members;
1093 struct Symbol * symbol;
1094 unsigned int fullSet;
1095 unsigned int isConstant;
1096 unsigned char *  data;
1097 struct Location nameLoc;
1098 struct Location insideLoc;
1099 unsigned int built;
1100 } __attribute__ ((gcc_struct));
1101
1102 struct Declaration
1103 {
1104 struct Declaration * prev;
1105 struct Declaration * next;
1106 struct Location loc;
1107 int type;
1108 union
1109 {
1110 struct
1111 {
1112 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1113 struct __ecereNameSpace__ecere__sys__OldList *  declarators;
1114 } __attribute__ ((gcc_struct)) __anon1;
1115 struct Instantiation * inst;
1116 struct
1117 {
1118 struct Identifier * id;
1119 struct Expression * exp;
1120 } __attribute__ ((gcc_struct)) __anon2;
1121 } __attribute__ ((gcc_struct)) __anon1;
1122 struct Specifier * extStorage;
1123 struct Symbol * symbol;
1124 int declMode;
1125 } __attribute__ ((gcc_struct));
1126
1127 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1128
1129 struct MembersInit;
1130
1131 struct MembersInit
1132 {
1133 struct MembersInit * prev;
1134 struct MembersInit * next;
1135 struct Location loc;
1136 int type;
1137 union
1138 {
1139 struct __ecereNameSpace__ecere__sys__OldList *  dataMembers;
1140 struct ClassFunction * function;
1141 } __attribute__ ((gcc_struct)) __anon1;
1142 } __attribute__ ((gcc_struct));
1143
1144 struct MemberInit;
1145
1146 struct MemberInit
1147 {
1148 struct MemberInit * prev;
1149 struct MemberInit * next;
1150 struct Location loc;
1151 struct Location realLoc;
1152 struct __ecereNameSpace__ecere__sys__OldList *  identifiers;
1153 struct Initializer * initializer;
1154 unsigned int used;
1155 unsigned int variable;
1156 unsigned int takeOutExp;
1157 } __attribute__ ((gcc_struct));
1158
1159 static void CheckPublicExpression(struct Expression *  exp, int access);
1160
1161 static void CheckPublicInitializer(struct Initializer * init, int access)
1162 {
1163 switch(init->type)
1164 {
1165 case 0:
1166 CheckPublicExpression(init->__anon1.exp, access);
1167 break;
1168 case 1:
1169 {
1170 struct Initializer * i;
1171
1172 for(i = (*init->__anon1.list).first; i; i = i->next)
1173 CheckPublicInitializer(i, access);
1174 break;
1175 }
1176 }
1177 }
1178
1179 static void CheckPublicClass(struct Symbol *  classSym, int access, const char *  word);
1180
1181 static void CheckPublicTypeName(struct TypeName * type, int access)
1182 {
1183 if(type->qualifiers)
1184 {
1185 struct Specifier * spec;
1186
1187 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1188 {
1189 if(spec->type == 1)
1190 {
1191 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1192
1193 CheckPublicClass(classSym, access, "define");
1194 }
1195 }
1196 }
1197 }
1198
1199 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1200 {
1201 if(type)
1202 {
1203 switch(type->kind)
1204 {
1205 case 8:
1206 {
1207 CheckPublicClass(type->__anon1._class, access, word);
1208 break;
1209 }
1210 case 9:
1211 case 10:
1212 {
1213 break;
1214 }
1215 case 11:
1216 {
1217 struct Type * param;
1218
1219 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1220 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1221 CheckPublicDataType(param, access, word);
1222 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1223 break;
1224 }
1225 case 12:
1226 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1227 if(type->__anon1.__anon4.enumClass)
1228 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1229 break;
1230 case 13:
1231 {
1232 CheckPublicDataType(type->__anon1.type, access, word);
1233 break;
1234 }
1235 case 16:
1236 {
1237 break;
1238 }
1239 case 19:
1240 {
1241 CheckPublicClass(type->__anon1._class, access, word);
1242 break;
1243 }
1244 }
1245 }
1246 }
1247
1248 static void CheckPublicExpression(struct Expression * exp, int access)
1249 {
1250 if(exp)
1251 {
1252 switch(exp->type)
1253 {
1254 case 0:
1255 break;
1256 case 2:
1257 break;
1258 case 3:
1259 break;
1260 case 4:
1261 if(exp->__anon1.op.exp1)
1262 CheckPublicExpression(exp->__anon1.op.exp1, access);
1263 if(exp->__anon1.op.exp2)
1264 CheckPublicExpression(exp->__anon1.op.exp2, access);
1265 break;
1266 case 5:
1267 {
1268 struct Expression * e;
1269
1270 for(e = (*exp->__anon1.list).first; e; e = e->next)
1271 CheckPublicExpression(e, access);
1272 break;
1273 }
1274 case 6:
1275 {
1276 struct Expression * e;
1277
1278 CheckPublicExpression(exp->__anon1.index.exp, access);
1279 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1280 CheckPublicExpression(e, access);
1281 break;
1282 }
1283 case 7:
1284 {
1285 struct Expression * e;
1286
1287 CheckPublicExpression(exp->__anon1.call.exp, access);
1288 if(exp->__anon1.call.arguments)
1289 {
1290 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1291 CheckPublicExpression(e, access);
1292 }
1293 break;
1294 }
1295 case 8:
1296 {
1297 CheckPublicExpression(exp->__anon1.member.exp, access);
1298 break;
1299 }
1300 case 9:
1301 {
1302 CheckPublicExpression(exp->__anon1.member.exp, access);
1303 break;
1304 }
1305 case 10:
1306 CheckPublicTypeName(exp->__anon1.typeName, access);
1307 break;
1308 case 11:
1309 {
1310 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1311 if(exp->__anon1.cast.exp)
1312 CheckPublicExpression(exp->__anon1.cast.exp, access);
1313 break;
1314 }
1315 case 12:
1316 {
1317 struct Expression * e;
1318
1319 CheckPublicExpression(exp->__anon1.cond.cond, access);
1320 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1321 CheckPublicExpression(e, access);
1322 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1323 break;
1324 }
1325 case 13:
1326 case 26:
1327 CheckPublicExpression(exp->__anon1._new.size, access);
1328 break;
1329 case 14:
1330 case 27:
1331 CheckPublicExpression(exp->__anon1._renew.size, access);
1332 CheckPublicExpression(exp->__anon1._renew.exp, access);
1333 break;
1334 case 1:
1335 {
1336 struct MembersInit * members;
1337
1338 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1339 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1340 {
1341 if(members->type == 0)
1342 {
1343 struct MemberInit * member;
1344
1345 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1346 {
1347 CheckPublicInitializer(member->initializer, access);
1348 }
1349 }
1350 }
1351 break;
1352 }
1353 }
1354 }
1355 }
1356
1357 struct PropertyDef;
1358
1359 struct ClassDef
1360 {
1361 struct ClassDef * prev;
1362 struct ClassDef * next;
1363 struct Location loc;
1364 int type;
1365 union
1366 {
1367 struct Declaration * decl;
1368 struct ClassFunction * function;
1369 struct __ecereNameSpace__ecere__sys__OldList *  defProperties;
1370 struct PropertyDef * propertyDef;
1371 struct PropertyWatch * propertyWatch;
1372 char *  designer;
1373 struct Identifier * defaultProperty;
1374 struct
1375 {
1376 struct Identifier * id;
1377 struct Initializer * initializer;
1378 } __attribute__ ((gcc_struct)) __anon1;
1379 } __attribute__ ((gcc_struct)) __anon1;
1380 int memberAccess;
1381 void *  object;
1382 } __attribute__ ((gcc_struct));
1383
1384 struct PropertyDef
1385 {
1386 struct PropertyDef * prev;
1387 struct PropertyDef * next;
1388 struct Location loc;
1389 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1390 struct Declarator * declarator;
1391 struct Identifier * id;
1392 struct Statement * getStmt;
1393 struct Statement * setStmt;
1394 struct Statement * issetStmt;
1395 struct Symbol * symbol;
1396 struct Expression * category;
1397 struct
1398 {
1399 unsigned int conversion : 1;
1400 unsigned int isWatchable : 1;
1401 unsigned int isDBProp : 1;
1402 } __attribute__ ((gcc_struct)) __anon1;
1403 } __attribute__ ((gcc_struct));
1404
1405 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1406 {
1407 if(definitions != (((void *)0)))
1408 {
1409 struct ClassDef * def;
1410
1411 for(def = definitions->first; def; def = def->next)
1412 {
1413 if(def->type == 2)
1414 {
1415 struct Declaration * decl = def->__anon1.decl;
1416 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1417
1418 yylloc = def->loc;
1419 if(decl->type == 0)
1420 {
1421 struct Declarator * d;
1422
1423 if(decl->__anon1.__anon1.declarators)
1424 {
1425 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1426 {
1427 struct Identifier * declId = GetDeclId(d);
1428
1429 if(declId)
1430 {
1431 if(member)
1432 {
1433 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1434
1435 dataMember = link ? link->data : (((void *)0));
1436 }
1437 else
1438 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1439 if(dataMember)
1440 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1441 }
1442 }
1443 }
1444 else if(decl->__anon1.__anon1.specifiers)
1445 {
1446 struct Specifier * spec;
1447
1448 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1449 {
1450 if(spec->type == 3 || spec->type == 4)
1451 {
1452 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1453 {
1454 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1455 }
1456 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1457 {
1458 if(member)
1459 {
1460 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1461
1462 dataMember = link ? link->data : (((void *)0));
1463 }
1464 else
1465 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1466 if(dataMember)
1467 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1468 }
1469 }
1470 }
1471 }
1472 }
1473 else if(decl->type == 2)
1474 {
1475 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1476 }
1477 }
1478 }
1479 }
1480 }
1481
1482 struct FunctionDefinition;
1483
1484 typedef union YYSTYPE
1485 {
1486 int specifierType;
1487 int i;
1488 int declMode;
1489 struct Identifier * id;
1490 struct Expression * exp;
1491 struct Specifier * specifier;
1492 struct __ecereNameSpace__ecere__sys__OldList * list;
1493 struct Enumerator * enumerator;
1494 struct Declarator * declarator;
1495 struct Pointer * pointer;
1496 struct Initializer * initializer;
1497 struct InitDeclarator * initDeclarator;
1498 struct TypeName * typeName;
1499 struct Declaration * declaration;
1500 struct Statement * stmt;
1501 struct FunctionDefinition * function;
1502 struct External * external;
1503 struct Context * context;
1504 struct AsmField * asmField;
1505 struct Attrib * attrib;
1506 struct ExtDecl * extDecl;
1507 struct Attribute * attribute;
1508 struct Instantiation * instance;
1509 struct MembersInit * membersInit;
1510 struct MemberInit * memberInit;
1511 struct ClassFunction * classFunction;
1512 struct ClassDefinition * _class;
1513 struct ClassDef * classDef;
1514 struct PropertyDef * prop;
1515 char * string;
1516 struct Symbol * symbol;
1517 struct PropertyWatch * propertyWatch;
1518 struct TemplateParameter * templateParameter;
1519 struct TemplateArgument * templateArgument;
1520 struct TemplateDatatype * templateDatatype;
1521 struct DBTableEntry * dbtableEntry;
1522 struct DBIndexItem * dbindexItem;
1523 struct DBTableDef * dbtableDef;
1524 } __attribute__ ((gcc_struct)) YYSTYPE;
1525
1526 extern YYSTYPE yylval;
1527
1528 struct External
1529 {
1530 struct External * prev;
1531 struct External * next;
1532 struct Location loc;
1533 int type;
1534 struct Symbol * symbol;
1535 union
1536 {
1537 struct FunctionDefinition * function;
1538 struct ClassDefinition * _class;
1539 struct Declaration * declaration;
1540 char *  importString;
1541 struct Identifier * id;
1542 struct DBTableDef * table;
1543 } __attribute__ ((gcc_struct)) __anon1;
1544 int importType;
1545 struct External * fwdDecl;
1546 struct __ecereNameSpace__ecere__com__Instance * outgoing;
1547 struct __ecereNameSpace__ecere__com__Instance * incoming;
1548 int nonBreakableIncoming;
1549 } __attribute__ ((gcc_struct));
1550
1551 struct FunctionDefinition
1552 {
1553 struct FunctionDefinition * prev;
1554 struct FunctionDefinition * next;
1555 struct Location loc;
1556 struct __ecereNameSpace__ecere__sys__OldList *  specifiers;
1557 struct Declarator * declarator;
1558 struct __ecereNameSpace__ecere__sys__OldList *  declarations;
1559 struct Statement * body;
1560 struct __ecereNameSpace__ecere__com__Class * _class;
1561 struct __ecereNameSpace__ecere__sys__OldList attached;
1562 int declMode;
1563 struct Type * type;
1564 struct Symbol * propSet;
1565 int tempCount;
1566 unsigned int propertyNoThis;
1567 } __attribute__ ((gcc_struct));
1568
1569 void __ecereMethod_External_CreateUniqueEdge(struct External * this, struct External * from, unsigned int soft);
1570
1571 struct __ecereNameSpace__ecere__com__NameSpace;
1572
1573 struct __ecereNameSpace__ecere__com__NameSpace
1574 {
1575 const char *  name;
1576 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
1577 struct __ecereNameSpace__ecere__com__NameSpace *  left;
1578 struct __ecereNameSpace__ecere__com__NameSpace *  right;
1579 int depth;
1580 struct __ecereNameSpace__ecere__com__NameSpace *  parent;
1581 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1582 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1583 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1584 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1585 } __attribute__ ((gcc_struct));
1586
1587 struct __ecereNameSpace__ecere__com__Class
1588 {
1589 struct __ecereNameSpace__ecere__com__Class * prev;
1590 struct __ecereNameSpace__ecere__com__Class * next;
1591 const char *  name;
1592 int offset;
1593 int structSize;
1594 void * *  _vTbl;
1595 int vTblSize;
1596 unsigned int (*  Constructor)(void * );
1597 void (*  Destructor)(void * );
1598 int offsetClass;
1599 int sizeClass;
1600 struct __ecereNameSpace__ecere__com__Class * base;
1601 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
1602 struct __ecereNameSpace__ecere__sys__BinaryTree members;
1603 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
1604 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
1605 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
1606 struct __ecereNameSpace__ecere__sys__OldList derivatives;
1607 int memberID;
1608 int startMemberID;
1609 int type;
1610 struct __ecereNameSpace__ecere__com__Instance * module;
1611 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
1612 const char *  dataTypeString;
1613 struct Type * dataType;
1614 int typeSize;
1615 int defaultAlignment;
1616 void (*  Initialize)();
1617 int memberOffset;
1618 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
1619 const char *  designerClass;
1620 unsigned int noExpansion;
1621 const char *  defaultProperty;
1622 unsigned int comRedefinition;
1623 int count;
1624 int isRemote;
1625 unsigned int internalDecl;
1626 void *  data;
1627 unsigned int computeSize;
1628 short structAlignment;
1629 short pointerAlignment;
1630 int destructionWatchOffset;
1631 unsigned int fixed;
1632 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
1633 int inheritanceAccess;
1634 const char *  fullName;
1635 void *  symbol;
1636 struct __ecereNameSpace__ecere__sys__OldList conversions;
1637 struct __ecereNameSpace__ecere__sys__OldList templateParams;
1638 struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
1639 struct __ecereNameSpace__ecere__com__Class * templateClass;
1640 struct __ecereNameSpace__ecere__sys__OldList templatized;
1641 int numParams;
1642 unsigned int isInstanceClass;
1643 unsigned int byValueSystemClass;
1644 } __attribute__ ((gcc_struct));
1645
1646 struct __ecereNameSpace__ecere__com__Application
1647 {
1648 int argc;
1649 const char * *  argv;
1650 int exitCode;
1651 unsigned int isGUIApp;
1652 struct __ecereNameSpace__ecere__sys__OldList allModules;
1653 char *  parsedCommand;
1654 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1655 } __attribute__ ((gcc_struct));
1656
1657 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1658 {
1659 if(ns == parent)
1660 return 1;
1661 else if((*ns).parent)
1662 return NameSpaceContained((*ns).parent, parent);
1663 else
1664 return 0;
1665 }
1666
1667 static void AddSimpleBaseMembers(struct External * external, struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1668 {
1669 if(_class->type != 1000)
1670 AddMembers(external, list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1671 }
1672
1673 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
1674
1675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
1676
1677 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1678
1679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1680
1681 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__LinkList;
1682
1683 struct __ecereNameSpace__ecere__com__Module
1684 {
1685 struct __ecereNameSpace__ecere__com__Instance * application;
1686 struct __ecereNameSpace__ecere__sys__OldList classes;
1687 struct __ecereNameSpace__ecere__sys__OldList defines;
1688 struct __ecereNameSpace__ecere__sys__OldList functions;
1689 struct __ecereNameSpace__ecere__sys__OldList modules;
1690 struct __ecereNameSpace__ecere__com__Instance * prev;
1691 struct __ecereNameSpace__ecere__com__Instance * next;
1692 const char *  name;
1693 void *  library;
1694 void *  Unload;
1695 int importType;
1696 int origImportType;
1697 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1698 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1699 } __attribute__ ((gcc_struct));
1700
1701 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
1702 {
1703
1704 }
1705
1706 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1707 {
1708 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1709
1710 if(regClass)
1711 {
1712 if(regClass->templateClass)
1713 regClass = regClass->templateClass;
1714 if(classSym->isStatic && access != 3)
1715 {
1716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1717 }
1718 else if(access == 1)
1719 {
1720 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->application + sizeof(struct __ecereNameSpace__ecere__com__Module) + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->systemNameSpace))
1721 {
1722 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1723 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1724 }
1725 }
1726 }
1727 }
1728
1729 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, struct ExtDecl * extDecl)
1730 {
1731 char structName[1024];
1732 char className[1024];
1733 char constructorName[1024];
1734 char destructorName[1024];
1735 struct __ecereNameSpace__ecere__com__Class * regClass;
1736 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1737 unsigned int isUnion = classType == 6;
1738 struct External * external = (((void *)0));
1739 struct ClassDef * def;
1740 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1741 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1742
1743 if(inCompiler)
1744 {
1745 list = MkList();
1746 classDataList = MkList();
1747 }
1748 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1749 if(!regClass)
1750 return ;
1751 classType = regClass->type;
1752 if(inCompiler)
1753 {
1754 yylloc = *loc;
1755 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && regClass->inheritanceAccess == 1)
1756 {
1757 if(!regClass->base->symbol)
1758 regClass->base->symbol = FindClass(regClass->base->fullName);
1759 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1760 }
1761 else if(!symbol->isStatic && regClass->base)
1762 {
1763 if(!regClass->base->symbol)
1764 regClass->base->symbol = FindClass(regClass->base->fullName);
1765 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1766 }
1767 }
1768 if(definitions != (((void *)0)))
1769 {
1770 for(def = definitions->first; def; def = def->next)
1771 {
1772 if(def->type == 13)
1773 {
1774 struct __ecereNameSpace__ecere__com__DataMember * member;
1775 struct __ecereNameSpace__ecere__com__Property * prop;
1776 struct __ecereNameSpace__ecere__com__Method * method;
1777
1778 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1779 {
1780 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1781 }
1782 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1783 {
1784 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1785 }
1786 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1787 {
1788 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1789 }
1790 else
1791 {
1792 yylloc = def->loc;
1793 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1794 }
1795 }
1796 }
1797 }
1798 if(inCompiler)
1799 {
1800 external = MkExternalDeclaration((((void *)0)));
1801 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1802 curExternal = external;
1803 curExternal->symbol = symbol;
1804 }
1805 if((classType == 1 || classType == 5) && inCompiler)
1806 {
1807 AddSimpleBaseMembers(external, list, regClass->base, regClass);
1808 }
1809 if(definitions != (((void *)0)))
1810 {
1811 if(inCompiler)
1812 {
1813 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
1814 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1815 else if(!symbol->isStatic)
1816 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1817 }
1818 for(def = definitions->first; def; def = def->next)
1819 {
1820 yylloc = def->loc;
1821 if(def->type == 2)
1822 {
1823 struct Declaration * decl = def->__anon1.decl;
1824
1825 yylloc = decl->loc;
1826 if(decl->type == 0)
1827 {
1828 if(inCompiler && classType != 2)
1829 {
1830 ListAdd(list, MkClassDefDeclaration(decl));
1831 def->__anon1.decl = (((void *)0));
1832 }
1833 }
1834 else if(decl->type == 2)
1835 {
1836 struct Instantiation * inst = decl->__anon1.inst;
1837 struct Expression * exp = inst->exp;
1838 struct Symbol * classSym;
1839
1840 if(exp)
1841 {
1842 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1843 struct Declarator * d;
1844
1845 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1846 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1847 if(inCompiler)
1848 {
1849 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1850
1851 ListAdd(declarators, d);
1852 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1853 ListAdd(list, MkClassDefDeclaration(decl));
1854 exp->type = 8;
1855 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1856 exp->__anon1.member.exp = QMkExpId("this");
1857 exp->__anon1.member.memberType = 3;
1858 exp->__anon1.member.thisPtr = 1;
1859 }
1860 else
1861 {
1862 FreeDeclarator(d);
1863 FreeList(specifiers, (void *)(FreeSpecifier));
1864 }
1865 }
1866 classSym = inst->_class->__anon1.__anon1.symbol;
1867 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1868 {
1869 if(inst->members && (*inst->members).count)
1870 symbol->needConstructor = 1;
1871 }
1872 else
1873 {
1874 symbol->needConstructor = 1;
1875 symbol->needDestructor = 1;
1876 }
1877 }
1878 }
1879 else if(def->type == 9)
1880 {
1881 struct Declaration * decl = def->__anon1.decl;
1882
1883 if(decl->type == 0)
1884 {
1885 if(inCompiler && classType != 2)
1886 {
1887 ListAdd(classDataList, MkClassDefDeclaration(decl));
1888 def->__anon1.decl = (((void *)0));
1889 }
1890 }
1891 }
1892 else if(def->type == 1)
1893 symbol->needConstructor = 1;
1894 else if(def->type == 4)
1895 symbol->needConstructor = 1;
1896 else if(def->type == 0)
1897 {
1898 struct ClassFunction * func = def->__anon1.function;
1899
1900 if(func->isDestructor)
1901 {
1902 if(destructor)
1903 {
1904 yylloc = *loc;
1905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1906 }
1907 else
1908 {
1909 symbol->needDestructor = 1;
1910 destructor = func;
1911 if(!inCompiler && func->body)
1912 {
1913 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1914
1915 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1916 }
1917 }
1918 }
1919 if(func->isConstructor)
1920 {
1921 if(constructor)
1922 {
1923 yylloc = *loc;
1924 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1925 }
1926 else
1927 {
1928 symbol->needConstructor = 1;
1929 constructor = func;
1930 if(!inCompiler && func->body)
1931 {
1932 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1933
1934 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1935 }
1936 }
1937 }
1938 }
1939 }
1940 }
1941 if(inCompiler)
1942 {
1943 external->symbol = (((void *)0));
1944 if((*list).count)
1945 {
1946 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1947
1948 initDeclarators = (((void *)0));
1949 strcpy(structName, symbol->string);
1950 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1951 {
1952 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1953
1954 spec->__anon1.__anon2.extDeclStruct = extDecl;
1955 ListAdd(specs, spec);
1956 }
1957 external->symbol = symbol;
1958 if(symbol->__anon2.__anon1.structExternal)
1959 {
1960 {
1961 struct TopoEdge * e;
1962 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->incoming;
1963
1964 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1965 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1966
1967 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1968 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1969 __ecereMethod_External_CreateUniqueEdge(external, e->from, e->breakable);
1970 }
1971 {
1972 struct TopoEdge * e;
1973 struct __ecereNameSpace__ecere__com__Instance * __internalLinkList = symbol->__anon2.__anon1.structExternal->outgoing;
1974
1975 for(e = ((struct __ecereNameSpace__ecere__com__LinkList *)(((char *)__internalLinkList + 0 + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->first; e; e = (struct TopoEdge *)((struct __ecereNameSpace__ecere__com__IteratorPointer * (*)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__IteratorPointer * pointer))__extension__ ({
1976 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = __internalLinkList;
1977
1978 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__com__LinkList->_vTbl;
1979 })[__ecereVMethodID___ecereNameSpace__ecere__com__Container_GetNext])(__internalLinkList, (struct __ecereNameSpace__ecere__com__IteratorPointer *)e))
1980 __ecereMethod_External_CreateUniqueEdge(e->to, external, e->breakable);
1981 }
1982 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), symbol->__anon2.__anon1.structExternal);
1983 FreeExternal(symbol->__anon2.__anon1.structExternal);
1984 }
1985 symbol->__anon2.__anon1.structExternal = external;
1986 external->__anon1.declaration = MkDeclaration(specs, declarators);
1987 after = external;
1988 symbol->declaredStruct = 1;
1989 }
1990 else
1991 {
1992 curExternal = external->prev;
1993 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1994 FreeExternal(external);
1995 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1996 }
1997 if((*classDataList).count)
1998 {
1999 char classDataStructName[1024];
2000 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2001 struct External * external;
2002
2003 strcpy(classDataStructName, "__ecereClassData_");
2004 FullClassNameCat(classDataStructName, symbol->string, 0);
2005 declMode = structDeclMode = 0;
2006 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
2007 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
2008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
2009 after = external;
2010 symbol->classData = 1;
2011 }
2012 else
2013 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
2014 }
2015 if(inCompiler)
2016 {
2017 {
2018 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2019
2020 strcpy(className, "__ecereClass_");
2021 FullClassNameCat(className, symbol->string, 1);
2022 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2023 if(!strstr(sourceFile, ".main.ec"))
2024 ListAdd(specs, MkSpecifier(STATIC));
2025 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2026 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2027 symbol->__anon2.__anon1.pointerExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2028 DeclareStruct(symbol->__anon2.__anon1.pointerExternal, "ecere::com::Class", 0, 1);
2029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon1.pointerExternal);
2030 after = symbol->__anon2.__anon3.methodExternal;
2031 }
2032 if(symbol->needDestructor)
2033 {
2034 struct ClassFunction * function;
2035 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2036 struct Declarator * decl;
2037 struct Statement * body;
2038 struct Context * context;
2039 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2040
2041 strcpy(destructorName, "__ecereDestructor_");
2042 FullClassNameCat(destructorName, symbol->string, 0);
2043 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2044 ListAdd(specs, MkSpecifier(VOID));
2045 context = PushContext();
2046 statements = MkList();
2047 if(definitions != (((void *)0)))
2048 {
2049 for(def = definitions->first; def; def = def->next)
2050 {
2051 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2052 {
2053 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2054 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2055
2056 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2057 {
2058 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2059
2060 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2061 }
2062 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2063 {
2064 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2065
2066 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2067 }
2068 }
2069 }
2070 }
2071 if(destructor && destructor->body)
2072 {
2073 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2074 destructor->body->__anon1.compound.context->parent = context;
2075 destructor->body = (((void *)0));
2076 }
2077 body = MkCompoundStmt(declarations, statements);
2078 PopContext(context);
2079 body->__anon1.compound.context = context;
2080 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2081 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2082 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2083 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2084 ProcessClassFunctionBody(function, body);
2085 function->dontMangle = 1;
2086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2087 }
2088 if(symbol->needConstructor && inCompiler)
2089 {
2090 struct ClassFunction * function;
2091 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2092 struct Declarator * decl;
2093 struct Statement * body;
2094 struct Context * context;
2095 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2096
2097 strcpy(constructorName, "__ecereConstructor_");
2098 FullClassNameCat(constructorName, symbol->string, 0);
2099 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2100 ListAdd(specs, MkSpecifierName("bool"));
2101 context = PushContext();
2102 statements = MkList();
2103 if(definitions != (((void *)0)))
2104 {
2105 for(def = definitions->first; def; def = def->next)
2106 {
2107 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2108 {
2109 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2110 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2111
2112 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2113 {
2114 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2115
2116 *newInst = *inst;
2117 newInst->members = (((void *)0));
2118 newInst->exp = CopyExpression(inst->exp);
2119 newInst->_class = CopySpecifier(inst->_class);
2120 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2121 inst->built = 1;
2122 }
2123 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2124 {
2125 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2126 }
2127 }
2128 }
2129 for(def = definitions->first; def; def = def->next)
2130 {
2131 if(def->type == 1 && def->__anon1.defProperties)
2132 {
2133 struct MemberInit * propertyDef;
2134
2135 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2136 {
2137 struct Expression * memberExp;
2138 struct Identifier * id = (*propertyDef->identifiers).first;
2139
2140 if(id)
2141 {
2142 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2143 for(id = id->next; id; id = id->next)
2144 memberExp = MkExpMember(memberExp, id);
2145 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2146 }
2147 if(propertyDef->initializer)
2148 {
2149 if(propertyDef->initializer->type == 0)
2150 propertyDef->initializer->__anon1.exp = (((void *)0));
2151 FreeInitializer(propertyDef->initializer);
2152 }
2153 propertyDef->initializer = (((void *)0));
2154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2155 }
2156 }
2157 }
2158 for(def = definitions->first; def; def = def->next)
2159 {
2160 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2161 {
2162 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2163 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2164
2165 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2166 {
2167 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2168 {
2169 def->__anon1.decl->__anon1.inst = (((void *)0));
2170 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2171 }
2172 }
2173 }
2174 }
2175 }
2176 if(constructor && constructor->body)
2177 {
2178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2179 constructor->body->__anon1.compound.context->parent = context;
2180 constructor->body = (((void *)0));
2181 }
2182 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2183 body = MkCompoundStmt(declarations, statements);
2184 PopContext(context);
2185 body->__anon1.compound.context = context;
2186 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2187 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2188 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2189 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2190 ProcessClassFunctionBody(function, body);
2191 function->dontMangle = 1;
2192 if(definitions != (((void *)0)))
2193 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2194 }
2195 }
2196 if(definitions != (((void *)0)))
2197 {
2198 for(def = definitions->first; def; def = def->next)
2199 {
2200 if(def->type == 3 && def->__anon1.propertyDef)
2201 {
2202 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2203 struct ClassDef * after = def;
2204 struct ClassDef * newDef;
2205
2206 if(inCompiler)
2207 {
2208 yylloc = propertyDef->loc;
2209 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && def->memberAccess == 1)
2210 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2211 else if(!symbol->isStatic)
2212 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2213 }
2214 {
2215 {
2216 struct ClassFunction * func;
2217 struct Declarator * decl;
2218 char name[1024];
2219 struct __ecereNameSpace__ecere__sys__OldList * params;
2220
2221 if(propertyDef->getStmt && propertyDef->id)
2222 {
2223 strcpy(name, "__ecereProp_");
2224 FullClassNameCat(name, symbol->string, 0);
2225 strcat(name, "_Get_");
2226 FullClassNameCat(name, propertyDef->id->string, 1);
2227 params = MkList();
2228 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2229 {
2230 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2231 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2232 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2233 }
2234 else
2235 {
2236 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2237 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2238 }
2239 ProcessClassFunctionBody(func, propertyDef->getStmt);
2240 func->declarator->symbol = propertyDef->symbol;
2241 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2242 func->dontMangle = 1;
2243 newDef = MkClassDefFunction(func);
2244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2245 after = newDef;
2246 if(inCompiler)
2247 propertyDef->getStmt = (((void *)0));
2248 else
2249 func->body = (((void *)0));
2250 }
2251 if(propertyDef->setStmt && propertyDef->id)
2252 {
2253 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2254
2255 strcpy(name, "__ecereProp_");
2256 FullClassNameCat(name, symbol->string, 0);
2257 strcat(name, "_Set_");
2258 FullClassNameCat(name, propertyDef->id->string, 1);
2259 params = MkList();
2260 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2261 if(propertyDef->__anon1.isDBProp)
2262 {
2263 struct Specifier * spec;
2264 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2265
2266 for(spec = (*specs).first; spec; spec = spec->next)
2267 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2268 break;
2269 if(!spec)
2270 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2271 }
2272 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2273 {
2274 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2275 unsigned int useVoid = 0;
2276
2277 switch(regClass->type)
2278 {
2279 case 1:
2280 case 6:
2281 useVoid = 1;
2282 break;
2283 case 5:
2284 case 0:
2285 useVoid = !isConversion;
2286 break;
2287 default:
2288 useVoid = !isConversion;
2289 if(useVoid && !propertyDef->__anon1.isDBProp)
2290 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2291 }
2292 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2293 }
2294 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2295 ProcessClassFunctionBody(func, propertyDef->setStmt);
2296 func->dontMangle = 1;
2297 func->declarator->symbol = propertyDef->symbol;
2298 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2299 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2300 func->propSet = propertyDef->symbol;
2301 newDef = MkClassDefFunction(func);
2302 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2303 after = newDef;
2304 if(inCompiler)
2305 propertyDef->setStmt = (((void *)0));
2306 else
2307 func->body = (((void *)0));
2308 }
2309 if(propertyDef->issetStmt && propertyDef->id)
2310 {
2311 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2312
2313 strcpy(name, "__ecereProp_");
2314 FullClassNameCat(name, symbol->string, 0);
2315 strcat(name, "_IsSet_");
2316 FullClassNameCat(name, propertyDef->id->string, 1);
2317 params = MkList();
2318 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2319 ListAdd(specifiers, MkSpecifierName("bool"));
2320 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2321 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2322 func->dontMangle = 1;
2323 func->declarator->symbol = propertyDef->symbol;
2324 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2325 newDef = MkClassDefFunction(func);
2326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2327 after = newDef;
2328 if(inCompiler)
2329 propertyDef->issetStmt = (((void *)0));
2330 else
2331 func->body = (((void *)0));
2332 }
2333 if(propertyDef->id && inCompiler)
2334 {
2335 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2336 struct Declaration * decl;
2337 struct External * external;
2338 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2339
2340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2341 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2342 ListAdd(specifiers, MkSpecifierName("Property"));
2343 strcpy(name, "__ecereProp_");
2344 FullClassNameCat(name, symbol->string, 0);
2345 strcat(name, "_");
2346 FullClassNameCat(name, propertyDef->id->string, 1);
2347 {
2348 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2349
2350 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2351 strcpy(name, "__ecerePropM_");
2352 FullClassNameCat(name, symbol->string, 0);
2353 strcat(name, "_");
2354 FullClassNameCat(name, propertyDef->id->string, 1);
2355 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2356 decl = MkDeclaration(specifiers, list);
2357 }
2358 external = MkExternalDeclaration(decl);
2359 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2360 external->symbol = propertyDef->symbol;
2361 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2362 if(inCompiler && prop && prop->symbol)
2363 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2364 }
2365 }
2366 }
2367 }
2368 else if(def->type == 10 && def->__anon1.propertyDef)
2369 {
2370 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2371 struct ClassDef * after = def;
2372 struct ClassDef * newDef;
2373
2374 {
2375 if(inCompiler)
2376 {
2377 yylloc = propertyDef->loc;
2378 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace))
2379 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2380 else if(!symbol->isStatic)
2381 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2382 }
2383 {
2384 struct ClassFunction * func;
2385 struct Declarator * decl;
2386 char name[1024];
2387 struct __ecereNameSpace__ecere__sys__OldList * params;
2388
2389 if(propertyDef->getStmt && propertyDef->id)
2390 {
2391 struct Declarator * declId;
2392
2393 sprintf(name, "class::__ecereClassProp_");
2394 FullClassNameCat(name, symbol->string, 0);
2395 strcat(name, "_Get_");
2396 strcat(name, propertyDef->id->string);
2397 params = MkList();
2398 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2399 {
2400 decl = MkDeclaratorFunction(declId, params);
2401 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2402 }
2403 ProcessClassFunctionBody(func, propertyDef->getStmt);
2404 func->declarator->symbol = propertyDef->symbol;
2405 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2406 func->dontMangle = 1;
2407 newDef = MkClassDefFunction(func);
2408 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2409 after = newDef;
2410 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2411 func->type = ProcessType(propertyDef->specifiers, decl);
2412 FreeDeclarator(decl);
2413 if(func->type->__anon1.__anon2.returnType->kind == 8 && func->type->__anon1.__anon2.returnType->__anon1._class && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered->type == 1)
2414 func->type->__anon1.__anon2.returnType->byReference = 1;
2415 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2416 if(inCompiler)
2417 propertyDef->getStmt = (((void *)0));
2418 else
2419 func->body = (((void *)0));
2420 }
2421 if(propertyDef->setStmt && propertyDef->id)
2422 {
2423 struct Context * prevCurContext;
2424 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2425 struct Statement * body = propertyDef->setStmt;
2426 struct Declarator * ptrDecl;
2427 struct Expression * e;
2428
2429 strcpy(name, "class::__ecereClassProp_");
2430 FullClassNameCat(name, symbol->string, 0);
2431 strcat(name, "_Set_");
2432 strcat(name, propertyDef->id->string);
2433 params = MkList();
2434 prevCurContext = curContext;
2435 curContext = body->__anon1.compound.context;
2436 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2437 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2438 if(!body->__anon1.compound.declarations)
2439 body->__anon1.compound.declarations = MkList();
2440 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2441 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2442 else
2443 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2444 e = MkExpIdentifier(MkIdentifier("_value"));
2445 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2446 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2447 ListAdd(body->__anon1.compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), CopyDeclarator(propertyDef->declarator)), e))))));
2448 curContext = prevCurContext;
2449 {
2450 struct Symbol * sym = ptrDecl->symbol;
2451
2452 sym->isParam = 1;
2453 FreeType(sym->type);
2454 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2455 }
2456 ListAdd(specifiers, MkSpecifier(VOID));
2457 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2458 ProcessClassFunctionBody(func, propertyDef->setStmt);
2459 func->dontMangle = 1;
2460 func->declarator->symbol = propertyDef->symbol;
2461 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2462 newDef = MkClassDefFunction(func);
2463 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2464 after = newDef;
2465 if(inCompiler)
2466 propertyDef->setStmt = (((void *)0));
2467 else
2468 func->body = (((void *)0));
2469 }
2470 }
2471 }
2472 }
2473 else if(def->type == 0 && def->__anon1.function->declarator)
2474 {
2475 struct ClassFunction * func = def->__anon1.function;
2476
2477 func->_class = regClass;
2478 if(!func->dontMangle)
2479 {
2480 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2481 struct Identifier * id = GetDeclId(funcDecl);
2482 struct __ecereNameSpace__ecere__com__Method * method;
2483
2484 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2485 {
2486 if(!funcDecl->__anon1.function.parameters)
2487 funcDecl->__anon1.function.parameters = MkList();
2488 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2489 }
2490 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2491 FreeSpecifier(id->_class);
2492 id->_class = (((void *)0));
2493 if(inCompiler && method)
2494 {
2495 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2496
2497 newId[0] = '\0';
2498 ProcessMethodType(method);
2499 yylloc = def->loc;
2500 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + sizeof(struct __ecereNameSpace__ecere__com__Instance))))->privateNameSpace) && method->memberAccess == 1)
2501 CheckPublicDataType(method->dataType, 1, "class method");
2502 strcpy(newId, "__ecereMethod_");
2503 FullClassNameCat(newId, symbol->string, 0);
2504 strcat(newId, "_");
2505 strcat(newId, id->string);
2506 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2507 id->string = newId;
2508 if(method->type != 1)
2509 {
2510 if(method->symbol)
2511 {
2512 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2513 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2514 }
2515 }
2516 }
2517 }
2518 }
2519 }
2520 }
2521 if(initDeclarators != (((void *)0)))
2522 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2523 }
2524
2525 void PreProcessClassDefinitions()
2526 {
2527 struct External * external, * next;
2528
2529 curExternal = (((void *)0));
2530 if(ast)
2531 {
2532 for(external = (*ast).first; external; external = next)
2533 {
2534 next = external->next;
2535 curExternal = external;
2536 if(external->type == 2)
2537 {
2538 struct ClassDefinition * _class = external->__anon1._class;
2539
2540 if(_class->definitions)
2541 {
2542 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2543 }
2544 }
2545 else if(external->type == 1)
2546 {
2547 struct Declaration * declaration = external->__anon1.declaration;
2548
2549 if(declaration && declaration->type == 1)
2550 {
2551 if(declaration->__anon1.__anon1.specifiers)
2552 {
2553 struct Specifier * specifier;
2554
2555 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2556 {
2557 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)))
2558 {
2559 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2560
2561 if(symbol)
2562 {
2563 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2564 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2565
2566 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2567 if(inCompiler)
2568 {
2569 initDeclarators = declaration->__anon1.__anon1.declarators;
2570 declaration->__anon1.__anon1.declarators = (((void *)0));
2571 }
2572 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2573 }
2574 }
2575 }
2576 }
2577 }
2578 else if(declaration && inCompiler && declaration->type == 3)
2579 {
2580 yylloc = declaration->loc;
2581 if(declaration->declMode == 1)
2582 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2583 else if(declaration->declMode != 3)
2584 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2585 }
2586 }
2587 else if(external->type == 3)
2588 {
2589 }
2590 else if(inCompiler && external->type == 0)
2591 {
2592 yylloc = external->__anon1.function->loc;
2593 if(!external->__anon1.function->type)
2594 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2595 if(external->__anon1.function->declMode == 1)
2596 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2597 else if(external->__anon1.function->declMode != 3)
2598 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2599 }
2600 }
2601 }
2602 }
2603
2604 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2605 {
2606 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2607
2608 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2610 }
2611