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