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