1 /* Code generated from eC source file: pass0.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
44 struct __ecereNameSpace__ecere__com__Instance;
46 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
48 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
50 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
52 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
54 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
56 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
58 struct __ecereNameSpace__ecere__sys__BTNode;
60 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
62 struct __ecereNameSpace__ecere__sys__BinaryTree
64 struct __ecereNameSpace__ecere__sys__BTNode * root;
66 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
67 void (* FreeKey)(void * key);
68 } __attribute__ ((gcc_struct));
70 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
72 struct __ecereNameSpace__ecere__sys__OldList
79 } __attribute__ ((gcc_struct));
81 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
83 struct __ecereNameSpace__ecere__com__Method
86 struct __ecereNameSpace__ecere__com__Method * parent;
87 struct __ecereNameSpace__ecere__com__Method * left;
88 struct __ecereNameSpace__ecere__com__Method * right;
93 struct __ecereNameSpace__ecere__com__Class * _class;
95 const char * dataTypeString;
96 struct Type * dataType;
98 } __attribute__ ((gcc_struct));
100 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
102 struct __ecereNameSpace__ecere__com__Property
104 struct __ecereNameSpace__ecere__com__Property * prev;
105 struct __ecereNameSpace__ecere__com__Property * next;
107 unsigned int isProperty;
110 struct __ecereNameSpace__ecere__com__Class * _class;
111 const char * dataTypeString;
112 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
113 struct Type * dataType;
114 void (* Set)(void * , int);
115 int (* Get)(void * );
116 unsigned int (* IsSet)(void * );
120 unsigned int conversion;
121 unsigned int watcherOffset;
122 const char * category;
123 unsigned int compiled;
124 unsigned int selfWatchable;
125 unsigned int isWatchable;
126 } __attribute__ ((gcc_struct));
128 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
136 } __attribute__ ((gcc_struct));
138 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
142 struct CodePosition start;
143 struct CodePosition end;
144 } __attribute__ ((gcc_struct));
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
156 struct ClassDefinition
158 struct ClassDefinition * prev;
159 struct ClassDefinition * next;
161 struct Specifier * _class;
162 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
163 struct __ecereNameSpace__ecere__sys__OldList * definitions;
164 struct Symbol * symbol;
165 struct Location blockStart;
166 struct Location nameLoc;
169 unsigned int deleteWatchable;
170 } __attribute__ ((gcc_struct));
172 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
176 struct Context * parent;
177 struct __ecereNameSpace__ecere__sys__BinaryTree types;
178 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
179 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
180 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
183 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
184 struct ClassDefinition * classDef;
185 unsigned int templateTypesOnly;
186 unsigned int hasNameSpace;
187 } __attribute__ ((gcc_struct));
189 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
193 struct Instantiation * prev;
194 struct Instantiation * next;
196 struct Specifier * _class;
197 struct Expression * exp;
198 struct __ecereNameSpace__ecere__sys__OldList * members;
199 struct Symbol * symbol;
200 unsigned int fullSet;
201 unsigned int isConstant;
202 unsigned char * data;
203 struct Location nameLoc;
204 struct Location insideLoc;
206 } __attribute__ ((gcc_struct));
208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
212 struct Declaration * prev;
213 struct Declaration * next;
220 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
221 struct __ecereNameSpace__ecere__sys__OldList * declarators;
222 } __attribute__ ((gcc_struct)) __anon1;
223 struct Instantiation * inst;
226 struct Identifier * id;
227 struct Expression * exp;
228 } __attribute__ ((gcc_struct)) __anon2;
229 } __attribute__ ((gcc_struct)) __anon1;
230 struct Specifier * extStorage;
231 struct Symbol * symbol;
233 } __attribute__ ((gcc_struct));
235 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
239 struct Statement * prev;
240 struct Statement * next;
245 struct __ecereNameSpace__ecere__sys__OldList * expressions;
248 struct Identifier * id;
249 struct Statement * stmt;
250 } __attribute__ ((gcc_struct)) labeled;
253 struct Expression * exp;
254 struct Statement * stmt;
255 } __attribute__ ((gcc_struct)) caseStmt;
258 struct __ecereNameSpace__ecere__sys__OldList * declarations;
259 struct __ecereNameSpace__ecere__sys__OldList * statements;
260 struct Context * context;
261 unsigned int isSwitch;
262 } __attribute__ ((gcc_struct)) compound;
265 struct __ecereNameSpace__ecere__sys__OldList * exp;
266 struct Statement * stmt;
267 struct Statement * elseStmt;
268 } __attribute__ ((gcc_struct)) ifStmt;
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 } __attribute__ ((gcc_struct)) switchStmt;
276 struct __ecereNameSpace__ecere__sys__OldList * exp;
277 struct Statement * stmt;
278 } __attribute__ ((gcc_struct)) whileStmt;
281 struct __ecereNameSpace__ecere__sys__OldList * exp;
282 struct Statement * stmt;
283 } __attribute__ ((gcc_struct)) doWhile;
286 struct Statement * init;
287 struct Statement * check;
288 struct __ecereNameSpace__ecere__sys__OldList * increment;
289 struct Statement * stmt;
290 } __attribute__ ((gcc_struct)) forStmt;
293 struct Identifier * id;
294 } __attribute__ ((gcc_struct)) gotoStmt;
297 struct Specifier * spec;
299 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
300 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
301 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
302 } __attribute__ ((gcc_struct)) asmStmt;
305 struct Expression * watcher;
306 struct Expression * object;
307 struct __ecereNameSpace__ecere__sys__OldList * watches;
308 } __attribute__ ((gcc_struct)) _watch;
311 struct Identifier * id;
312 struct __ecereNameSpace__ecere__sys__OldList * exp;
313 struct __ecereNameSpace__ecere__sys__OldList * filter;
314 struct Statement * stmt;
315 } __attribute__ ((gcc_struct)) forEachStmt;
316 struct Declaration * decl;
317 } __attribute__ ((gcc_struct)) __anon1;
318 } __attribute__ ((gcc_struct));
320 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
324 struct TypeName * prev;
325 struct TypeName * next;
327 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
328 struct Declarator * declarator;
330 struct Expression * bitCount;
331 } __attribute__ ((gcc_struct));
333 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
337 struct Initializer * prev;
338 struct Initializer * next;
343 struct Expression * exp;
344 struct __ecereNameSpace__ecere__sys__OldList * list;
345 } __attribute__ ((gcc_struct)) __anon1;
346 unsigned int isConstant;
347 struct Identifier * id;
348 } __attribute__ ((gcc_struct));
350 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
352 struct __ecereNameSpace__ecere__com__DataValue
367 } __attribute__ ((gcc_struct)) __anon1;
368 } __attribute__ ((gcc_struct));
370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
374 struct Expression * prev;
375 struct Expression * next;
383 struct Identifier * identifier;
384 } __attribute__ ((gcc_struct)) __anon1;
385 struct Statement * compound;
386 struct Instantiation * instance;
390 unsigned int intlString;
391 } __attribute__ ((gcc_struct)) __anon2;
392 struct __ecereNameSpace__ecere__sys__OldList * list;
395 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
396 struct Declarator * decl;
397 } __attribute__ ((gcc_struct)) _classExp;
400 struct Identifier * id;
401 } __attribute__ ((gcc_struct)) classData;
404 struct Expression * exp;
405 struct __ecereNameSpace__ecere__sys__OldList * arguments;
406 struct Location argLoc;
407 } __attribute__ ((gcc_struct)) call;
410 struct Expression * exp;
411 struct __ecereNameSpace__ecere__sys__OldList * index;
412 } __attribute__ ((gcc_struct)) index;
415 struct Expression * exp;
416 struct Identifier * member;
418 unsigned int thisPtr;
419 } __attribute__ ((gcc_struct)) member;
423 struct Expression * exp1;
424 struct Expression * exp2;
425 } __attribute__ ((gcc_struct)) op;
426 struct TypeName * typeName;
427 struct Specifier * _class;
430 struct TypeName * typeName;
431 struct Expression * exp;
432 } __attribute__ ((gcc_struct)) cast;
435 struct Expression * cond;
436 struct __ecereNameSpace__ecere__sys__OldList * exp;
437 struct Expression * elseExp;
438 } __attribute__ ((gcc_struct)) cond;
441 struct TypeName * typeName;
442 struct Expression * size;
443 } __attribute__ ((gcc_struct)) _new;
446 struct TypeName * typeName;
447 struct Expression * size;
448 struct Expression * exp;
449 } __attribute__ ((gcc_struct)) _renew;
453 struct Identifier * id;
454 } __attribute__ ((gcc_struct)) db;
457 struct Expression * ds;
458 struct Expression * name;
459 } __attribute__ ((gcc_struct)) dbopen;
462 struct TypeName * typeName;
463 struct Initializer * initializer;
464 } __attribute__ ((gcc_struct)) initializer;
467 struct Expression * exp;
468 struct TypeName * typeName;
469 } __attribute__ ((gcc_struct)) vaArg;
470 } __attribute__ ((gcc_struct)) __anon1;
471 unsigned int debugValue;
472 struct __ecereNameSpace__ecere__com__DataValue val;
474 unsigned int hasAddress;
475 struct Type * expType;
476 struct Type * destType;
479 unsigned int byReference;
480 unsigned int isConstant;
481 unsigned int addedThis;
482 unsigned int needCast;
483 unsigned int thisPtr;
484 unsigned int opDestType;
485 unsigned int needTemplateCast;
486 } __attribute__ ((gcc_struct));
488 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
490 struct TemplateDatatype;
492 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
494 struct TemplateArgument;
496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
498 struct TemplateParameter;
500 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
504 struct Specifier * prev;
505 struct Specifier * next;
513 struct ExtDecl * extDecl;
515 struct Symbol * symbol;
516 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
517 } __attribute__ ((gcc_struct)) __anon1;
520 struct Identifier * id;
521 struct __ecereNameSpace__ecere__sys__OldList * list;
522 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
523 struct __ecereNameSpace__ecere__sys__OldList * definitions;
524 unsigned int addNameSpace;
525 struct Context * ctx;
526 struct ExtDecl * extDeclStruct;
527 } __attribute__ ((gcc_struct)) __anon2;
528 struct Expression * expression;
529 struct Specifier * _class;
530 struct TemplateParameter * templateParameter;
531 } __attribute__ ((gcc_struct)) __anon1;
532 } __attribute__ ((gcc_struct));
534 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
538 struct Identifier * prev;
539 struct Identifier * next;
541 struct Symbol * classSym;
542 struct Specifier * _class;
544 struct Identifier * badID;
545 } __attribute__ ((gcc_struct));
547 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
555 struct Declarator * prev;
556 struct Declarator * next;
559 struct Symbol * symbol;
560 struct Declarator * declarator;
563 struct Identifier * identifier;
566 struct Expression * exp;
567 struct Expression * posExp;
568 struct Attrib * attrib;
569 } __attribute__ ((gcc_struct)) structDecl;
572 struct Expression * exp;
573 struct Specifier * enumClass;
574 } __attribute__ ((gcc_struct)) array;
577 struct __ecereNameSpace__ecere__sys__OldList * parameters;
578 } __attribute__ ((gcc_struct)) function;
581 struct Pointer * pointer;
582 } __attribute__ ((gcc_struct)) pointer;
585 struct ExtDecl * extended;
586 } __attribute__ ((gcc_struct)) extended;
587 } __attribute__ ((gcc_struct)) __anon1;
588 } __attribute__ ((gcc_struct));
590 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
592 struct FunctionDefinition
594 struct FunctionDefinition * prev;
595 struct FunctionDefinition * next;
597 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
598 struct Declarator * declarator;
599 struct __ecereNameSpace__ecere__sys__OldList * declarations;
600 struct Statement * body;
601 struct __ecereNameSpace__ecere__com__Class * _class;
602 struct __ecereNameSpace__ecere__sys__OldList attached;
605 struct Symbol * propSet;
607 unsigned int propertyNoThis;
608 } __attribute__ ((gcc_struct));
610 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
614 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
618 struct External * prev;
619 struct External * next;
622 struct Symbol * symbol;
625 struct FunctionDefinition * function;
626 struct ClassDefinition * _class;
627 struct Declaration * declaration;
629 struct Identifier * id;
630 struct DBTableDef * table;
631 } __attribute__ ((gcc_struct)) __anon1;
633 } __attribute__ ((gcc_struct));
635 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
639 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
643 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
648 struct Symbol * parent;
649 struct Symbol * left;
650 struct Symbol * right;
655 struct __ecereNameSpace__ecere__com__Method * method;
656 struct __ecereNameSpace__ecere__com__Property * _property;
657 struct __ecereNameSpace__ecere__com__Class * registered;
658 } __attribute__ ((gcc_struct)) __anon1;
665 struct External * pointerExternal;
666 struct External * structExternal;
667 } __attribute__ ((gcc_struct)) __anon1;
670 struct External * externalGet;
671 struct External * externalSet;
672 struct External * externalPtr;
673 struct External * externalIsSet;
674 } __attribute__ ((gcc_struct)) __anon2;
677 struct External * methodExternal;
678 struct External * methodCodeExternal;
679 } __attribute__ ((gcc_struct)) __anon3;
680 } __attribute__ ((gcc_struct)) __anon2;
681 unsigned int imported;
682 unsigned int declaredStructSym;
683 struct __ecereNameSpace__ecere__com__Class * _class;
684 unsigned int declaredStruct;
685 unsigned int needConstructor;
686 unsigned int needDestructor;
687 char * constructorName;
690 char * destructorName;
691 struct ModuleImport * module;
692 struct ClassImport * _import;
693 struct Location nameLoc;
694 unsigned int isParam;
695 unsigned int isRemote;
696 unsigned int isStruct;
697 unsigned int fireWatchersDone;
699 unsigned int classData;
700 unsigned int isStatic;
702 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
703 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
704 struct Context * ctx;
706 struct Expression * propCategory;
707 } __attribute__ ((gcc_struct));
709 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
718 struct Symbol * _class;
721 struct __ecereNameSpace__ecere__sys__OldList members;
723 } __attribute__ ((gcc_struct)) __anon1;
726 struct Type * returnType;
727 struct __ecereNameSpace__ecere__sys__OldList params;
728 struct Symbol * thisClass;
729 unsigned int staticMethod;
730 struct TemplateParameter * thisClassTemplate;
731 } __attribute__ ((gcc_struct)) __anon2;
734 struct __ecereNameSpace__ecere__com__Method * method;
735 struct __ecereNameSpace__ecere__com__Class * methodClass;
736 struct __ecereNameSpace__ecere__com__Class * usedClass;
737 } __attribute__ ((gcc_struct)) __anon3;
740 struct Type * arrayType;
742 struct Expression * arraySizeExp;
743 unsigned int freeExp;
744 struct Symbol * enumClass;
745 } __attribute__ ((gcc_struct)) __anon4;
747 struct TemplateParameter * templateParameter;
748 } __attribute__ ((gcc_struct)) __anon1;
758 unsigned int isSigned : 1;
759 unsigned int constant : 1;
760 unsigned int truth : 1;
761 unsigned int byReference : 1;
762 unsigned int extraParam : 1;
763 unsigned int directClassAccess : 1;
764 unsigned int computing : 1;
765 unsigned int keepCast : 1;
766 unsigned int passAsTemplate : 1;
767 unsigned int dllExport : 1;
768 unsigned int attrStdcall : 1;
769 unsigned int declaredWithStruct : 1;
770 unsigned int typedByReference : 1;
771 unsigned int casted : 1;
772 } __attribute__ ((gcc_struct));
774 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
776 struct __ecereNameSpace__ecere__com__Class
778 struct __ecereNameSpace__ecere__com__Class * prev;
779 struct __ecereNameSpace__ecere__com__Class * next;
785 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
786 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
789 struct __ecereNameSpace__ecere__com__Class * base;
790 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
791 struct __ecereNameSpace__ecere__sys__BinaryTree members;
792 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
793 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
794 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
795 struct __ecereNameSpace__ecere__sys__OldList derivatives;
799 struct __ecereNameSpace__ecere__com__Instance * module;
800 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
801 const char * dataTypeString;
802 struct Type * dataType;
804 int defaultAlignment;
805 void (* Initialize)();
807 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
808 const char * designerClass;
809 unsigned int noExpansion;
810 const char * defaultProperty;
811 unsigned int comRedefinition;
814 unsigned int internalDecl;
816 unsigned int computeSize;
818 int destructionWatchOffset;
820 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
821 int inheritanceAccess;
822 const char * fullName;
824 struct __ecereNameSpace__ecere__sys__OldList conversions;
825 struct __ecereNameSpace__ecere__sys__OldList templateParams;
826 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
827 struct __ecereNameSpace__ecere__com__Class * templateClass;
828 struct __ecereNameSpace__ecere__sys__OldList templatized;
830 unsigned int isInstanceClass;
831 unsigned int byValueSystemClass;
832 } __attribute__ ((gcc_struct));
834 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
836 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
838 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
840 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
842 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
844 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
846 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
848 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
850 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
852 struct __ecereNameSpace__ecere__com__Instance
855 struct __ecereNameSpace__ecere__com__Class * _class;
857 } __attribute__ ((gcc_struct));
859 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
861 struct __ecereNameSpace__ecere__com__DataMember
863 struct __ecereNameSpace__ecere__com__DataMember * prev;
864 struct __ecereNameSpace__ecere__com__DataMember * next;
866 unsigned int isProperty;
869 struct __ecereNameSpace__ecere__com__Class * _class;
870 const char * dataTypeString;
871 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
872 struct Type * dataType;
876 struct __ecereNameSpace__ecere__sys__OldList members;
877 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
880 } __attribute__ ((gcc_struct));
882 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
884 struct __ecereNameSpace__ecere__com__SerialBuffer
886 unsigned char * _buffer;
890 } __attribute__ ((gcc_struct));
892 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
894 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
900 const char * dataTypeString;
901 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
902 } __attribute__ ((gcc_struct)) __anon1;
903 struct __ecereNameSpace__ecere__com__DataValue expression;
906 const char * memberString;
909 struct __ecereNameSpace__ecere__com__DataMember * member;
910 struct __ecereNameSpace__ecere__com__Property * prop;
911 struct __ecereNameSpace__ecere__com__Method * method;
912 } __attribute__ ((gcc_struct)) __anon1;
913 } __attribute__ ((gcc_struct)) __anon2;
914 } __attribute__ ((gcc_struct)) __anon1;
915 } __attribute__ ((gcc_struct));
919 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
922 typedef union YYSTYPE
927 struct Identifier * id;
928 struct Expression * exp;
929 struct Specifier * specifier;
930 struct __ecereNameSpace__ecere__sys__OldList * list;
931 struct Enumerator * enumerator;
932 struct Declarator * declarator;
933 struct Pointer * pointer;
934 struct Initializer * initializer;
935 struct InitDeclarator * initDeclarator;
936 struct TypeName * typeName;
937 struct Declaration * declaration;
938 struct Statement * stmt;
939 struct FunctionDefinition * function;
940 struct External * external;
941 struct Context * context;
942 struct AsmField * asmField;
943 struct Attrib * attrib;
944 struct ExtDecl * extDecl;
945 struct Attribute * attribute;
946 struct Instantiation * instance;
947 struct MembersInit * membersInit;
948 struct MemberInit * memberInit;
949 struct ClassFunction * classFunction;
950 struct ClassDefinition * _class;
951 struct ClassDef * classDef;
952 struct PropertyDef * prop;
954 struct Symbol * symbol;
955 struct PropertyWatch * propertyWatch;
956 struct TemplateParameter * templateParameter;
957 struct TemplateArgument * templateArgument;
958 struct TemplateDatatype * templateDatatype;
959 struct DBTableEntry * dbtableEntry;
960 struct DBIndexItem * dbindexItem;
961 struct DBTableDef * dbtableDef;
962 } __attribute__ ((gcc_struct)) YYSTYPE;
964 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
968 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
970 struct InitDeclarator;
972 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
980 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
984 struct ClassFunction * prev;
985 struct ClassFunction * next;
987 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
988 struct Declarator * declarator;
989 struct __ecereNameSpace__ecere__sys__OldList * declarations;
990 struct Statement * body;
991 struct __ecereNameSpace__ecere__com__Class * _class;
992 struct __ecereNameSpace__ecere__sys__OldList attached;
995 struct Symbol * propSet;
996 unsigned int isVirtual;
997 unsigned int isConstructor;
998 unsigned int isDestructor;
999 unsigned int dontMangle;
1002 } __attribute__ ((gcc_struct));
1004 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1008 struct MembersInit * prev;
1009 struct MembersInit * next;
1010 struct Location loc;
1014 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1015 struct ClassFunction * function;
1016 } __attribute__ ((gcc_struct)) __anon1;
1017 } __attribute__ ((gcc_struct));
1019 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1023 struct MemberInit * prev;
1024 struct MemberInit * next;
1025 struct Location loc;
1026 struct Location realLoc;
1027 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1028 struct Initializer * initializer;
1030 unsigned int variable;
1031 unsigned int takeOutExp;
1032 } __attribute__ ((gcc_struct));
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1038 struct PropertyDef * prev;
1039 struct PropertyDef * next;
1040 struct Location loc;
1041 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1042 struct Declarator * declarator;
1043 struct Identifier * id;
1044 struct Statement * getStmt;
1045 struct Statement * setStmt;
1046 struct Statement * issetStmt;
1047 struct Symbol * symbol;
1048 struct Expression * category;
1051 unsigned int conversion : 1;
1052 unsigned int isWatchable : 1;
1053 unsigned int isDBProp : 1;
1054 } __attribute__ ((gcc_struct)) __anon1;
1055 } __attribute__ ((gcc_struct));
1057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1059 struct PropertyWatch;
1061 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1065 struct ClassDef * prev;
1066 struct ClassDef * next;
1067 struct Location loc;
1071 struct Declaration * decl;
1072 struct ClassFunction * function;
1073 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1074 struct PropertyDef * propertyDef;
1075 struct PropertyWatch * propertyWatch;
1077 struct Identifier * defaultProperty;
1080 struct Identifier * id;
1081 struct Initializer * initializer;
1082 } __attribute__ ((gcc_struct)) __anon1;
1083 } __attribute__ ((gcc_struct)) __anon1;
1086 } __attribute__ ((gcc_struct));
1088 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1090 struct DBTableEntry;
1092 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1096 extern YYSTYPE yylval;
1098 extern struct Location yylloc;
1100 extern struct External * curExternal;
1102 extern char * strcat(char * , const char * );
1104 extern size_t strlen(const char * );
1106 extern int strncmp(const char * , const char * , size_t n);
1108 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
1114 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1118 strcat(output, "__ecereNameSpace__");
1122 len = strlen(output);
1124 if(!strncmp(className, "const ", 6))
1126 for(; (ch = className[c]); c++)
1129 output[len++] = '_';
1131 output[len++] = '_';
1134 output[len++] = '_';
1135 output[len++] = 'P';
1136 output[len++] = 'T';
1137 output[len++] = 'R';
1138 output[len++] = '_';
1142 output[len++] = '_';
1143 output[len++] = 'E';
1144 output[len++] = 'Q';
1145 output[len++] = 'U';
1146 output[len++] = '_';
1150 if(!includeTemplateParams)
1152 if(!strncmp(className + c + 1, "const ", 6))
1154 output[len++] = '_';
1155 output[len++] = 'T';
1156 output[len++] = 'P';
1157 output[len++] = 'L';
1158 output[len++] = '_';
1162 output[len++] = '_';
1166 if(!strncmp(className + c + 1, "const ", 6))
1168 output[len++] = '_';
1173 output[len++] = (char)0;
1176 extern int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding);
1178 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1180 if(_class->type != 1000)
1181 AddMembers(list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1184 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1186 struct __ecereNameSpace__ecere__com__NameSpace
1189 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1190 struct __ecereNameSpace__ecere__com__NameSpace * left;
1191 struct __ecereNameSpace__ecere__com__NameSpace * right;
1193 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1194 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1195 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1196 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1197 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1198 } __attribute__ ((gcc_struct));
1200 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1204 else if((*ns).parent)
1205 return NameSpaceContained((*ns).parent, parent);
1210 extern void Compiler_Error(const char * format, ...);
1212 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
1214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1216 struct __ecereNameSpace__ecere__com__Module
1218 struct __ecereNameSpace__ecere__com__Instance * application;
1219 struct __ecereNameSpace__ecere__sys__OldList classes;
1220 struct __ecereNameSpace__ecere__sys__OldList defines;
1221 struct __ecereNameSpace__ecere__sys__OldList functions;
1222 struct __ecereNameSpace__ecere__sys__OldList modules;
1223 struct __ecereNameSpace__ecere__com__Instance * prev;
1224 struct __ecereNameSpace__ecere__com__Instance * next;
1230 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1231 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1232 } __attribute__ ((gcc_struct));
1234 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1236 struct __ecereNameSpace__ecere__com__Application
1239 const char * * argv;
1241 unsigned int isGUIApp;
1242 struct __ecereNameSpace__ecere__sys__OldList allModules;
1243 char * parsedCommand;
1244 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1245 } __attribute__ ((gcc_struct));
1247 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1249 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1251 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1253 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1257 if(regClass->templateClass)
1258 regClass = regClass->templateClass;
1259 if(classSym->isStatic && access != 3)
1261 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1263 else if(access == 1)
1265 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->application + structSize_Module)))->systemNameSpace))
1267 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1274 static void CheckPublicTypeName(struct TypeName * type, int access)
1276 if(type->qualifiers)
1278 struct Specifier * spec;
1280 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1284 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1286 CheckPublicClass(classSym, access, "define");
1292 static void CheckPublicExpression(struct Expression * exp, int access);
1294 static void CheckPublicInitializer(struct Initializer * init, int access)
1299 CheckPublicExpression(init->__anon1.exp, access);
1303 struct Initializer * i;
1305 for(i = (*init->__anon1.list).first; i; i = i->next)
1306 CheckPublicInitializer(i, access);
1312 static void CheckPublicExpression(struct Expression * exp, int access)
1325 if(exp->__anon1.op.exp1)
1326 CheckPublicExpression(exp->__anon1.op.exp1, access);
1327 if(exp->__anon1.op.exp2)
1328 CheckPublicExpression(exp->__anon1.op.exp2, access);
1332 struct Expression * e;
1334 for(e = (*exp->__anon1.list).first; e; e = e->next)
1335 CheckPublicExpression(e, access);
1340 struct Expression * e;
1342 CheckPublicExpression(exp->__anon1.index.exp, access);
1343 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1344 CheckPublicExpression(e, access);
1349 struct Expression * e;
1351 CheckPublicExpression(exp->__anon1.call.exp, access);
1352 if(exp->__anon1.call.arguments)
1354 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1355 CheckPublicExpression(e, access);
1361 CheckPublicExpression(exp->__anon1.member.exp, access);
1366 CheckPublicExpression(exp->__anon1.member.exp, access);
1370 CheckPublicTypeName(exp->__anon1.typeName, access);
1374 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1375 if(exp->__anon1.cast.exp)
1376 CheckPublicExpression(exp->__anon1.cast.exp, access);
1381 struct Expression * e;
1383 CheckPublicExpression(exp->__anon1.cond.cond, access);
1384 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1385 CheckPublicExpression(e, access);
1386 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1391 CheckPublicExpression(exp->__anon1._new.size, access);
1395 CheckPublicExpression(exp->__anon1._renew.size, access);
1396 CheckPublicExpression(exp->__anon1._renew.exp, access);
1400 struct MembersInit * members;
1402 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1403 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1405 if(members->type == 0)
1407 struct MemberInit * member;
1409 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1411 CheckPublicInitializer(member->initializer, access);
1421 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1429 CheckPublicClass(type->__anon1._class, access, word);
1439 struct Type * param;
1441 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1442 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1443 CheckPublicDataType(param, access, word);
1444 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1448 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1449 if(type->__anon1.__anon4.enumClass)
1450 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1454 CheckPublicDataType(type->__anon1.type, access, word);
1463 CheckPublicClass(type->__anon1._class, access, word);
1470 extern struct Identifier * GetDeclId(struct Declarator * decl);
1472 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1474 struct __ecereNameSpace__ecere__com__BTNamedLink
1477 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1478 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1479 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1482 } __attribute__ ((gcc_struct));
1484 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1486 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
1488 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1490 if(definitions != (((void *)0)))
1492 struct ClassDef * def;
1494 for(def = definitions->first; def; def = def->next)
1498 struct Declaration * decl = def->__anon1.decl;
1499 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1504 struct Declarator * d;
1506 if(decl->__anon1.__anon1.declarators)
1508 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1510 struct Identifier * declId = GetDeclId(d);
1516 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1518 dataMember = link ? link->data : (((void *)0));
1521 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1523 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1527 else if(decl->__anon1.__anon1.specifiers)
1529 struct Specifier * spec;
1531 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1533 if(spec->type == 3 || spec->type == 4)
1535 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1537 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1539 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1543 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1545 dataMember = link ? link->data : (((void *)0));
1548 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1550 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1556 else if(decl->type == 2)
1558 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1565 extern unsigned int inCompiler;
1567 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1569 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
1571 extern struct Symbol * FindClass(const char * name);
1573 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1575 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * dataType, void * setStmt, void * getStmt, int declMode);
1577 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
1579 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1581 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, void * function, int declMode);
1583 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1585 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1587 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1589 extern struct Specifier * MkSpecifierName(const char * name);
1591 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1593 extern struct Identifier * MkIdentifier(const char * string);
1595 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1597 extern struct Expression * QMkExpId(const char * id);
1599 extern void FreeDeclarator(struct Declarator * decl);
1601 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
1603 extern void FreeSpecifier(struct Specifier * spec);
1605 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
1607 extern struct Type * MkClassType(const char * name);
1609 extern char * strcpy(char * , const char * );
1611 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1613 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1615 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1617 extern void FreeExternal(struct External * external);
1619 extern int declMode;
1621 extern int structDeclMode;
1623 extern char * strstr(const char * , const char * );
1625 extern const char * sourceFile;
1627 extern struct Specifier * MkSpecifier(int specifier);
1629 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1631 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1633 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1635 extern struct Context * PushContext(void);
1637 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1639 extern struct Expression * CopyExpression(struct Expression * exp);
1641 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1643 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1645 extern void PopContext(struct Context * ctx);
1647 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1649 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1651 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1653 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1655 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1657 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1659 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1661 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1663 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1665 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1667 extern void FreeInitializer(struct Initializer * initializer);
1669 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1671 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1673 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1675 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1677 extern void Compiler_Warning(const char * format, ...);
1679 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1681 extern int sprintf(char * , const char * , ...);
1683 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1685 extern struct Context * curContext;
1687 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1689 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1691 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1693 extern void FreeType(struct Type * type);
1695 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1697 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1699 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1701 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1703 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1705 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1707 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1709 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1711 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1713 static void ProcessClass(int classType, struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * enumValues, struct Location * loc, struct __ecereNameSpace__ecere__sys__OldList * defs, void * after, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators, struct ExtDecl * extDecl)
1715 char structName[1024];
1716 char className[1024];
1717 char constructorName[1024];
1718 char destructorName[1024];
1719 struct __ecereNameSpace__ecere__com__Class * regClass;
1720 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1721 unsigned int isUnion = classType == 6;
1722 struct External * external = (((void *)0));
1723 struct ClassDef * def;
1724 struct __ecereNameSpace__ecere__sys__OldList * list;
1725 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1730 classDataList = MkList();
1732 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1735 classType = regClass->type;
1739 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1741 if(!regClass->base->symbol)
1742 regClass->base->symbol = FindClass(regClass->base->fullName);
1743 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1745 else if(!symbol->isStatic && regClass->base)
1747 if(!regClass->base->symbol)
1748 regClass->base->symbol = FindClass(regClass->base->fullName);
1749 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1752 if(definitions != (((void *)0)))
1754 for(def = definitions->first; def; def = def->next)
1758 struct __ecereNameSpace__ecere__com__DataMember * member;
1759 struct __ecereNameSpace__ecere__com__Property * prop;
1760 struct __ecereNameSpace__ecere__com__Method * method;
1762 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1764 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1766 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1768 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1770 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1772 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1777 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1784 external = MkExternalDeclaration((((void *)0)));
1785 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1786 curExternal = external;
1787 curExternal->symbol = symbol;
1789 if((classType == 1 || classType == 5) && inCompiler)
1791 AddSimpleBaseMembers(list, regClass->base, regClass);
1793 if(definitions != (((void *)0)))
1797 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1798 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1799 else if(!symbol->isStatic)
1800 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1802 for(def = definitions->first; def; def = def->next)
1807 struct Declaration * decl = def->__anon1.decl;
1812 if(inCompiler && classType != 2)
1814 ListAdd(list, MkClassDefDeclaration(decl));
1815 def->__anon1.decl = (((void *)0));
1818 else if(decl->type == 2)
1820 struct Instantiation * inst = decl->__anon1.inst;
1821 struct Expression * exp = inst->exp;
1822 struct Symbol * classSym;
1826 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1827 struct Declarator * d;
1829 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1830 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1833 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1835 ListAdd(declarators, d);
1836 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1837 ListAdd(list, MkClassDefDeclaration(decl));
1839 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1840 exp->__anon1.member.exp = QMkExpId("this");
1841 exp->__anon1.member.memberType = 3;
1842 exp->__anon1.member.thisPtr = 1;
1847 FreeList(specifiers, FreeSpecifier);
1850 classSym = inst->_class->__anon1.__anon1.symbol;
1851 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1853 if(inst->members && (*inst->members).count)
1854 symbol->needConstructor = 1;
1858 symbol->needConstructor = 1;
1859 symbol->needDestructor = 1;
1863 else if(def->type == 9)
1865 struct Declaration * decl = def->__anon1.decl;
1869 if(inCompiler && classType != 2)
1871 ListAdd(classDataList, MkClassDefDeclaration(decl));
1872 def->__anon1.decl = (((void *)0));
1876 else if(def->type == 1)
1877 symbol->needConstructor = 1;
1878 else if(def->type == 4)
1879 symbol->needConstructor = 1;
1880 else if(def->type == 0)
1882 struct ClassFunction * func = def->__anon1.function;
1884 if(func->isDestructor)
1889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1893 symbol->needDestructor = 1;
1895 if(!inCompiler && func->body)
1897 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1899 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1903 if(func->isConstructor)
1908 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1912 symbol->needConstructor = 1;
1914 if(!inCompiler && func->body)
1916 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1918 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1927 external->symbol = (((void *)0));
1930 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1932 initDeclarators = (((void *)0));
1933 strcpy(structName, symbol->string);
1934 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1936 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1938 spec->__anon1.__anon2.extDeclStruct = extDecl;
1939 ListAdd(specs, spec);
1941 external->symbol = symbol;
1942 symbol->__anon2.__anon1.structExternal = external;
1943 external->__anon1.declaration = MkDeclaration(specs, declarators);
1945 symbol->declaredStruct = 1;
1949 curExternal = external->prev;
1950 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1951 FreeExternal(external);
1952 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1954 if((*classDataList).count)
1956 char classDataStructName[1024];
1957 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1958 struct External * external;
1960 strcpy(classDataStructName, "__ecereClassData_");
1961 FullClassNameCat(classDataStructName, symbol->string, 0);
1962 declMode = structDeclMode = 0;
1963 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1964 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1967 symbol->classData = 1;
1970 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1975 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1977 strcpy(className, "__ecereClass_");
1978 FullClassNameCat(className, symbol->string, 1);
1979 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
1980 if(!strstr(sourceFile, ".main.ec"))
1981 ListAdd(specs, MkSpecifier(STATIC));
1982 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
1983 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
1984 symbol->__anon2.__anon3.methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
1985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon3.methodExternal);
1986 after = symbol->__anon2.__anon3.methodExternal;
1988 if(symbol->needDestructor)
1990 struct ClassFunction * function;
1991 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1992 struct Declarator * decl;
1993 struct Statement * body;
1994 struct Context * context;
1995 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
1997 strcpy(destructorName, "__ecereDestructor_");
1998 FullClassNameCat(destructorName, symbol->string, 0);
1999 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2000 ListAdd(specs, MkSpecifier(VOID));
2001 context = PushContext();
2002 statements = MkList();
2003 if(definitions != (((void *)0)))
2005 for(def = definitions->first; def; def = def->next)
2007 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2009 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2010 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2012 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2014 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2016 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2018 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2020 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2022 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2027 if(destructor && destructor->body)
2029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2030 destructor->body->__anon1.compound.context->parent = context;
2031 destructor->body = (((void *)0));
2033 body = MkCompoundStmt(declarations, statements);
2034 PopContext(context);
2035 body->__anon1.compound.context = context;
2036 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2037 decl->symbol = __extension__ ({
2038 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2040 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2042 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2043 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2044 ProcessClassFunctionBody(function, body);
2045 function->id = symbol->id;
2046 function->idCode = symbol->idCode;
2047 function->dontMangle = 1;
2048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2050 if(symbol->needConstructor && inCompiler)
2052 struct ClassFunction * function;
2053 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2054 struct Declarator * decl;
2055 struct Statement * body;
2056 struct Context * context;
2057 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2059 strcpy(constructorName, "__ecereConstructor_");
2060 FullClassNameCat(constructorName, symbol->string, 0);
2061 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2062 ListAdd(specs, MkSpecifierName("bool"));
2063 context = PushContext();
2064 statements = MkList();
2065 if(definitions != (((void *)0)))
2067 for(def = definitions->first; def; def = def->next)
2069 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2071 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2072 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2074 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2076 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2079 newInst->members = (((void *)0));
2080 newInst->exp = CopyExpression(inst->exp);
2081 newInst->_class = CopySpecifier(inst->_class);
2082 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2085 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2087 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2091 for(def = definitions->first; def; def = def->next)
2093 if(def->type == 1 && def->__anon1.defProperties)
2095 struct MemberInit * propertyDef;
2097 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2099 struct Expression * memberExp;
2100 struct Identifier * id = (*propertyDef->identifiers).first;
2104 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2105 for(id = id->next; id; id = id->next)
2106 memberExp = MkExpMember(memberExp, id);
2107 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2109 if(propertyDef->initializer)
2111 if(propertyDef->initializer->type == 0)
2112 propertyDef->initializer->__anon1.exp = (((void *)0));
2113 FreeInitializer(propertyDef->initializer);
2115 propertyDef->initializer = (((void *)0));
2116 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2120 for(def = definitions->first; def; def = def->next)
2122 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2124 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2125 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2127 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2129 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2131 def->__anon1.decl->__anon1.inst = (((void *)0));
2132 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2138 if(constructor && constructor->body)
2140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2141 constructor->body->__anon1.compound.context->parent = context;
2142 constructor->body = (((void *)0));
2144 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2145 body = MkCompoundStmt(declarations, statements);
2146 PopContext(context);
2147 body->__anon1.compound.context = context;
2148 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2149 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2151 decl->symbol->id = symbol->id;
2152 decl->symbol->idCode = symbol->idCode;
2153 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2154 ProcessClassFunctionBody(function, body);
2155 function->id = symbol->id;
2156 function->idCode = symbol->idCode;
2157 function->dontMangle = 1;
2158 if(definitions != (((void *)0)))
2159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2162 if(definitions != (((void *)0)))
2164 for(def = definitions->first; def; def = def->next)
2166 if(def->type == 3 && def->__anon1.propertyDef)
2168 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2169 struct ClassDef * after = def;
2170 struct ClassDef * newDef;
2174 yylloc = propertyDef->loc;
2175 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2176 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2177 else if(!symbol->isStatic)
2178 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2182 struct ClassFunction * func;
2183 struct Declarator * decl;
2185 struct __ecereNameSpace__ecere__sys__OldList * params;
2187 if(propertyDef->getStmt && propertyDef->id)
2189 strcpy(name, "__ecereProp_");
2190 FullClassNameCat(name, symbol->string, 0);
2191 strcat(name, "_Get_");
2192 FullClassNameCat(name, propertyDef->id->string, 1);
2194 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2196 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2197 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2198 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2202 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2203 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2205 ProcessClassFunctionBody(func, propertyDef->getStmt);
2206 func->declarator->symbol = propertyDef->symbol;
2207 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2208 func->dontMangle = 1;
2209 newDef = MkClassDefFunction(func);
2210 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2213 propertyDef->getStmt = (((void *)0));
2215 func->body = (((void *)0));
2217 if(propertyDef->setStmt && propertyDef->id)
2219 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2221 strcpy(name, "__ecereProp_");
2222 FullClassNameCat(name, symbol->string, 0);
2223 strcat(name, "_Set_");
2224 FullClassNameCat(name, propertyDef->id->string, 1);
2226 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2227 if(propertyDef->__anon1.isDBProp)
2229 struct Specifier * spec;
2230 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2232 for(spec = (*specs).first; spec; spec = spec->next)
2233 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2236 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2238 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2240 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2241 unsigned int useVoid = 0;
2243 switch(regClass->type)
2251 useVoid = !isConversion;
2254 useVoid = !isConversion;
2255 if(useVoid && !propertyDef->__anon1.isDBProp)
2256 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2258 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2260 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2261 ProcessClassFunctionBody(func, propertyDef->setStmt);
2262 func->dontMangle = 1;
2263 func->declarator->symbol = propertyDef->symbol;
2264 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2265 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2266 func->propSet = propertyDef->symbol;
2267 newDef = MkClassDefFunction(func);
2268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2271 propertyDef->setStmt = (((void *)0));
2273 func->body = (((void *)0));
2275 if(propertyDef->issetStmt && propertyDef->id)
2277 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2279 strcpy(name, "__ecereProp_");
2280 FullClassNameCat(name, symbol->string, 0);
2281 strcat(name, "_IsSet_");
2282 FullClassNameCat(name, propertyDef->id->string, 1);
2284 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2285 ListAdd(specifiers, MkSpecifierName("bool"));
2286 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2287 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2288 func->dontMangle = 1;
2289 func->declarator->symbol = propertyDef->symbol;
2290 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2291 newDef = MkClassDefFunction(func);
2292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2295 propertyDef->issetStmt = (((void *)0));
2297 func->body = (((void *)0));
2299 if(propertyDef->id && inCompiler)
2301 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2302 struct Declaration * decl;
2303 struct External * external;
2304 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2307 ListAdd(specifiers, MkSpecifierName("Property"));
2308 strcpy(name, "__ecereProp_");
2309 FullClassNameCat(name, symbol->string, 0);
2311 FullClassNameCat(name, propertyDef->id->string, 1);
2313 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2315 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2316 strcpy(name, "__ecerePropM_");
2317 FullClassNameCat(name, symbol->string, 0);
2319 FullClassNameCat(name, propertyDef->id->string, 1);
2320 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2321 decl = MkDeclaration(specifiers, list);
2323 external = MkExternalDeclaration(decl);
2324 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2325 external->symbol = propertyDef->symbol;
2326 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2327 if(inCompiler && prop && prop->symbol)
2328 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2333 else if(def->type == 10 && def->__anon1.propertyDef)
2335 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2336 struct ClassDef * after = def;
2337 struct ClassDef * newDef;
2342 yylloc = propertyDef->loc;
2343 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2344 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2345 else if(!symbol->isStatic)
2346 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2349 struct ClassFunction * func;
2350 struct Declarator * decl;
2352 struct __ecereNameSpace__ecere__sys__OldList * params;
2354 if(propertyDef->getStmt && propertyDef->id)
2356 struct Declarator * declId;
2358 sprintf(name, "class::__ecereClassProp_");
2359 FullClassNameCat(name, symbol->string, 0);
2360 strcat(name, "_Get_");
2361 strcat(name, propertyDef->id->string);
2363 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2365 decl = MkDeclaratorFunction(declId, params);
2366 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2368 ProcessClassFunctionBody(func, propertyDef->getStmt);
2369 func->declarator->symbol = propertyDef->symbol;
2370 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2371 func->dontMangle = 1;
2372 newDef = MkClassDefFunction(func);
2373 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2375 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2376 func->type = ProcessType(propertyDef->specifiers, decl);
2377 FreeDeclarator(decl);
2378 if(func->type->__anon1.__anon2.returnType->kind == 8 && func->type->__anon1.__anon2.returnType->__anon1._class && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered->type == 1)
2379 func->type->__anon1.__anon2.returnType->byReference = 1;
2380 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2382 propertyDef->getStmt = (((void *)0));
2384 func->body = (((void *)0));
2386 if(propertyDef->setStmt && propertyDef->id)
2388 struct Context * prevCurContext;
2389 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2390 struct Statement * body = propertyDef->setStmt;
2391 struct Declarator * ptrDecl;
2393 strcpy(name, "class::__ecereClassProp_");
2394 FullClassNameCat(name, symbol->string, 0);
2395 strcat(name, "_Set_");
2396 strcat(name, propertyDef->id->string);
2398 prevCurContext = curContext;
2399 curContext = body->__anon1.compound.context;
2400 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2401 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2402 if(!body->__anon1.compound.declarations)
2403 body->__anon1.compound.declarations = MkList();
2404 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2405 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2407 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2408 ListAdd(body->__anon1.compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), CopyDeclarator(propertyDef->declarator)), MkExpIdentifier(MkIdentifier("_value"))))))));
2409 curContext = prevCurContext;
2411 struct Symbol * sym = ptrDecl->symbol;
2414 FreeType(sym->type);
2415 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2417 ListAdd(specifiers, MkSpecifier(VOID));
2418 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2419 ProcessClassFunctionBody(func, propertyDef->setStmt);
2420 func->dontMangle = 1;
2421 func->declarator->symbol = propertyDef->symbol;
2422 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2423 newDef = MkClassDefFunction(func);
2424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2427 propertyDef->setStmt = (((void *)0));
2429 func->body = (((void *)0));
2434 else if(def->type == 0 && def->__anon1.function->declarator)
2436 struct ClassFunction * func = def->__anon1.function;
2438 func->_class = regClass;
2439 if(!func->dontMangle)
2441 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2442 struct Identifier * id = GetDeclId(funcDecl);
2443 struct __ecereNameSpace__ecere__com__Method * method;
2445 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2447 if(!funcDecl->__anon1.function.parameters)
2448 funcDecl->__anon1.function.parameters = MkList();
2449 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2451 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2452 FreeSpecifier(id->_class);
2453 id->_class = (((void *)0));
2454 if(inCompiler && method)
2456 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2459 ProcessMethodType(method);
2461 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2462 CheckPublicDataType(method->dataType, 1, "class method");
2463 strcpy(newId, "__ecereMethod_");
2464 FullClassNameCat(newId, symbol->string, 0);
2466 strcat(newId, id->string);
2467 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2469 if(method->type != 1)
2473 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2474 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2482 if(initDeclarators != (((void *)0)))
2483 FreeList(initDeclarators, FreeInitDeclarator);
2486 void PreProcessClassDefinitions()
2488 struct External * external, * next;
2490 curExternal = (((void *)0));
2493 for(external = (*ast).first; external; external = next)
2495 next = external->next;
2496 curExternal = external;
2497 if(external->type == 2)
2499 struct ClassDefinition * _class = external->__anon1._class;
2501 if(_class->definitions)
2503 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2506 else if(external->type == 1)
2508 struct Declaration * declaration = external->__anon1.declaration;
2510 if(declaration->type == 1)
2512 if(declaration->__anon1.__anon1.specifiers)
2514 struct Specifier * specifier;
2516 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2518 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->__anon1.__anon2.id && specifier->__anon1.__anon2.id->string && (declaration->declMode || specifier->__anon1.__anon2.baseSpecs || (specifier->type == 2 && specifier->__anon1.__anon2.definitions)))
2520 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2524 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2525 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2527 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2530 initDeclarators = declaration->__anon1.__anon1.declarators;
2531 declaration->__anon1.__anon1.declarators = (((void *)0));
2533 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2539 else if(inCompiler && declaration->type == 3)
2541 yylloc = declaration->loc;
2542 if(declaration->declMode == 1)
2543 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2544 else if(declaration->declMode != 3)
2545 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2548 else if(external->type == 3)
2551 else if(inCompiler && external->type == 0)
2553 yylloc = external->__anon1.function->loc;
2554 if(!external->__anon1.function->type)
2555 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2556 if(external->__anon1.function->declMode == 1)
2557 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2558 else if(external->__anon1.function->declMode != 3)
2559 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2567 struct __ecereNameSpace__ecere__com__GlobalFunction;
2569 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char * name, const char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
2571 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2573 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2575 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2576 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2579 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)