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