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