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