1 /* Code generated from eC source file: pass0.ec */
3 #define __runtimePlatform 1
4 #elif defined(__APPLE__)
5 #define __runtimePlatform 3
7 #define __runtimePlatform 2
10 typedef long long int64;
11 typedef unsigned long long uint64;
15 #elif defined(__TINYC__)
17 #define __builtin_va_list va_list
18 #define __builtin_va_start va_start
19 #define __builtin_va_end va_end
21 #define strcasecmp stricmp
22 #define strncasecmp strnicmp
23 #define __declspec(x) __attribute__((x))
27 typedef long long int64;
28 typedef unsigned long long uint64;
30 typedef __int64 int64;
31 typedef unsigned __int64 uint64;
34 #define __ENDIAN_PAD(x) (8 - (x))
36 #define __ENDIAN_PAD(x) 0
39 #include <sys/types.h>
41 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
47 #define arch_PointerSize sizeof(void *)
48 #define structSize_Instance (_64BIT ? 24 : 12)
49 #define structSize_Module (_64BIT ? 560 : 300)
51 struct __ecereNameSpace__ecere__com__Instance;
53 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
55 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
57 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
59 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
61 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
63 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
65 struct __ecereNameSpace__ecere__sys__BTNode;
67 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
69 struct __ecereNameSpace__ecere__sys__BinaryTree
71 struct __ecereNameSpace__ecere__sys__BTNode * root;
73 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
74 void (* FreeKey)(void * key);
75 } __attribute__ ((gcc_struct));
77 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
79 struct __ecereNameSpace__ecere__sys__OldList
86 } __attribute__ ((gcc_struct));
88 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
90 struct __ecereNameSpace__ecere__com__Method
93 struct __ecereNameSpace__ecere__com__Method * parent;
94 struct __ecereNameSpace__ecere__com__Method * left;
95 struct __ecereNameSpace__ecere__com__Method * right;
100 struct __ecereNameSpace__ecere__com__Class * _class;
102 const char * dataTypeString;
103 struct Type * dataType;
105 } __attribute__ ((gcc_struct));
107 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
109 struct __ecereNameSpace__ecere__com__Property
111 struct __ecereNameSpace__ecere__com__Property * prev;
112 struct __ecereNameSpace__ecere__com__Property * next;
114 unsigned int isProperty;
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 * );
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));
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
143 } __attribute__ ((gcc_struct));
145 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
149 struct CodePosition start;
150 struct CodePosition end;
151 } __attribute__ ((gcc_struct));
153 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
157 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
161 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
163 struct ClassDefinition
165 struct ClassDefinition * prev;
166 struct ClassDefinition * next;
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;
176 unsigned int deleteWatchable;
177 } __attribute__ ((gcc_struct));
179 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
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;
190 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
191 struct ClassDefinition * classDef;
192 unsigned int templateTypesOnly;
193 unsigned int hasNameSpace;
194 } __attribute__ ((gcc_struct));
196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
200 struct Instantiation * prev;
201 struct Instantiation * next;
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;
213 } __attribute__ ((gcc_struct));
215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
219 struct Declaration * prev;
220 struct Declaration * next;
227 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
228 struct __ecereNameSpace__ecere__sys__OldList * declarators;
229 } __attribute__ ((gcc_struct)) __anon1;
230 struct Instantiation * inst;
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;
240 } __attribute__ ((gcc_struct));
242 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
246 struct Statement * prev;
247 struct Statement * next;
252 struct __ecereNameSpace__ecere__sys__OldList * expressions;
255 struct Identifier * id;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) labeled;
260 struct Expression * exp;
261 struct Statement * stmt;
262 } __attribute__ ((gcc_struct)) caseStmt;
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;
272 struct __ecereNameSpace__ecere__sys__OldList * exp;
273 struct Statement * stmt;
274 struct Statement * elseStmt;
275 } __attribute__ ((gcc_struct)) ifStmt;
278 struct __ecereNameSpace__ecere__sys__OldList * exp;
279 struct Statement * stmt;
280 } __attribute__ ((gcc_struct)) switchStmt;
283 struct __ecereNameSpace__ecere__sys__OldList * exp;
284 struct Statement * stmt;
285 } __attribute__ ((gcc_struct)) whileStmt;
288 struct __ecereNameSpace__ecere__sys__OldList * exp;
289 struct Statement * stmt;
290 } __attribute__ ((gcc_struct)) doWhile;
293 struct Statement * init;
294 struct Statement * check;
295 struct __ecereNameSpace__ecere__sys__OldList * increment;
296 struct Statement * stmt;
297 } __attribute__ ((gcc_struct)) forStmt;
300 struct Identifier * id;
301 } __attribute__ ((gcc_struct)) gotoStmt;
304 struct Specifier * spec;
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;
312 struct Expression * watcher;
313 struct Expression * object;
314 struct __ecereNameSpace__ecere__sys__OldList * watches;
315 } __attribute__ ((gcc_struct)) _watch;
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));
327 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
331 struct TypeName * prev;
332 struct TypeName * next;
334 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
335 struct Declarator * declarator;
337 struct Expression * bitCount;
338 } __attribute__ ((gcc_struct));
340 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
344 struct Initializer * prev;
345 struct Initializer * next;
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));
357 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
359 struct __ecereNameSpace__ecere__com__DataValue
374 } __attribute__ ((gcc_struct)) __anon1;
375 } __attribute__ ((gcc_struct));
377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
381 struct Expression * prev;
382 struct Expression * next;
390 struct Identifier * identifier;
391 } __attribute__ ((gcc_struct)) __anon1;
392 struct Statement * compound;
393 struct Instantiation * instance;
397 unsigned int intlString;
398 unsigned int wideString;
399 } __attribute__ ((gcc_struct)) __anon2;
400 struct __ecereNameSpace__ecere__sys__OldList * list;
403 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
404 struct Declarator * decl;
405 } __attribute__ ((gcc_struct)) _classExp;
408 struct Identifier * id;
409 } __attribute__ ((gcc_struct)) classData;
412 struct Expression * exp;
413 struct __ecereNameSpace__ecere__sys__OldList * arguments;
414 struct Location argLoc;
415 } __attribute__ ((gcc_struct)) call;
418 struct Expression * exp;
419 struct __ecereNameSpace__ecere__sys__OldList * index;
420 } __attribute__ ((gcc_struct)) index;
423 struct Expression * exp;
424 struct Identifier * member;
426 unsigned int thisPtr;
427 } __attribute__ ((gcc_struct)) member;
431 struct Expression * exp1;
432 struct Expression * exp2;
433 } __attribute__ ((gcc_struct)) op;
434 struct TypeName * typeName;
435 struct Specifier * _class;
438 struct TypeName * typeName;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) cast;
443 struct Expression * cond;
444 struct __ecereNameSpace__ecere__sys__OldList * exp;
445 struct Expression * elseExp;
446 } __attribute__ ((gcc_struct)) cond;
449 struct TypeName * typeName;
450 struct Expression * size;
451 } __attribute__ ((gcc_struct)) _new;
454 struct TypeName * typeName;
455 struct Expression * size;
456 struct Expression * exp;
457 } __attribute__ ((gcc_struct)) _renew;
461 struct Identifier * id;
462 } __attribute__ ((gcc_struct)) db;
465 struct Expression * ds;
466 struct Expression * name;
467 } __attribute__ ((gcc_struct)) dbopen;
470 struct TypeName * typeName;
471 struct Initializer * initializer;
472 } __attribute__ ((gcc_struct)) initializer;
475 struct Expression * exp;
476 struct TypeName * typeName;
477 } __attribute__ ((gcc_struct)) vaArg;
478 } __attribute__ ((gcc_struct)) __anon1;
479 unsigned int debugValue;
480 struct __ecereNameSpace__ecere__com__DataValue val;
482 unsigned int hasAddress;
483 struct Type * expType;
484 struct Type * destType;
487 unsigned int byReference;
488 unsigned int isConstant;
489 unsigned int addedThis;
490 unsigned int needCast;
491 unsigned int thisPtr;
492 unsigned int opDestType;
493 unsigned int needTemplateCast;
494 } __attribute__ ((gcc_struct));
496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
498 struct TemplateDatatype;
500 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
502 struct TemplateArgument;
504 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
506 struct TemplateParameter;
508 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
512 struct Specifier * prev;
513 struct Specifier * next;
521 struct ExtDecl * extDecl;
523 struct Symbol * symbol;
524 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
525 } __attribute__ ((gcc_struct)) __anon1;
528 struct Identifier * id;
529 struct __ecereNameSpace__ecere__sys__OldList * list;
530 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
531 struct __ecereNameSpace__ecere__sys__OldList * definitions;
532 unsigned int addNameSpace;
533 struct Context * ctx;
534 struct ExtDecl * extDeclStruct;
535 } __attribute__ ((gcc_struct)) __anon2;
536 struct Expression * expression;
537 struct Specifier * _class;
538 struct TemplateParameter * templateParameter;
539 } __attribute__ ((gcc_struct)) __anon1;
540 } __attribute__ ((gcc_struct));
542 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
546 struct Identifier * prev;
547 struct Identifier * next;
549 struct Symbol * classSym;
550 struct Specifier * _class;
552 struct Identifier * badID;
553 } __attribute__ ((gcc_struct));
555 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
559 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
563 struct Declarator * prev;
564 struct Declarator * next;
567 struct Symbol * symbol;
568 struct Declarator * declarator;
571 struct Identifier * identifier;
574 struct Expression * exp;
575 struct Expression * posExp;
576 struct Attrib * attrib;
577 } __attribute__ ((gcc_struct)) structDecl;
580 struct Expression * exp;
581 struct Specifier * enumClass;
582 } __attribute__ ((gcc_struct)) array;
585 struct __ecereNameSpace__ecere__sys__OldList * parameters;
586 } __attribute__ ((gcc_struct)) function;
589 struct Pointer * pointer;
590 } __attribute__ ((gcc_struct)) pointer;
593 struct ExtDecl * extended;
594 } __attribute__ ((gcc_struct)) extended;
595 } __attribute__ ((gcc_struct)) __anon1;
596 } __attribute__ ((gcc_struct));
598 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
600 struct FunctionDefinition
602 struct FunctionDefinition * prev;
603 struct FunctionDefinition * next;
605 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
606 struct Declarator * declarator;
607 struct __ecereNameSpace__ecere__sys__OldList * declarations;
608 struct Statement * body;
609 struct __ecereNameSpace__ecere__com__Class * _class;
610 struct __ecereNameSpace__ecere__sys__OldList attached;
613 struct Symbol * propSet;
615 unsigned int propertyNoThis;
616 } __attribute__ ((gcc_struct));
618 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
622 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
626 struct External * prev;
627 struct External * next;
630 struct Symbol * symbol;
633 struct FunctionDefinition * function;
634 struct ClassDefinition * _class;
635 struct Declaration * declaration;
637 struct Identifier * id;
638 struct DBTableDef * table;
639 } __attribute__ ((gcc_struct)) __anon1;
641 } __attribute__ ((gcc_struct));
643 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
647 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
651 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
656 struct Symbol * parent;
657 struct Symbol * left;
658 struct Symbol * right;
663 struct __ecereNameSpace__ecere__com__Method * method;
664 struct __ecereNameSpace__ecere__com__Property * _property;
665 struct __ecereNameSpace__ecere__com__Class * registered;
666 } __attribute__ ((gcc_struct)) __anon1;
673 struct External * pointerExternal;
674 struct External * structExternal;
675 } __attribute__ ((gcc_struct)) __anon1;
678 struct External * externalGet;
679 struct External * externalSet;
680 struct External * externalPtr;
681 struct External * externalIsSet;
682 } __attribute__ ((gcc_struct)) __anon2;
685 struct External * methodExternal;
686 struct External * methodCodeExternal;
687 } __attribute__ ((gcc_struct)) __anon3;
688 } __attribute__ ((gcc_struct)) __anon2;
689 unsigned int imported;
690 unsigned int declaredStructSym;
691 struct __ecereNameSpace__ecere__com__Class * _class;
692 unsigned int declaredStruct;
693 unsigned int needConstructor;
694 unsigned int needDestructor;
695 char * constructorName;
698 char * destructorName;
699 struct ModuleImport * module;
700 struct ClassImport * _import;
701 struct Location nameLoc;
702 unsigned int isParam;
703 unsigned int isRemote;
704 unsigned int isStruct;
705 unsigned int fireWatchersDone;
707 unsigned int classData;
708 unsigned int isStatic;
710 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
711 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
712 struct Context * ctx;
714 struct Expression * propCategory;
715 } __attribute__ ((gcc_struct));
717 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
726 struct Symbol * _class;
729 struct __ecereNameSpace__ecere__sys__OldList members;
731 } __attribute__ ((gcc_struct)) __anon1;
734 struct Type * returnType;
735 struct __ecereNameSpace__ecere__sys__OldList params;
736 struct Symbol * thisClass;
737 unsigned int staticMethod;
738 struct TemplateParameter * thisClassTemplate;
739 } __attribute__ ((gcc_struct)) __anon2;
742 struct __ecereNameSpace__ecere__com__Method * method;
743 struct __ecereNameSpace__ecere__com__Class * methodClass;
744 struct __ecereNameSpace__ecere__com__Class * usedClass;
745 } __attribute__ ((gcc_struct)) __anon3;
748 struct Type * arrayType;
750 struct Expression * arraySizeExp;
751 unsigned int freeExp;
752 struct Symbol * enumClass;
753 } __attribute__ ((gcc_struct)) __anon4;
755 struct TemplateParameter * templateParameter;
756 } __attribute__ ((gcc_struct)) __anon1;
766 unsigned int isSigned : 1;
767 unsigned int constant : 1;
768 unsigned int truth : 1;
769 unsigned int byReference : 1;
770 unsigned int extraParam : 1;
771 unsigned int directClassAccess : 1;
772 unsigned int computing : 1;
773 unsigned int keepCast : 1;
774 unsigned int passAsTemplate : 1;
775 unsigned int dllExport : 1;
776 unsigned int attrStdcall : 1;
777 unsigned int declaredWithStruct : 1;
778 unsigned int typedByReference : 1;
779 unsigned int casted : 1;
780 } __attribute__ ((gcc_struct));
782 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
784 struct __ecereNameSpace__ecere__com__Class
786 struct __ecereNameSpace__ecere__com__Class * prev;
787 struct __ecereNameSpace__ecere__com__Class * next;
793 unsigned int (* Constructor)(void * );
794 void (* Destructor)(void * );
797 struct __ecereNameSpace__ecere__com__Class * base;
798 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
799 struct __ecereNameSpace__ecere__sys__BinaryTree members;
800 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
801 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
802 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
803 struct __ecereNameSpace__ecere__sys__OldList derivatives;
807 struct __ecereNameSpace__ecere__com__Instance * module;
808 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
809 const char * dataTypeString;
810 struct Type * dataType;
812 int defaultAlignment;
813 void (* Initialize)();
815 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
816 const char * designerClass;
817 unsigned int noExpansion;
818 const char * defaultProperty;
819 unsigned int comRedefinition;
822 unsigned int internalDecl;
824 unsigned int computeSize;
826 int destructionWatchOffset;
828 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
829 int inheritanceAccess;
830 const char * fullName;
832 struct __ecereNameSpace__ecere__sys__OldList conversions;
833 struct __ecereNameSpace__ecere__sys__OldList templateParams;
834 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
835 struct __ecereNameSpace__ecere__com__Class * templateClass;
836 struct __ecereNameSpace__ecere__sys__OldList templatized;
838 unsigned int isInstanceClass;
839 unsigned int byValueSystemClass;
840 } __attribute__ ((gcc_struct));
842 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
844 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
846 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
848 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
850 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
852 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);
854 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
856 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
858 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
860 struct __ecereNameSpace__ecere__com__Instance
863 struct __ecereNameSpace__ecere__com__Class * _class;
865 } __attribute__ ((gcc_struct));
867 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
869 struct __ecereNameSpace__ecere__com__DataMember
871 struct __ecereNameSpace__ecere__com__DataMember * prev;
872 struct __ecereNameSpace__ecere__com__DataMember * next;
874 unsigned int isProperty;
877 struct __ecereNameSpace__ecere__com__Class * _class;
878 const char * dataTypeString;
879 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
880 struct Type * dataType;
884 struct __ecereNameSpace__ecere__sys__OldList members;
885 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
888 } __attribute__ ((gcc_struct));
890 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
892 struct __ecereNameSpace__ecere__com__SerialBuffer
894 unsigned char * _buffer;
898 } __attribute__ ((gcc_struct));
900 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
902 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
908 const char * dataTypeString;
909 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
910 } __attribute__ ((gcc_struct)) __anon1;
911 struct __ecereNameSpace__ecere__com__DataValue expression;
914 const char * memberString;
917 struct __ecereNameSpace__ecere__com__DataMember * member;
918 struct __ecereNameSpace__ecere__com__Property * prop;
919 struct __ecereNameSpace__ecere__com__Method * method;
920 } __attribute__ ((gcc_struct)) __anon1;
921 } __attribute__ ((gcc_struct)) __anon2;
922 } __attribute__ ((gcc_struct)) __anon1;
923 } __attribute__ ((gcc_struct));
927 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, WIDE_STRING_LITERAL = 373
930 typedef union YYSTYPE
935 struct Identifier * id;
936 struct Expression * exp;
937 struct Specifier * specifier;
938 struct __ecereNameSpace__ecere__sys__OldList * list;
939 struct Enumerator * enumerator;
940 struct Declarator * declarator;
941 struct Pointer * pointer;
942 struct Initializer * initializer;
943 struct InitDeclarator * initDeclarator;
944 struct TypeName * typeName;
945 struct Declaration * declaration;
946 struct Statement * stmt;
947 struct FunctionDefinition * function;
948 struct External * external;
949 struct Context * context;
950 struct AsmField * asmField;
951 struct Attrib * attrib;
952 struct ExtDecl * extDecl;
953 struct Attribute * attribute;
954 struct Instantiation * instance;
955 struct MembersInit * membersInit;
956 struct MemberInit * memberInit;
957 struct ClassFunction * classFunction;
958 struct ClassDefinition * _class;
959 struct ClassDef * classDef;
960 struct PropertyDef * prop;
962 struct Symbol * symbol;
963 struct PropertyWatch * propertyWatch;
964 struct TemplateParameter * templateParameter;
965 struct TemplateArgument * templateArgument;
966 struct TemplateDatatype * templateDatatype;
967 struct DBTableEntry * dbtableEntry;
968 struct DBIndexItem * dbindexItem;
969 struct DBTableDef * dbtableDef;
970 } __attribute__ ((gcc_struct)) YYSTYPE;
972 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
978 struct InitDeclarator;
980 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
984 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
988 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
992 struct ClassFunction * prev;
993 struct ClassFunction * next;
995 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
996 struct Declarator * declarator;
997 struct __ecereNameSpace__ecere__sys__OldList * declarations;
998 struct Statement * body;
999 struct __ecereNameSpace__ecere__com__Class * _class;
1000 struct __ecereNameSpace__ecere__sys__OldList attached;
1003 struct Symbol * propSet;
1004 unsigned int isVirtual;
1005 unsigned int isConstructor;
1006 unsigned int isDestructor;
1007 unsigned int dontMangle;
1010 } __attribute__ ((gcc_struct));
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1016 struct MembersInit * prev;
1017 struct MembersInit * next;
1018 struct Location loc;
1022 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1023 struct ClassFunction * function;
1024 } __attribute__ ((gcc_struct)) __anon1;
1025 } __attribute__ ((gcc_struct));
1027 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1031 struct MemberInit * prev;
1032 struct MemberInit * next;
1033 struct Location loc;
1034 struct Location realLoc;
1035 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1036 struct Initializer * initializer;
1038 unsigned int variable;
1039 unsigned int takeOutExp;
1040 } __attribute__ ((gcc_struct));
1042 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1046 struct PropertyDef * prev;
1047 struct PropertyDef * next;
1048 struct Location loc;
1049 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1050 struct Declarator * declarator;
1051 struct Identifier * id;
1052 struct Statement * getStmt;
1053 struct Statement * setStmt;
1054 struct Statement * issetStmt;
1055 struct Symbol * symbol;
1056 struct Expression * category;
1059 unsigned int conversion : 1;
1060 unsigned int isWatchable : 1;
1061 unsigned int isDBProp : 1;
1062 } __attribute__ ((gcc_struct)) __anon1;
1063 } __attribute__ ((gcc_struct));
1065 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1067 struct PropertyWatch;
1069 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1073 struct ClassDef * prev;
1074 struct ClassDef * next;
1075 struct Location loc;
1079 struct Declaration * decl;
1080 struct ClassFunction * function;
1081 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1082 struct PropertyDef * propertyDef;
1083 struct PropertyWatch * propertyWatch;
1085 struct Identifier * defaultProperty;
1088 struct Identifier * id;
1089 struct Initializer * initializer;
1090 } __attribute__ ((gcc_struct)) __anon1;
1091 } __attribute__ ((gcc_struct)) __anon1;
1094 } __attribute__ ((gcc_struct));
1096 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1098 struct DBTableEntry;
1100 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1104 extern YYSTYPE yylval;
1106 extern struct Location yylloc;
1108 extern struct External * curExternal;
1110 extern char * strcat(char * , const char * );
1112 extern size_t strlen(const char * );
1114 extern int strncmp(const char * , const char * , size_t n);
1116 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
1122 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1126 strcat(output, "__ecereNameSpace__");
1130 len = strlen(output);
1132 if(!strncmp(className, "const ", 6))
1134 for(; (ch = className[c]); c++)
1137 output[len++] = '_';
1139 output[len++] = '_';
1142 output[len++] = '_';
1143 output[len++] = 'P';
1144 output[len++] = 'T';
1145 output[len++] = 'R';
1146 output[len++] = '_';
1150 output[len++] = '_';
1151 output[len++] = 'E';
1152 output[len++] = 'Q';
1153 output[len++] = 'U';
1154 output[len++] = '_';
1158 if(!includeTemplateParams)
1160 if(!strncmp(className + c + 1, "const ", 6))
1162 output[len++] = '_';
1163 output[len++] = 'T';
1164 output[len++] = 'P';
1165 output[len++] = 'L';
1166 output[len++] = '_';
1170 output[len++] = '_';
1174 if(!strncmp(className + c + 1, "const ", 6))
1176 output[len++] = '_';
1181 output[len++] = (char)0;
1184 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);
1186 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1188 if(_class->type != 1000)
1189 AddMembers(list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1194 struct __ecereNameSpace__ecere__com__NameSpace
1197 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1198 struct __ecereNameSpace__ecere__com__NameSpace * left;
1199 struct __ecereNameSpace__ecere__com__NameSpace * right;
1201 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1202 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1203 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1204 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1205 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1206 } __attribute__ ((gcc_struct));
1208 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1212 else if((*ns).parent)
1213 return NameSpaceContained((*ns).parent, parent);
1218 extern void Compiler_Error(const char * format, ...);
1220 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
1222 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1224 struct __ecereNameSpace__ecere__com__Module
1226 struct __ecereNameSpace__ecere__com__Instance * application;
1227 struct __ecereNameSpace__ecere__sys__OldList classes;
1228 struct __ecereNameSpace__ecere__sys__OldList defines;
1229 struct __ecereNameSpace__ecere__sys__OldList functions;
1230 struct __ecereNameSpace__ecere__sys__OldList modules;
1231 struct __ecereNameSpace__ecere__com__Instance * prev;
1232 struct __ecereNameSpace__ecere__com__Instance * next;
1238 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1239 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1240 } __attribute__ ((gcc_struct));
1242 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1244 struct __ecereNameSpace__ecere__com__Application
1247 const char * * argv;
1249 unsigned int isGUIApp;
1250 struct __ecereNameSpace__ecere__sys__OldList allModules;
1251 char * parsedCommand;
1252 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1253 } __attribute__ ((gcc_struct));
1255 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1257 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1259 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1261 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1265 if(regClass->templateClass)
1266 regClass = regClass->templateClass;
1267 if(classSym->isStatic && access != 3)
1269 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1271 else if(access == 1)
1273 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->application + structSize_Module)))->systemNameSpace))
1275 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1276 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1282 static void CheckPublicTypeName(struct TypeName * type, int access)
1284 if(type->qualifiers)
1286 struct Specifier * spec;
1288 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1292 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1294 CheckPublicClass(classSym, access, "define");
1300 static void CheckPublicExpression(struct Expression * exp, int access);
1302 static void CheckPublicInitializer(struct Initializer * init, int access)
1307 CheckPublicExpression(init->__anon1.exp, access);
1311 struct Initializer * i;
1313 for(i = (*init->__anon1.list).first; i; i = i->next)
1314 CheckPublicInitializer(i, access);
1320 static void CheckPublicExpression(struct Expression * exp, int access)
1333 if(exp->__anon1.op.exp1)
1334 CheckPublicExpression(exp->__anon1.op.exp1, access);
1335 if(exp->__anon1.op.exp2)
1336 CheckPublicExpression(exp->__anon1.op.exp2, access);
1340 struct Expression * e;
1342 for(e = (*exp->__anon1.list).first; e; e = e->next)
1343 CheckPublicExpression(e, access);
1348 struct Expression * e;
1350 CheckPublicExpression(exp->__anon1.index.exp, access);
1351 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1352 CheckPublicExpression(e, access);
1357 struct Expression * e;
1359 CheckPublicExpression(exp->__anon1.call.exp, access);
1360 if(exp->__anon1.call.arguments)
1362 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1363 CheckPublicExpression(e, access);
1369 CheckPublicExpression(exp->__anon1.member.exp, access);
1374 CheckPublicExpression(exp->__anon1.member.exp, access);
1378 CheckPublicTypeName(exp->__anon1.typeName, access);
1382 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1383 if(exp->__anon1.cast.exp)
1384 CheckPublicExpression(exp->__anon1.cast.exp, access);
1389 struct Expression * e;
1391 CheckPublicExpression(exp->__anon1.cond.cond, access);
1392 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1393 CheckPublicExpression(e, access);
1394 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1399 CheckPublicExpression(exp->__anon1._new.size, access);
1403 CheckPublicExpression(exp->__anon1._renew.size, access);
1404 CheckPublicExpression(exp->__anon1._renew.exp, access);
1408 struct MembersInit * members;
1410 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1411 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1413 if(members->type == 0)
1415 struct MemberInit * member;
1417 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1419 CheckPublicInitializer(member->initializer, access);
1429 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1437 CheckPublicClass(type->__anon1._class, access, word);
1447 struct Type * param;
1449 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1450 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1451 CheckPublicDataType(param, access, word);
1452 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1456 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1457 if(type->__anon1.__anon4.enumClass)
1458 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1462 CheckPublicDataType(type->__anon1.type, access, word);
1471 CheckPublicClass(type->__anon1._class, access, word);
1478 extern struct Identifier * GetDeclId(struct Declarator * decl);
1480 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1482 struct __ecereNameSpace__ecere__com__BTNamedLink
1485 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1486 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1487 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1490 } __attribute__ ((gcc_struct));
1492 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);
1494 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
1496 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1498 if(definitions != (((void *)0)))
1500 struct ClassDef * def;
1502 for(def = definitions->first; def; def = def->next)
1506 struct Declaration * decl = def->__anon1.decl;
1507 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1512 struct Declarator * d;
1514 if(decl->__anon1.__anon1.declarators)
1516 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1518 struct Identifier * declId = GetDeclId(d);
1524 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1526 dataMember = link ? link->data : (((void *)0));
1529 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1531 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1535 else if(decl->__anon1.__anon1.specifiers)
1537 struct Specifier * spec;
1539 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1541 if(spec->type == 3 || spec->type == 4)
1543 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1545 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1547 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1551 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1553 dataMember = link ? link->data : (((void *)0));
1556 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1558 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1564 else if(decl->type == 2)
1566 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1573 extern unsigned int inCompiler;
1575 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1577 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
1579 extern struct Symbol * FindClass(const char * name);
1581 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);
1583 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);
1585 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);
1587 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);
1589 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);
1591 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1593 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1595 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1597 extern struct Specifier * MkSpecifierName(const char * name);
1599 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1601 extern struct Identifier * MkIdentifier(const char * string);
1603 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1605 extern struct Expression * QMkExpId(const char * id);
1607 extern void FreeDeclarator(struct Declarator * decl);
1609 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
1611 extern void FreeSpecifier(struct Specifier * spec);
1613 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
1615 extern struct Type * MkClassType(const char * name);
1617 extern char * strcpy(char * , const char * );
1619 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1621 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1623 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1625 extern void FreeExternal(struct External * external);
1627 extern int declMode;
1629 extern int structDeclMode;
1631 extern char * strstr(const char * , const char * );
1633 extern const char * sourceFile;
1635 extern struct Specifier * MkSpecifier(int specifier);
1637 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1639 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1641 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1643 extern struct Context * PushContext(void);
1645 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1647 extern struct Expression * CopyExpression(struct Expression * exp);
1649 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1651 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1653 extern void PopContext(struct Context * ctx);
1655 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1657 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1659 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1661 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1663 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1665 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1667 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1669 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1671 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1673 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1675 extern void FreeInitializer(struct Initializer * initializer);
1677 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1679 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1681 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1683 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1685 extern void Compiler_Warning(const char * format, ...);
1687 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
1689 extern struct ExtDecl * MkExtDeclAttrib(struct Attrib * attr);
1691 extern struct Attrib * MkAttrib(int type, struct __ecereNameSpace__ecere__sys__OldList * attribs);
1693 extern struct Attribute * MkAttribute(char * attr, struct Expression * exp);
1695 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1697 extern int sprintf(char * , const char * , ...);
1699 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1701 extern struct Context * curContext;
1703 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1705 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1707 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1709 extern void FreeType(struct Type * type);
1711 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1713 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1715 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1717 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1719 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1721 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1723 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1725 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1727 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1729 unsigned int __ecereProp_Type_Get_isPointerType(struct Type * this);
1731 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_isPointerType;
1733 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)
1735 char structName[1024];
1736 char className[1024];
1737 char constructorName[1024];
1738 char destructorName[1024];
1739 struct __ecereNameSpace__ecere__com__Class * regClass;
1740 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1741 unsigned int isUnion = classType == 6;
1742 struct External * external = (((void *)0));
1743 struct ClassDef * def;
1744 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
1745 struct __ecereNameSpace__ecere__sys__OldList * classDataList = (((void *)0));
1750 classDataList = MkList();
1752 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1755 classType = regClass->type;
1759 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1761 if(!regClass->base->symbol)
1762 regClass->base->symbol = FindClass(regClass->base->fullName);
1763 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1765 else if(!symbol->isStatic && regClass->base)
1767 if(!regClass->base->symbol)
1768 regClass->base->symbol = FindClass(regClass->base->fullName);
1769 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1772 if(definitions != (((void *)0)))
1774 for(def = definitions->first; def; def = def->next)
1778 struct __ecereNameSpace__ecere__com__DataMember * member;
1779 struct __ecereNameSpace__ecere__com__Property * prop;
1780 struct __ecereNameSpace__ecere__com__Method * method;
1782 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1784 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1786 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1788 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1790 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1792 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1797 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1804 external = MkExternalDeclaration((((void *)0)));
1805 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1806 curExternal = external;
1807 curExternal->symbol = symbol;
1809 if((classType == 1 || classType == 5) && inCompiler)
1811 AddSimpleBaseMembers(list, regClass->base, regClass);
1813 if(definitions != (((void *)0)))
1817 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1818 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1819 else if(!symbol->isStatic)
1820 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1822 for(def = definitions->first; def; def = def->next)
1827 struct Declaration * decl = def->__anon1.decl;
1832 if(inCompiler && classType != 2)
1834 ListAdd(list, MkClassDefDeclaration(decl));
1835 def->__anon1.decl = (((void *)0));
1838 else if(decl->type == 2)
1840 struct Instantiation * inst = decl->__anon1.inst;
1841 struct Expression * exp = inst->exp;
1842 struct Symbol * classSym;
1846 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1847 struct Declarator * d;
1849 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1850 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1853 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1855 ListAdd(declarators, d);
1856 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1857 ListAdd(list, MkClassDefDeclaration(decl));
1859 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1860 exp->__anon1.member.exp = QMkExpId("this");
1861 exp->__anon1.member.memberType = 3;
1862 exp->__anon1.member.thisPtr = 1;
1867 FreeList(specifiers, (void *)(FreeSpecifier));
1870 classSym = inst->_class->__anon1.__anon1.symbol;
1871 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1873 if(inst->members && (*inst->members).count)
1874 symbol->needConstructor = 1;
1878 symbol->needConstructor = 1;
1879 symbol->needDestructor = 1;
1883 else if(def->type == 9)
1885 struct Declaration * decl = def->__anon1.decl;
1889 if(inCompiler && classType != 2)
1891 ListAdd(classDataList, MkClassDefDeclaration(decl));
1892 def->__anon1.decl = (((void *)0));
1896 else if(def->type == 1)
1897 symbol->needConstructor = 1;
1898 else if(def->type == 4)
1899 symbol->needConstructor = 1;
1900 else if(def->type == 0)
1902 struct ClassFunction * func = def->__anon1.function;
1904 if(func->isDestructor)
1909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1913 symbol->needDestructor = 1;
1915 if(!inCompiler && func->body)
1917 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1919 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1923 if(func->isConstructor)
1928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1932 symbol->needConstructor = 1;
1934 if(!inCompiler && func->body)
1936 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1938 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1947 external->symbol = (((void *)0));
1950 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1952 initDeclarators = (((void *)0));
1953 strcpy(structName, symbol->string);
1954 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1956 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1958 spec->__anon1.__anon2.extDeclStruct = extDecl;
1959 ListAdd(specs, spec);
1961 external->symbol = symbol;
1962 symbol->__anon2.__anon1.structExternal = external;
1963 external->__anon1.declaration = MkDeclaration(specs, declarators);
1965 symbol->declaredStruct = 1;
1969 curExternal = external->prev;
1970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1971 FreeExternal(external);
1972 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1974 if((*classDataList).count)
1976 char classDataStructName[1024];
1977 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1978 struct External * external;
1980 strcpy(classDataStructName, "__ecereClassData_");
1981 FullClassNameCat(classDataStructName, symbol->string, 0);
1982 declMode = structDeclMode = 0;
1983 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1984 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1985 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1987 symbol->classData = 1;
1990 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1995 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1997 strcpy(className, "__ecereClass_");
1998 FullClassNameCat(className, symbol->string, 1);
1999 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2000 if(!strstr(sourceFile, ".main.ec"))
2001 ListAdd(specs, MkSpecifier(STATIC));
2002 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2003 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2004 symbol->__anon2.__anon3.methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2005 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon3.methodExternal);
2006 after = symbol->__anon2.__anon3.methodExternal;
2008 if(symbol->needDestructor)
2010 struct ClassFunction * function;
2011 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2012 struct Declarator * decl;
2013 struct Statement * body;
2014 struct Context * context;
2015 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2017 strcpy(destructorName, "__ecereDestructor_");
2018 FullClassNameCat(destructorName, symbol->string, 0);
2019 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2020 ListAdd(specs, MkSpecifier(VOID));
2021 context = PushContext();
2022 statements = MkList();
2023 if(definitions != (((void *)0)))
2025 for(def = definitions->first; def; def = def->next)
2027 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2029 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2030 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2032 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2034 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2036 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2038 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2040 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2042 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2047 if(destructor && destructor->body)
2049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2050 destructor->body->__anon1.compound.context->parent = context;
2051 destructor->body = (((void *)0));
2053 body = MkCompoundStmt(declarations, statements);
2054 PopContext(context);
2055 body->__anon1.compound.context = context;
2056 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2057 decl->symbol = __extension__ ({
2058 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2060 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2063 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2064 ProcessClassFunctionBody(function, body);
2065 function->id = symbol->id;
2066 function->idCode = symbol->idCode;
2067 function->dontMangle = 1;
2068 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2070 if(symbol->needConstructor && inCompiler)
2072 struct ClassFunction * function;
2073 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2074 struct Declarator * decl;
2075 struct Statement * body;
2076 struct Context * context;
2077 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2079 strcpy(constructorName, "__ecereConstructor_");
2080 FullClassNameCat(constructorName, symbol->string, 0);
2081 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2082 ListAdd(specs, MkSpecifierName("bool"));
2083 context = PushContext();
2084 statements = MkList();
2085 if(definitions != (((void *)0)))
2087 for(def = definitions->first; def; def = def->next)
2089 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2091 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2092 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2094 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2096 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2099 newInst->members = (((void *)0));
2100 newInst->exp = CopyExpression(inst->exp);
2101 newInst->_class = CopySpecifier(inst->_class);
2102 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2105 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2107 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2111 for(def = definitions->first; def; def = def->next)
2113 if(def->type == 1 && def->__anon1.defProperties)
2115 struct MemberInit * propertyDef;
2117 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2119 struct Expression * memberExp;
2120 struct Identifier * id = (*propertyDef->identifiers).first;
2124 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2125 for(id = id->next; id; id = id->next)
2126 memberExp = MkExpMember(memberExp, id);
2127 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2129 if(propertyDef->initializer)
2131 if(propertyDef->initializer->type == 0)
2132 propertyDef->initializer->__anon1.exp = (((void *)0));
2133 FreeInitializer(propertyDef->initializer);
2135 propertyDef->initializer = (((void *)0));
2136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2140 for(def = definitions->first; def; def = def->next)
2142 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2144 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2145 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2147 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2149 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2151 def->__anon1.decl->__anon1.inst = (((void *)0));
2152 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2158 if(constructor && constructor->body)
2160 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2161 constructor->body->__anon1.compound.context->parent = context;
2162 constructor->body = (((void *)0));
2164 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2165 body = MkCompoundStmt(declarations, statements);
2166 PopContext(context);
2167 body->__anon1.compound.context = context;
2168 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2169 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2171 decl->symbol->id = symbol->id;
2172 decl->symbol->idCode = symbol->idCode;
2173 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2174 ProcessClassFunctionBody(function, body);
2175 function->id = symbol->id;
2176 function->idCode = symbol->idCode;
2177 function->dontMangle = 1;
2178 if(definitions != (((void *)0)))
2179 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2182 if(definitions != (((void *)0)))
2184 for(def = definitions->first; def; def = def->next)
2186 if(def->type == 3 && def->__anon1.propertyDef)
2188 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2189 struct ClassDef * after = def;
2190 struct ClassDef * newDef;
2194 yylloc = propertyDef->loc;
2195 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2196 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2197 else if(!symbol->isStatic)
2198 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2202 struct ClassFunction * func;
2203 struct Declarator * decl;
2205 struct __ecereNameSpace__ecere__sys__OldList * params;
2207 if(propertyDef->getStmt && propertyDef->id)
2209 strcpy(name, "__ecereProp_");
2210 FullClassNameCat(name, symbol->string, 0);
2211 strcat(name, "_Get_");
2212 FullClassNameCat(name, propertyDef->id->string, 1);
2214 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)
2216 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkDeclaratorIdentifier(MkIdentifier("value"))));
2217 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2218 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2222 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2223 func = MkClassFunction(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), (((void *)0)), decl, (((void *)0)));
2225 ProcessClassFunctionBody(func, propertyDef->getStmt);
2226 func->declarator->symbol = propertyDef->symbol;
2227 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2228 func->dontMangle = 1;
2229 newDef = MkClassDefFunction(func);
2230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2233 propertyDef->getStmt = (((void *)0));
2235 func->body = (((void *)0));
2237 if(propertyDef->setStmt && propertyDef->id)
2239 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2241 strcpy(name, "__ecereProp_");
2242 FullClassNameCat(name, symbol->string, 0);
2243 strcat(name, "_Set_");
2244 FullClassNameCat(name, propertyDef->id->string, 1);
2246 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2247 if(propertyDef->__anon1.isDBProp)
2249 struct Specifier * spec;
2250 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2252 for(spec = (*specs).first; spec; spec = spec->next)
2253 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2256 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2258 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2260 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2261 unsigned int useVoid = 0;
2263 switch(regClass->type)
2271 useVoid = !isConversion;
2274 useVoid = !isConversion;
2275 if(useVoid && !propertyDef->__anon1.isDBProp)
2276 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2278 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2280 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2281 ProcessClassFunctionBody(func, propertyDef->setStmt);
2282 func->dontMangle = 1;
2283 func->declarator->symbol = propertyDef->symbol;
2284 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2285 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2286 func->propSet = propertyDef->symbol;
2287 newDef = MkClassDefFunction(func);
2288 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2291 propertyDef->setStmt = (((void *)0));
2293 func->body = (((void *)0));
2295 if(propertyDef->issetStmt && propertyDef->id)
2297 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2299 strcpy(name, "__ecereProp_");
2300 FullClassNameCat(name, symbol->string, 0);
2301 strcat(name, "_IsSet_");
2302 FullClassNameCat(name, propertyDef->id->string, 1);
2304 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2305 ListAdd(specifiers, MkSpecifierName("bool"));
2306 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2307 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2308 func->dontMangle = 1;
2309 func->declarator->symbol = propertyDef->symbol;
2310 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2311 newDef = MkClassDefFunction(func);
2312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2315 propertyDef->issetStmt = (((void *)0));
2317 func->body = (((void *)0));
2319 if(propertyDef->id && inCompiler)
2321 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2322 struct Declaration * decl;
2323 struct External * external;
2324 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2327 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*specifiers), MkSpecifierExtended(MkExtDeclAttrib(MkAttrib(ATTRIB, MkListOne(MkAttribute(__ecereNameSpace__ecere__sys__CopyString("unused"), (((void *)0))))))));
2328 ListAdd(specifiers, MkSpecifierName("Property"));
2329 strcpy(name, "__ecereProp_");
2330 FullClassNameCat(name, symbol->string, 0);
2332 FullClassNameCat(name, propertyDef->id->string, 1);
2334 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2336 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2337 strcpy(name, "__ecerePropM_");
2338 FullClassNameCat(name, symbol->string, 0);
2340 FullClassNameCat(name, propertyDef->id->string, 1);
2341 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2342 decl = MkDeclaration(specifiers, list);
2344 external = MkExternalDeclaration(decl);
2345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2346 external->symbol = propertyDef->symbol;
2347 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2348 if(inCompiler && prop && prop->symbol)
2349 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2354 else if(def->type == 10 && def->__anon1.propertyDef)
2356 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2357 struct ClassDef * after = def;
2358 struct ClassDef * newDef;
2363 yylloc = propertyDef->loc;
2364 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2365 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2366 else if(!symbol->isStatic)
2367 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2370 struct ClassFunction * func;
2371 struct Declarator * decl;
2373 struct __ecereNameSpace__ecere__sys__OldList * params;
2375 if(propertyDef->getStmt && propertyDef->id)
2377 struct Declarator * declId;
2379 sprintf(name, "class::__ecereClassProp_");
2380 FullClassNameCat(name, symbol->string, 0);
2381 strcat(name, "_Get_");
2382 strcat(name, propertyDef->id->string);
2384 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2386 decl = MkDeclaratorFunction(declId, params);
2387 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2389 ProcessClassFunctionBody(func, propertyDef->getStmt);
2390 func->declarator->symbol = propertyDef->symbol;
2391 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2392 func->dontMangle = 1;
2393 newDef = MkClassDefFunction(func);
2394 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2396 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2397 func->type = ProcessType(propertyDef->specifiers, decl);
2398 FreeDeclarator(decl);
2399 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)
2400 func->type->__anon1.__anon2.returnType->byReference = 1;
2401 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2403 propertyDef->getStmt = (((void *)0));
2405 func->body = (((void *)0));
2407 if(propertyDef->setStmt && propertyDef->id)
2409 struct Context * prevCurContext;
2410 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2411 struct Statement * body = propertyDef->setStmt;
2412 struct Declarator * ptrDecl;
2413 struct Expression * e;
2415 strcpy(name, "class::__ecereClassProp_");
2416 FullClassNameCat(name, symbol->string, 0);
2417 strcat(name, "_Set_");
2418 strcat(name, propertyDef->id->string);
2420 prevCurContext = curContext;
2421 curContext = body->__anon1.compound.context;
2422 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2423 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2424 if(!body->__anon1.compound.declarations)
2425 body->__anon1.compound.declarations = MkList();
2426 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)
2427 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2429 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2430 e = MkExpIdentifier(MkIdentifier("_value"));
2431 if(__ecereProp_Type_Get_isPointerType(propertyDef->symbol->type))
2432 e = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uintptr")), (((void *)0))), e);
2433 ListAdd(body->__anon1.compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, (void *)(CopySpecifier)), CopyDeclarator(propertyDef->declarator)), e))))));
2434 curContext = prevCurContext;
2436 struct Symbol * sym = ptrDecl->symbol;
2439 FreeType(sym->type);
2440 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2442 ListAdd(specifiers, MkSpecifier(VOID));
2443 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2444 ProcessClassFunctionBody(func, propertyDef->setStmt);
2445 func->dontMangle = 1;
2446 func->declarator->symbol = propertyDef->symbol;
2447 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2448 newDef = MkClassDefFunction(func);
2449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2452 propertyDef->setStmt = (((void *)0));
2454 func->body = (((void *)0));
2459 else if(def->type == 0 && def->__anon1.function->declarator)
2461 struct ClassFunction * func = def->__anon1.function;
2463 func->_class = regClass;
2464 if(!func->dontMangle)
2466 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2467 struct Identifier * id = GetDeclId(funcDecl);
2468 struct __ecereNameSpace__ecere__com__Method * method;
2470 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2472 if(!funcDecl->__anon1.function.parameters)
2473 funcDecl->__anon1.function.parameters = MkList();
2474 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2476 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2477 FreeSpecifier(id->_class);
2478 id->_class = (((void *)0));
2479 if(inCompiler && method)
2481 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2484 ProcessMethodType(method);
2486 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2487 CheckPublicDataType(method->dataType, 1, "class method");
2488 strcpy(newId, "__ecereMethod_");
2489 FullClassNameCat(newId, symbol->string, 0);
2491 strcat(newId, id->string);
2492 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2494 if(method->type != 1)
2498 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2499 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2507 if(initDeclarators != (((void *)0)))
2508 FreeList(initDeclarators, (void *)(FreeInitDeclarator));
2511 void PreProcessClassDefinitions()
2513 struct External * external, * next;
2515 curExternal = (((void *)0));
2518 for(external = (*ast).first; external; external = next)
2520 next = external->next;
2521 curExternal = external;
2522 if(external->type == 2)
2524 struct ClassDefinition * _class = external->__anon1._class;
2526 if(_class->definitions)
2528 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2531 else if(external->type == 1)
2533 struct Declaration * declaration = external->__anon1.declaration;
2535 if(declaration->type == 1)
2537 if(declaration->__anon1.__anon1.specifiers)
2539 struct Specifier * specifier;
2541 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2543 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)))
2545 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2549 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2550 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2552 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2555 initDeclarators = declaration->__anon1.__anon1.declarators;
2556 declaration->__anon1.__anon1.declarators = (((void *)0));
2558 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);
2564 else if(inCompiler && declaration->type == 3)
2566 yylloc = declaration->loc;
2567 if(declaration->declMode == 1)
2568 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2569 else if(declaration->declMode != 3)
2570 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2573 else if(external->type == 3)
2576 else if(inCompiler && external->type == 0)
2578 yylloc = external->__anon1.function->loc;
2579 if(!external->__anon1.function->type)
2580 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2581 if(external->__anon1.function->declMode == 1)
2582 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2583 else if(external->__anon1.function->declMode != 3)
2584 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2590 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2592 struct __ecereNameSpace__ecere__com__GlobalFunction;
2594 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);
2596 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2598 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2600 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2601 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2604 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)