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 } __attribute__ ((gcc_struct)) __anon2;
399 struct __ecereNameSpace__ecere__sys__OldList * list;
402 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
403 struct Declarator * decl;
404 } __attribute__ ((gcc_struct)) _classExp;
407 struct Identifier * id;
408 } __attribute__ ((gcc_struct)) classData;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * arguments;
413 struct Location argLoc;
414 } __attribute__ ((gcc_struct)) call;
417 struct Expression * exp;
418 struct __ecereNameSpace__ecere__sys__OldList * index;
419 } __attribute__ ((gcc_struct)) index;
422 struct Expression * exp;
423 struct Identifier * member;
425 unsigned int thisPtr;
426 } __attribute__ ((gcc_struct)) member;
430 struct Expression * exp1;
431 struct Expression * exp2;
432 } __attribute__ ((gcc_struct)) op;
433 struct TypeName * typeName;
434 struct Specifier * _class;
437 struct TypeName * typeName;
438 struct Expression * exp;
439 } __attribute__ ((gcc_struct)) cast;
442 struct Expression * cond;
443 struct __ecereNameSpace__ecere__sys__OldList * exp;
444 struct Expression * elseExp;
445 } __attribute__ ((gcc_struct)) cond;
448 struct TypeName * typeName;
449 struct Expression * size;
450 } __attribute__ ((gcc_struct)) _new;
453 struct TypeName * typeName;
454 struct Expression * size;
455 struct Expression * exp;
456 } __attribute__ ((gcc_struct)) _renew;
460 struct Identifier * id;
461 } __attribute__ ((gcc_struct)) db;
464 struct Expression * ds;
465 struct Expression * name;
466 } __attribute__ ((gcc_struct)) dbopen;
469 struct TypeName * typeName;
470 struct Initializer * initializer;
471 } __attribute__ ((gcc_struct)) initializer;
474 struct Expression * exp;
475 struct TypeName * typeName;
476 } __attribute__ ((gcc_struct)) vaArg;
477 } __attribute__ ((gcc_struct)) __anon1;
478 unsigned int debugValue;
479 struct __ecereNameSpace__ecere__com__DataValue val;
481 unsigned int hasAddress;
482 struct Type * expType;
483 struct Type * destType;
486 unsigned int byReference;
487 unsigned int isConstant;
488 unsigned int addedThis;
489 unsigned int needCast;
490 unsigned int thisPtr;
491 unsigned int opDestType;
492 unsigned int needTemplateCast;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
497 struct TemplateDatatype;
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
501 struct TemplateArgument;
503 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
505 struct TemplateParameter;
507 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
511 struct Specifier * prev;
512 struct Specifier * next;
520 struct ExtDecl * extDecl;
522 struct Symbol * symbol;
523 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
524 } __attribute__ ((gcc_struct)) __anon1;
527 struct Identifier * id;
528 struct __ecereNameSpace__ecere__sys__OldList * list;
529 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
530 struct __ecereNameSpace__ecere__sys__OldList * definitions;
531 unsigned int addNameSpace;
532 struct Context * ctx;
533 struct ExtDecl * extDeclStruct;
534 } __attribute__ ((gcc_struct)) __anon2;
535 struct Expression * expression;
536 struct Specifier * _class;
537 struct TemplateParameter * templateParameter;
538 } __attribute__ ((gcc_struct)) __anon1;
539 } __attribute__ ((gcc_struct));
541 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
545 struct Identifier * prev;
546 struct Identifier * next;
548 struct Symbol * classSym;
549 struct Specifier * _class;
551 struct Identifier * badID;
552 } __attribute__ ((gcc_struct));
554 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
562 struct Declarator * prev;
563 struct Declarator * next;
566 struct Symbol * symbol;
567 struct Declarator * declarator;
570 struct Identifier * identifier;
573 struct Expression * exp;
574 struct Expression * posExp;
575 struct Attrib * attrib;
576 } __attribute__ ((gcc_struct)) structDecl;
579 struct Expression * exp;
580 struct Specifier * enumClass;
581 } __attribute__ ((gcc_struct)) array;
584 struct __ecereNameSpace__ecere__sys__OldList * parameters;
585 } __attribute__ ((gcc_struct)) function;
588 struct Pointer * pointer;
589 } __attribute__ ((gcc_struct)) pointer;
592 struct ExtDecl * extended;
593 } __attribute__ ((gcc_struct)) extended;
594 } __attribute__ ((gcc_struct)) __anon1;
595 } __attribute__ ((gcc_struct));
597 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
599 struct FunctionDefinition
601 struct FunctionDefinition * prev;
602 struct FunctionDefinition * next;
604 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
605 struct Declarator * declarator;
606 struct __ecereNameSpace__ecere__sys__OldList * declarations;
607 struct Statement * body;
608 struct __ecereNameSpace__ecere__com__Class * _class;
609 struct __ecereNameSpace__ecere__sys__OldList attached;
612 struct Symbol * propSet;
614 unsigned int propertyNoThis;
615 } __attribute__ ((gcc_struct));
617 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
621 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
625 struct External * prev;
626 struct External * next;
629 struct Symbol * symbol;
632 struct FunctionDefinition * function;
633 struct ClassDefinition * _class;
634 struct Declaration * declaration;
636 struct Identifier * id;
637 struct DBTableDef * table;
638 } __attribute__ ((gcc_struct)) __anon1;
640 } __attribute__ ((gcc_struct));
642 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
646 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
650 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
655 struct Symbol * parent;
656 struct Symbol * left;
657 struct Symbol * right;
662 struct __ecereNameSpace__ecere__com__Method * method;
663 struct __ecereNameSpace__ecere__com__Property * _property;
664 struct __ecereNameSpace__ecere__com__Class * registered;
665 } __attribute__ ((gcc_struct)) __anon1;
672 struct External * pointerExternal;
673 struct External * structExternal;
674 } __attribute__ ((gcc_struct)) __anon1;
677 struct External * externalGet;
678 struct External * externalSet;
679 struct External * externalPtr;
680 struct External * externalIsSet;
681 } __attribute__ ((gcc_struct)) __anon2;
684 struct External * methodExternal;
685 struct External * methodCodeExternal;
686 } __attribute__ ((gcc_struct)) __anon3;
687 } __attribute__ ((gcc_struct)) __anon2;
688 unsigned int imported;
689 unsigned int declaredStructSym;
690 struct __ecereNameSpace__ecere__com__Class * _class;
691 unsigned int declaredStruct;
692 unsigned int needConstructor;
693 unsigned int needDestructor;
694 char * constructorName;
697 char * destructorName;
698 struct ModuleImport * module;
699 struct ClassImport * _import;
700 struct Location nameLoc;
701 unsigned int isParam;
702 unsigned int isRemote;
703 unsigned int isStruct;
704 unsigned int fireWatchersDone;
706 unsigned int classData;
707 unsigned int isStatic;
709 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
710 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
711 struct Context * ctx;
713 struct Expression * propCategory;
714 } __attribute__ ((gcc_struct));
716 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
725 struct Symbol * _class;
728 struct __ecereNameSpace__ecere__sys__OldList members;
730 } __attribute__ ((gcc_struct)) __anon1;
733 struct Type * returnType;
734 struct __ecereNameSpace__ecere__sys__OldList params;
735 struct Symbol * thisClass;
736 unsigned int staticMethod;
737 struct TemplateParameter * thisClassTemplate;
738 } __attribute__ ((gcc_struct)) __anon2;
741 struct __ecereNameSpace__ecere__com__Method * method;
742 struct __ecereNameSpace__ecere__com__Class * methodClass;
743 struct __ecereNameSpace__ecere__com__Class * usedClass;
744 } __attribute__ ((gcc_struct)) __anon3;
747 struct Type * arrayType;
749 struct Expression * arraySizeExp;
750 unsigned int freeExp;
751 struct Symbol * enumClass;
752 } __attribute__ ((gcc_struct)) __anon4;
754 struct TemplateParameter * templateParameter;
755 } __attribute__ ((gcc_struct)) __anon1;
765 unsigned int isSigned : 1;
766 unsigned int constant : 1;
767 unsigned int truth : 1;
768 unsigned int byReference : 1;
769 unsigned int extraParam : 1;
770 unsigned int directClassAccess : 1;
771 unsigned int computing : 1;
772 unsigned int keepCast : 1;
773 unsigned int passAsTemplate : 1;
774 unsigned int dllExport : 1;
775 unsigned int attrStdcall : 1;
776 unsigned int declaredWithStruct : 1;
777 unsigned int typedByReference : 1;
778 unsigned int casted : 1;
779 } __attribute__ ((gcc_struct));
781 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
783 struct __ecereNameSpace__ecere__com__Class
785 struct __ecereNameSpace__ecere__com__Class * prev;
786 struct __ecereNameSpace__ecere__com__Class * next;
792 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
793 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
796 struct __ecereNameSpace__ecere__com__Class * base;
797 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
798 struct __ecereNameSpace__ecere__sys__BinaryTree members;
799 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
800 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
801 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
802 struct __ecereNameSpace__ecere__sys__OldList derivatives;
806 struct __ecereNameSpace__ecere__com__Instance * module;
807 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
808 const char * dataTypeString;
809 struct Type * dataType;
811 int defaultAlignment;
812 void (* Initialize)();
814 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
815 const char * designerClass;
816 unsigned int noExpansion;
817 const char * defaultProperty;
818 unsigned int comRedefinition;
821 unsigned int internalDecl;
823 unsigned int computeSize;
825 int destructionWatchOffset;
827 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
828 int inheritanceAccess;
829 const char * fullName;
831 struct __ecereNameSpace__ecere__sys__OldList conversions;
832 struct __ecereNameSpace__ecere__sys__OldList templateParams;
833 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
834 struct __ecereNameSpace__ecere__com__Class * templateClass;
835 struct __ecereNameSpace__ecere__sys__OldList templatized;
837 unsigned int isInstanceClass;
838 unsigned int byValueSystemClass;
839 } __attribute__ ((gcc_struct));
841 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name);
843 extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, long long value);
845 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
847 extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char * name, void * function);
849 extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
851 extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
853 extern void __ecereNameSpace__ecere__com__eInstance_Watch(void * instance, struct __ecereNameSpace__ecere__com__Property * _property, void * object, void (* callback)(void * , void * ));
855 extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
857 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
859 struct __ecereNameSpace__ecere__com__Instance
862 struct __ecereNameSpace__ecere__com__Class * _class;
864 } __attribute__ ((gcc_struct));
866 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
868 struct __ecereNameSpace__ecere__com__DataMember
870 struct __ecereNameSpace__ecere__com__DataMember * prev;
871 struct __ecereNameSpace__ecere__com__DataMember * next;
873 unsigned int isProperty;
876 struct __ecereNameSpace__ecere__com__Class * _class;
877 const char * dataTypeString;
878 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
879 struct Type * dataType;
883 struct __ecereNameSpace__ecere__sys__OldList members;
884 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
887 } __attribute__ ((gcc_struct));
889 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
891 struct __ecereNameSpace__ecere__com__SerialBuffer
893 unsigned char * _buffer;
897 } __attribute__ ((gcc_struct));
899 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
901 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
907 const char * dataTypeString;
908 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
909 } __attribute__ ((gcc_struct)) __anon1;
910 struct __ecereNameSpace__ecere__com__DataValue expression;
913 const char * memberString;
916 struct __ecereNameSpace__ecere__com__DataMember * member;
917 struct __ecereNameSpace__ecere__com__Property * prop;
918 struct __ecereNameSpace__ecere__com__Method * method;
919 } __attribute__ ((gcc_struct)) __anon1;
920 } __attribute__ ((gcc_struct)) __anon2;
921 } __attribute__ ((gcc_struct)) __anon1;
922 } __attribute__ ((gcc_struct));
926 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371, THREAD = 372
929 typedef union YYSTYPE
934 struct Identifier * id;
935 struct Expression * exp;
936 struct Specifier * specifier;
937 struct __ecereNameSpace__ecere__sys__OldList * list;
938 struct Enumerator * enumerator;
939 struct Declarator * declarator;
940 struct Pointer * pointer;
941 struct Initializer * initializer;
942 struct InitDeclarator * initDeclarator;
943 struct TypeName * typeName;
944 struct Declaration * declaration;
945 struct Statement * stmt;
946 struct FunctionDefinition * function;
947 struct External * external;
948 struct Context * context;
949 struct AsmField * asmField;
950 struct Attrib * attrib;
951 struct ExtDecl * extDecl;
952 struct Attribute * attribute;
953 struct Instantiation * instance;
954 struct MembersInit * membersInit;
955 struct MemberInit * memberInit;
956 struct ClassFunction * classFunction;
957 struct ClassDefinition * _class;
958 struct ClassDef * classDef;
959 struct PropertyDef * prop;
961 struct Symbol * symbol;
962 struct PropertyWatch * propertyWatch;
963 struct TemplateParameter * templateParameter;
964 struct TemplateArgument * templateArgument;
965 struct TemplateDatatype * templateDatatype;
966 struct DBTableEntry * dbtableEntry;
967 struct DBIndexItem * dbindexItem;
968 struct DBTableDef * dbtableDef;
969 } __attribute__ ((gcc_struct)) YYSTYPE;
971 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
975 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
977 struct InitDeclarator;
979 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
983 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
987 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
991 struct ClassFunction * prev;
992 struct ClassFunction * next;
994 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
995 struct Declarator * declarator;
996 struct __ecereNameSpace__ecere__sys__OldList * declarations;
997 struct Statement * body;
998 struct __ecereNameSpace__ecere__com__Class * _class;
999 struct __ecereNameSpace__ecere__sys__OldList attached;
1002 struct Symbol * propSet;
1003 unsigned int isVirtual;
1004 unsigned int isConstructor;
1005 unsigned int isDestructor;
1006 unsigned int dontMangle;
1009 } __attribute__ ((gcc_struct));
1011 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1015 struct MembersInit * prev;
1016 struct MembersInit * next;
1017 struct Location loc;
1021 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1022 struct ClassFunction * function;
1023 } __attribute__ ((gcc_struct)) __anon1;
1024 } __attribute__ ((gcc_struct));
1026 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1030 struct MemberInit * prev;
1031 struct MemberInit * next;
1032 struct Location loc;
1033 struct Location realLoc;
1034 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1035 struct Initializer * initializer;
1037 unsigned int variable;
1038 unsigned int takeOutExp;
1039 } __attribute__ ((gcc_struct));
1041 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1045 struct PropertyDef * prev;
1046 struct PropertyDef * next;
1047 struct Location loc;
1048 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1049 struct Declarator * declarator;
1050 struct Identifier * id;
1051 struct Statement * getStmt;
1052 struct Statement * setStmt;
1053 struct Statement * issetStmt;
1054 struct Symbol * symbol;
1055 struct Expression * category;
1058 unsigned int conversion : 1;
1059 unsigned int isWatchable : 1;
1060 unsigned int isDBProp : 1;
1061 } __attribute__ ((gcc_struct)) __anon1;
1062 } __attribute__ ((gcc_struct));
1064 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1066 struct PropertyWatch;
1068 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1072 struct ClassDef * prev;
1073 struct ClassDef * next;
1074 struct Location loc;
1078 struct Declaration * decl;
1079 struct ClassFunction * function;
1080 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1081 struct PropertyDef * propertyDef;
1082 struct PropertyWatch * propertyWatch;
1084 struct Identifier * defaultProperty;
1087 struct Identifier * id;
1088 struct Initializer * initializer;
1089 } __attribute__ ((gcc_struct)) __anon1;
1090 } __attribute__ ((gcc_struct)) __anon1;
1093 } __attribute__ ((gcc_struct));
1095 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1097 struct DBTableEntry;
1099 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1103 extern YYSTYPE yylval;
1105 extern struct Location yylloc;
1107 extern struct External * curExternal;
1109 extern char * strcat(char * , const char * );
1111 extern size_t strlen(const char * );
1113 extern int strncmp(const char * , const char * , size_t n);
1115 void FullClassNameCat(char * output, const char * className, unsigned int includeTemplateParams)
1121 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1125 strcat(output, "__ecereNameSpace__");
1129 len = strlen(output);
1131 if(!strncmp(className, "const ", 6))
1133 for(; (ch = className[c]); c++)
1136 output[len++] = '_';
1138 output[len++] = '_';
1141 output[len++] = '_';
1142 output[len++] = 'P';
1143 output[len++] = 'T';
1144 output[len++] = 'R';
1145 output[len++] = '_';
1149 output[len++] = '_';
1150 output[len++] = 'E';
1151 output[len++] = 'Q';
1152 output[len++] = 'U';
1153 output[len++] = '_';
1157 if(!includeTemplateParams)
1159 if(!strncmp(className + c + 1, "const ", 6))
1161 output[len++] = '_';
1162 output[len++] = 'T';
1163 output[len++] = 'P';
1164 output[len++] = 'L';
1165 output[len++] = '_';
1169 output[len++] = '_';
1173 if(!strncmp(className + c + 1, "const ", 6))
1175 output[len++] = '_';
1180 output[len++] = (char)0;
1183 extern int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding);
1185 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1187 if(_class->type != 1000)
1188 AddMembers(list, _class, 0, (((void *)0)), topClass, (((void *)0)));
1191 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1193 struct __ecereNameSpace__ecere__com__NameSpace
1196 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1197 struct __ecereNameSpace__ecere__com__NameSpace * left;
1198 struct __ecereNameSpace__ecere__com__NameSpace * right;
1200 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1201 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1202 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1203 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1204 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1205 } __attribute__ ((gcc_struct));
1207 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1211 else if((*ns).parent)
1212 return NameSpaceContained((*ns).parent, parent);
1217 extern void Compiler_Error(const char * format, ...);
1219 extern const char * __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char * string, const char * stringAndContext);
1221 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1223 struct __ecereNameSpace__ecere__com__Module
1225 struct __ecereNameSpace__ecere__com__Instance * application;
1226 struct __ecereNameSpace__ecere__sys__OldList classes;
1227 struct __ecereNameSpace__ecere__sys__OldList defines;
1228 struct __ecereNameSpace__ecere__sys__OldList functions;
1229 struct __ecereNameSpace__ecere__sys__OldList modules;
1230 struct __ecereNameSpace__ecere__com__Instance * prev;
1231 struct __ecereNameSpace__ecere__com__Instance * next;
1237 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1238 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1239 } __attribute__ ((gcc_struct));
1241 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1243 struct __ecereNameSpace__ecere__com__Application
1246 const char * * argv;
1248 unsigned int isGUIApp;
1249 struct __ecereNameSpace__ecere__sys__OldList allModules;
1250 char * parsedCommand;
1251 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1252 } __attribute__ ((gcc_struct));
1254 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1256 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1258 static void CheckPublicClass(struct Symbol * classSym, int access, const char * word)
1260 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->__anon1.registered : (((void *)0));
1264 if(regClass->templateClass)
1265 regClass = regClass->templateClass;
1266 if(classSym->isStatic && access != 3)
1268 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1270 else if(access == 1)
1272 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->application + structSize_Module)))->systemNameSpace))
1274 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1275 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1281 static void CheckPublicTypeName(struct TypeName * type, int access)
1283 if(type->qualifiers)
1285 struct Specifier * spec;
1287 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1291 struct Symbol * classSym = spec->__anon1.__anon1.symbol;
1293 CheckPublicClass(classSym, access, "define");
1299 static void CheckPublicExpression(struct Expression * exp, int access);
1301 static void CheckPublicInitializer(struct Initializer * init, int access)
1306 CheckPublicExpression(init->__anon1.exp, access);
1310 struct Initializer * i;
1312 for(i = (*init->__anon1.list).first; i; i = i->next)
1313 CheckPublicInitializer(i, access);
1319 static void CheckPublicExpression(struct Expression * exp, int access)
1332 if(exp->__anon1.op.exp1)
1333 CheckPublicExpression(exp->__anon1.op.exp1, access);
1334 if(exp->__anon1.op.exp2)
1335 CheckPublicExpression(exp->__anon1.op.exp2, access);
1339 struct Expression * e;
1341 for(e = (*exp->__anon1.list).first; e; e = e->next)
1342 CheckPublicExpression(e, access);
1347 struct Expression * e;
1349 CheckPublicExpression(exp->__anon1.index.exp, access);
1350 for(e = (*exp->__anon1.index.index).first; e; e = e->next)
1351 CheckPublicExpression(e, access);
1356 struct Expression * e;
1358 CheckPublicExpression(exp->__anon1.call.exp, access);
1359 if(exp->__anon1.call.arguments)
1361 for(e = (*exp->__anon1.call.arguments).first; e; e = e->next)
1362 CheckPublicExpression(e, access);
1368 CheckPublicExpression(exp->__anon1.member.exp, access);
1373 CheckPublicExpression(exp->__anon1.member.exp, access);
1377 CheckPublicTypeName(exp->__anon1.typeName, access);
1381 CheckPublicTypeName(exp->__anon1.cast.typeName, access);
1382 if(exp->__anon1.cast.exp)
1383 CheckPublicExpression(exp->__anon1.cast.exp, access);
1388 struct Expression * e;
1390 CheckPublicExpression(exp->__anon1.cond.cond, access);
1391 for(e = (*exp->__anon1.cond.exp).first; e; e = e->next)
1392 CheckPublicExpression(e, access);
1393 CheckPublicExpression(exp->__anon1.cond.elseExp, access);
1398 CheckPublicExpression(exp->__anon1._new.size, access);
1402 CheckPublicExpression(exp->__anon1._renew.size, access);
1403 CheckPublicExpression(exp->__anon1._renew.exp, access);
1407 struct MembersInit * members;
1409 CheckPublicClass(exp->__anon1.instance->_class->__anon1.__anon1.symbol, access, "define");
1410 for(members = (*exp->__anon1.instance->members).first; members; members = members->next)
1412 if(members->type == 0)
1414 struct MemberInit * member;
1416 for(member = (*members->__anon1.dataMembers).first; member; member = member->next)
1418 CheckPublicInitializer(member->initializer, access);
1428 static void CheckPublicDataType(struct Type * type, int access, const char * word)
1436 CheckPublicClass(type->__anon1._class, access, word);
1446 struct Type * param;
1448 CheckPublicDataType(type->__anon1.__anon2.returnType, access, word);
1449 for(param = type->__anon1.__anon2.params.first; param; param = param->next)
1450 CheckPublicDataType(param, access, word);
1451 CheckPublicClass(type->__anon1.__anon2.thisClass, access, word);
1455 CheckPublicDataType(type->__anon1.__anon4.arrayType, access, word);
1456 if(type->__anon1.__anon4.enumClass)
1457 CheckPublicClass(type->__anon1.__anon4.enumClass, access, word);
1461 CheckPublicDataType(type->__anon1.type, access, word);
1470 CheckPublicClass(type->__anon1._class, access, word);
1477 extern struct Identifier * GetDeclId(struct Declarator * decl);
1479 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1481 struct __ecereNameSpace__ecere__com__BTNamedLink
1484 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1485 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1486 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1489 } __attribute__ ((gcc_struct));
1491 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1493 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char * key);
1495 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1497 if(definitions != (((void *)0)))
1499 struct ClassDef * def;
1501 for(def = definitions->first; def; def = def->next)
1505 struct Declaration * decl = def->__anon1.decl;
1506 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1511 struct Declarator * d;
1513 if(decl->__anon1.__anon1.declarators)
1515 for(d = (*decl->__anon1.__anon1.declarators).first; d; d = d->next)
1517 struct Identifier * declId = GetDeclId(d);
1523 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1525 dataMember = link ? link->data : (((void *)0));
1528 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1530 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1534 else if(decl->__anon1.__anon1.specifiers)
1536 struct Specifier * spec;
1538 for(spec = (*decl->__anon1.__anon1.specifiers).first; spec; spec = spec->next)
1540 if(spec->type == 3 || spec->type == 4)
1542 if(spec->__anon1.__anon2.definitions && !spec->__anon1.__anon2.id)
1544 CheckMembersDefinitions(regClass, member, spec->__anon1.__anon2.definitions, (def->memberAccess == 2) ? 2 : access);
1546 else if(spec->__anon1.__anon2.definitions && spec->__anon1.__anon2.id)
1550 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->__anon1.__anon2.id->string);
1552 dataMember = link ? link->data : (((void *)0));
1555 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->__anon1.__anon2.id->string, privateModule, (((void *)0)), (((void *)0)));
1557 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1563 else if(decl->type == 2)
1565 CheckPublicClass(decl->__anon1.inst->_class->__anon1.__anon1.symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1572 extern unsigned int inCompiler;
1574 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1576 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, const char * name);
1578 extern struct Symbol * FindClass(const char * name);
1580 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1582 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * dataType, void * setStmt, void * getStmt, int declMode);
1584 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, unsigned int size, unsigned int alignment, int declMode);
1586 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1588 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char * name, const char * type, void * function, int declMode);
1590 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1592 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1594 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1596 extern struct Specifier * MkSpecifierName(const char * name);
1598 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1600 extern struct Identifier * MkIdentifier(const char * string);
1602 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1604 extern struct Expression * QMkExpId(const char * id);
1606 extern void FreeDeclarator(struct Declarator * decl);
1608 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
1610 extern void FreeSpecifier(struct Specifier * spec);
1612 extern char * __ecereNameSpace__ecere__sys__CopyString(const char * string);
1614 extern struct Type * MkClassType(const char * name);
1616 extern char * strcpy(char * , const char * );
1618 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1620 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1622 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1624 extern void FreeExternal(struct External * external);
1626 extern int declMode;
1628 extern int structDeclMode;
1630 extern char * strstr(const char * , const char * );
1632 extern const char * sourceFile;
1634 extern struct Specifier * MkSpecifier(int specifier);
1636 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1638 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1640 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1642 extern struct Context * PushContext(void);
1644 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1646 extern struct Expression * CopyExpression(struct Expression * exp);
1648 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1650 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1652 extern void PopContext(struct Context * ctx);
1654 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1656 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1658 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1660 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1662 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1664 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1666 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1668 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1670 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1672 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1674 extern void FreeInitializer(struct Initializer * initializer);
1676 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1678 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1680 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1682 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1684 extern void Compiler_Warning(const char * format, ...);
1686 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1688 extern int sprintf(char * , const char * , ...);
1690 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1692 extern struct Context * curContext;
1694 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1696 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1698 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1700 extern void FreeType(struct Type * type);
1702 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1704 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1706 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1708 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1710 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1712 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1714 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1716 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1718 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1720 static void ProcessClass(int classType, struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * enumValues, struct Location * loc, struct __ecereNameSpace__ecere__sys__OldList * defs, void * after, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators, struct ExtDecl * extDecl)
1722 char structName[1024];
1723 char className[1024];
1724 char constructorName[1024];
1725 char destructorName[1024];
1726 struct __ecereNameSpace__ecere__com__Class * regClass;
1727 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1728 unsigned int isUnion = classType == 6;
1729 struct External * external = (((void *)0));
1730 struct ClassDef * def;
1731 struct __ecereNameSpace__ecere__sys__OldList * list;
1732 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1737 classDataList = MkList();
1739 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1742 classType = regClass->type;
1746 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1748 if(!regClass->base->symbol)
1749 regClass->base->symbol = FindClass(regClass->base->fullName);
1750 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1752 else if(!symbol->isStatic && regClass->base)
1754 if(!regClass->base->symbol)
1755 regClass->base->symbol = FindClass(regClass->base->fullName);
1756 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1759 if(definitions != (((void *)0)))
1761 for(def = definitions->first; def; def = def->next)
1765 struct __ecereNameSpace__ecere__com__DataMember * member;
1766 struct __ecereNameSpace__ecere__com__Property * prop;
1767 struct __ecereNameSpace__ecere__com__Method * method;
1769 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->__anon1.__anon1.id->string, privateModule)))
1771 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1773 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->__anon1.__anon1.id->string, privateModule, (((void *)0)), (((void *)0)))))
1775 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->__anon1.__anon1.id->string, (((void *)0)), 0, 0, def->memberAccess);
1777 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->__anon1.__anon1.id->string, privateModule)))
1779 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->__anon1.__anon1.id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1784 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->__anon1.__anon1.id->string);
1791 external = MkExternalDeclaration((((void *)0)));
1792 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1793 curExternal = external;
1794 curExternal->symbol = symbol;
1796 if((classType == 1 || classType == 5) && inCompiler)
1798 AddSimpleBaseMembers(list, regClass->base, regClass);
1800 if(definitions != (((void *)0)))
1804 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1805 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1806 else if(!symbol->isStatic)
1807 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1809 for(def = definitions->first; def; def = def->next)
1814 struct Declaration * decl = def->__anon1.decl;
1819 if(inCompiler && classType != 2)
1821 ListAdd(list, MkClassDefDeclaration(decl));
1822 def->__anon1.decl = (((void *)0));
1825 else if(decl->type == 2)
1827 struct Instantiation * inst = decl->__anon1.inst;
1828 struct Expression * exp = inst->exp;
1829 struct Symbol * classSym;
1833 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1834 struct Declarator * d;
1836 ListAdd(specifiers, MkSpecifierName(inst->_class->__anon1.__anon1.name));
1837 d = MkDeclaratorIdentifier(MkIdentifier(exp->__anon1.__anon1.identifier->string));
1840 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1842 ListAdd(declarators, d);
1843 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1844 ListAdd(list, MkClassDefDeclaration(decl));
1846 exp->__anon1.member.member = exp->__anon1.__anon1.identifier;
1847 exp->__anon1.member.exp = QMkExpId("this");
1848 exp->__anon1.member.memberType = 3;
1849 exp->__anon1.member.thisPtr = 1;
1854 FreeList(specifiers, FreeSpecifier);
1857 classSym = inst->_class->__anon1.__anon1.symbol;
1858 if(classSym && classSym->__anon1.registered && (classSym->__anon1.registered->type == 1 || classSym->__anon1.registered->type == 2 || classSym->__anon1.registered->type == 3))
1860 if(inst->members && (*inst->members).count)
1861 symbol->needConstructor = 1;
1865 symbol->needConstructor = 1;
1866 symbol->needDestructor = 1;
1870 else if(def->type == 9)
1872 struct Declaration * decl = def->__anon1.decl;
1876 if(inCompiler && classType != 2)
1878 ListAdd(classDataList, MkClassDefDeclaration(decl));
1879 def->__anon1.decl = (((void *)0));
1883 else if(def->type == 1)
1884 symbol->needConstructor = 1;
1885 else if(def->type == 4)
1886 symbol->needConstructor = 1;
1887 else if(def->type == 0)
1889 struct ClassFunction * func = def->__anon1.function;
1891 if(func->isDestructor)
1896 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1900 symbol->needDestructor = 1;
1902 if(!inCompiler && func->body)
1904 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1906 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1910 if(func->isConstructor)
1915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1919 symbol->needConstructor = 1;
1921 if(!inCompiler && func->body)
1923 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1925 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->__anon1.compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1934 external->symbol = (((void *)0));
1937 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1939 initDeclarators = (((void *)0));
1940 strcpy(structName, symbol->string);
1941 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1943 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1945 spec->__anon1.__anon2.extDeclStruct = extDecl;
1946 ListAdd(specs, spec);
1948 external->symbol = symbol;
1949 symbol->__anon2.__anon1.structExternal = external;
1950 external->__anon1.declaration = MkDeclaration(specs, declarators);
1952 symbol->declaredStruct = 1;
1956 curExternal = external->prev;
1957 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1958 FreeExternal(external);
1959 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1961 if((*classDataList).count)
1963 char classDataStructName[1024];
1964 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1965 struct External * external;
1967 strcpy(classDataStructName, "__ecereClassData_");
1968 FullClassNameCat(classDataStructName, symbol->string, 0);
1969 declMode = structDeclMode = 0;
1970 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1971 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1972 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1974 symbol->classData = 1;
1977 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1982 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1984 strcpy(className, "__ecereClass_");
1985 FullClassNameCat(className, symbol->string, 1);
1986 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
1987 if(!strstr(sourceFile, ".main.ec"))
1988 ListAdd(specs, MkSpecifier(STATIC));
1989 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
1990 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
1991 symbol->__anon2.__anon3.methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
1992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->__anon2.__anon3.methodExternal);
1993 after = symbol->__anon2.__anon3.methodExternal;
1995 if(symbol->needDestructor)
1997 struct ClassFunction * function;
1998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1999 struct Declarator * decl;
2000 struct Statement * body;
2001 struct Context * context;
2002 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2004 strcpy(destructorName, "__ecereDestructor_");
2005 FullClassNameCat(destructorName, symbol->string, 0);
2006 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2007 ListAdd(specs, MkSpecifier(VOID));
2008 context = PushContext();
2009 statements = MkList();
2010 if(definitions != (((void *)0)))
2012 for(def = definitions->first; def; def = def->next)
2014 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2016 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2017 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2019 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2021 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2023 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2025 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 5))
2027 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2029 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2034 if(destructor && destructor->body)
2036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2037 destructor->body->__anon1.compound.context->parent = context;
2038 destructor->body = (((void *)0));
2040 body = MkCompoundStmt(declarations, statements);
2041 PopContext(context);
2042 body->__anon1.compound.context = context;
2043 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2044 decl->symbol = __extension__ ({
2045 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2047 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2050 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2051 ProcessClassFunctionBody(function, body);
2052 function->id = symbol->id;
2053 function->idCode = symbol->idCode;
2054 function->dontMangle = 1;
2055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2057 if(symbol->needConstructor && inCompiler)
2059 struct ClassFunction * function;
2060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2061 struct Declarator * decl;
2062 struct Statement * body;
2063 struct Context * context;
2064 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2066 strcpy(constructorName, "__ecereConstructor_");
2067 FullClassNameCat(constructorName, symbol->string, 0);
2068 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2069 ListAdd(specs, MkSpecifierName("bool"));
2070 context = PushContext();
2071 statements = MkList();
2072 if(definitions != (((void *)0)))
2074 for(def = definitions->first; def; def = def->next)
2076 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2078 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2079 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2081 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2083 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2086 newInst->members = (((void *)0));
2087 newInst->exp = CopyExpression(inst->exp);
2088 newInst->_class = CopySpecifier(inst->_class);
2089 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2092 if(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0))
2094 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2098 for(def = definitions->first; def; def = def->next)
2100 if(def->type == 1 && def->__anon1.defProperties)
2102 struct MemberInit * propertyDef;
2104 for(propertyDef = (*def->__anon1.defProperties).first; propertyDef; propertyDef = propertyDef->next)
2106 struct Expression * memberExp;
2107 struct Identifier * id = (*propertyDef->identifiers).first;
2111 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2112 for(id = id->next; id; id = id->next)
2113 memberExp = MkExpMember(memberExp, id);
2114 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->__anon1.exp : (((void *)0)))))));
2116 if(propertyDef->initializer)
2118 if(propertyDef->initializer->type == 0)
2119 propertyDef->initializer->__anon1.exp = (((void *)0));
2120 FreeInitializer(propertyDef->initializer);
2122 propertyDef->initializer = (((void *)0));
2123 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2127 for(def = definitions->first; def; def = def->next)
2129 if(def->type == 2 && def->__anon1.decl && def->__anon1.decl->type == 2)
2131 struct Instantiation * inst = def->__anon1.decl->__anon1.inst;
2132 struct Symbol * classSym = inst->_class->__anon1.__anon1.symbol;
2134 if(inst->exp || (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5))
2136 if(!(inst->exp && (!classSym || !classSym->__anon1.registered || classSym->__anon1.registered->type == 0 || classSym->__anon1.registered->type == 5)) || (inst->members && (*inst->members).count))
2138 def->__anon1.decl->__anon1.inst = (((void *)0));
2139 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2145 if(constructor && constructor->body)
2147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2148 constructor->body->__anon1.compound.context->parent = context;
2149 constructor->body = (((void *)0));
2151 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2152 body = MkCompoundStmt(declarations, statements);
2153 PopContext(context);
2154 body->__anon1.compound.context = context;
2155 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2156 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2157 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2158 decl->symbol->id = symbol->id;
2159 decl->symbol->idCode = symbol->idCode;
2160 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2161 ProcessClassFunctionBody(function, body);
2162 function->id = symbol->id;
2163 function->idCode = symbol->idCode;
2164 function->dontMangle = 1;
2165 if(definitions != (((void *)0)))
2166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2169 if(definitions != (((void *)0)))
2171 for(def = definitions->first; def; def = def->next)
2173 if(def->type == 3 && def->__anon1.propertyDef)
2175 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2176 struct ClassDef * after = def;
2177 struct ClassDef * newDef;
2181 yylloc = propertyDef->loc;
2182 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2183 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2184 else if(!symbol->isStatic)
2185 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2189 struct ClassFunction * func;
2190 struct Declarator * decl;
2192 struct __ecereNameSpace__ecere__sys__OldList * params;
2194 if(propertyDef->getStmt && propertyDef->id)
2196 strcpy(name, "__ecereProp_");
2197 FullClassNameCat(name, symbol->string, 0);
2198 strcat(name, "_Get_");
2199 FullClassNameCat(name, propertyDef->id->string, 1);
2201 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2203 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2204 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2205 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2209 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2210 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2212 ProcessClassFunctionBody(func, propertyDef->getStmt);
2213 func->declarator->symbol = propertyDef->symbol;
2214 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2215 func->dontMangle = 1;
2216 newDef = MkClassDefFunction(func);
2217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2220 propertyDef->getStmt = (((void *)0));
2222 func->body = (((void *)0));
2224 if(propertyDef->setStmt && propertyDef->id)
2226 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2228 strcpy(name, "__ecereProp_");
2229 FullClassNameCat(name, symbol->string, 0);
2230 strcat(name, "_Set_");
2231 FullClassNameCat(name, propertyDef->id->string, 1);
2233 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2234 if(propertyDef->__anon1.isDBProp)
2236 struct Specifier * spec;
2237 struct __ecereNameSpace__ecere__sys__OldList * specs = ((struct TypeName *)(*params).last)->qualifiers;
2239 for(spec = (*specs).first; spec; spec = spec->next)
2240 if(spec->type == 0 && spec->__anon1.specifier == CONST)
2243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specs), (((void *)0)), MkSpecifier(CONST));
2245 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2247 unsigned int isConversion = propertyDef->symbol->__anon1._property && propertyDef->symbol->__anon1._property->conversion;
2248 unsigned int useVoid = 0;
2250 switch(regClass->type)
2258 useVoid = !isConversion;
2261 useVoid = !isConversion;
2262 if(useVoid && !propertyDef->__anon1.isDBProp)
2263 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2265 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2267 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2268 ProcessClassFunctionBody(func, propertyDef->setStmt);
2269 func->dontMangle = 1;
2270 func->declarator->symbol = propertyDef->symbol;
2271 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2272 if(!propertyDef->__anon1.conversion && regClass->type == 0)
2273 func->propSet = propertyDef->symbol;
2274 newDef = MkClassDefFunction(func);
2275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2278 propertyDef->setStmt = (((void *)0));
2280 func->body = (((void *)0));
2282 if(propertyDef->issetStmt && propertyDef->id)
2284 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2286 strcpy(name, "__ecereProp_");
2287 FullClassNameCat(name, symbol->string, 0);
2288 strcat(name, "_IsSet_");
2289 FullClassNameCat(name, propertyDef->id->string, 1);
2291 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2292 ListAdd(specifiers, MkSpecifierName("bool"));
2293 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2294 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2295 func->dontMangle = 1;
2296 func->declarator->symbol = propertyDef->symbol;
2297 propertyDef->symbol->__anon2.__anon2.externalIsSet = (struct External *)func;
2298 newDef = MkClassDefFunction(func);
2299 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2302 propertyDef->issetStmt = (((void *)0));
2304 func->body = (((void *)0));
2306 if(propertyDef->id && inCompiler)
2308 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->__anon1.registered, propertyDef->id->string, privateModule);
2309 struct Declaration * decl;
2310 struct External * external;
2311 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2314 ListAdd(specifiers, MkSpecifierName("Property"));
2315 strcpy(name, "__ecereProp_");
2316 FullClassNameCat(name, symbol->string, 0);
2318 FullClassNameCat(name, propertyDef->id->string, 1);
2320 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2322 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2323 strcpy(name, "__ecerePropM_");
2324 FullClassNameCat(name, symbol->string, 0);
2326 FullClassNameCat(name, propertyDef->id->string, 1);
2327 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2328 decl = MkDeclaration(specifiers, list);
2330 external = MkExternalDeclaration(decl);
2331 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2332 external->symbol = propertyDef->symbol;
2333 propertyDef->symbol->__anon2.__anon2.externalPtr = external;
2334 if(inCompiler && prop && prop->symbol)
2335 ((struct Symbol *)prop->symbol)->__anon2.__anon2.externalPtr = external;
2340 else if(def->type == 10 && def->__anon1.propertyDef)
2342 struct PropertyDef * propertyDef = def->__anon1.propertyDef;
2343 struct ClassDef * after = def;
2344 struct ClassDef * newDef;
2349 yylloc = propertyDef->loc;
2350 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2351 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2352 else if(!symbol->isStatic)
2353 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2356 struct ClassFunction * func;
2357 struct Declarator * decl;
2359 struct __ecereNameSpace__ecere__sys__OldList * params;
2361 if(propertyDef->getStmt && propertyDef->id)
2363 struct Declarator * declId;
2365 sprintf(name, "class::__ecereClassProp_");
2366 FullClassNameCat(name, symbol->string, 0);
2367 strcat(name, "_Get_");
2368 strcat(name, propertyDef->id->string);
2370 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2372 decl = MkDeclaratorFunction(declId, params);
2373 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2375 ProcessClassFunctionBody(func, propertyDef->getStmt);
2376 func->declarator->symbol = propertyDef->symbol;
2377 propertyDef->symbol->__anon2.__anon2.externalGet = (struct External *)func;
2378 func->dontMangle = 1;
2379 newDef = MkClassDefFunction(func);
2380 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2382 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction((((void *)0)), (((void *)0))));
2383 func->type = ProcessType(propertyDef->specifiers, decl);
2384 FreeDeclarator(decl);
2385 if(func->type->__anon1.__anon2.returnType->kind == 8 && func->type->__anon1.__anon2.returnType->__anon1._class && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered && func->type->__anon1.__anon2.returnType->__anon1._class->__anon1.registered->type == 1)
2386 func->type->__anon1.__anon2.returnType->byReference = 1;
2387 func->type->__anon1.__anon2.returnType->passAsTemplate = 1;
2389 propertyDef->getStmt = (((void *)0));
2391 func->body = (((void *)0));
2393 if(propertyDef->setStmt && propertyDef->id)
2395 struct Context * prevCurContext;
2396 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2397 struct Statement * body = propertyDef->setStmt;
2398 struct Declarator * ptrDecl;
2400 strcpy(name, "class::__ecereClassProp_");
2401 FullClassNameCat(name, symbol->string, 0);
2402 strcat(name, "_Set_");
2403 strcat(name, propertyDef->id->string);
2405 prevCurContext = curContext;
2406 curContext = body->__anon1.compound.context;
2407 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2408 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2409 if(!body->__anon1.compound.declarations)
2410 body->__anon1.compound.declarations = MkList();
2411 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->__anon1._class && propertyDef->symbol->type->__anon1._class->__anon1.registered && propertyDef->symbol->type->__anon1._class->__anon1.registered->type == 1)
2412 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2414 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2415 ListAdd(body->__anon1.compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), CopyDeclarator(propertyDef->declarator)), MkExpIdentifier(MkIdentifier("_value"))))))));
2416 curContext = prevCurContext;
2418 struct Symbol * sym = ptrDecl->symbol;
2421 FreeType(sym->type);
2422 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2424 ListAdd(specifiers, MkSpecifier(VOID));
2425 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2426 ProcessClassFunctionBody(func, propertyDef->setStmt);
2427 func->dontMangle = 1;
2428 func->declarator->symbol = propertyDef->symbol;
2429 propertyDef->symbol->__anon2.__anon2.externalSet = (struct External *)func;
2430 newDef = MkClassDefFunction(func);
2431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2434 propertyDef->setStmt = (((void *)0));
2436 func->body = (((void *)0));
2441 else if(def->type == 0 && def->__anon1.function->declarator)
2443 struct ClassFunction * func = def->__anon1.function;
2445 func->_class = regClass;
2446 if(!func->dontMangle)
2448 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2449 struct Identifier * id = GetDeclId(funcDecl);
2450 struct __ecereNameSpace__ecere__com__Method * method;
2452 if(!funcDecl->__anon1.function.parameters || !(*funcDecl->__anon1.function.parameters).first)
2454 if(!funcDecl->__anon1.function.parameters)
2455 funcDecl->__anon1.function.parameters = MkList();
2456 ListAdd(funcDecl->__anon1.function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2458 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2459 FreeSpecifier(id->_class);
2460 id->_class = (((void *)0));
2461 if(inCompiler && method)
2463 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2466 ProcessMethodType(method);
2468 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2469 CheckPublicDataType(method->dataType, 1, "class method");
2470 strcpy(newId, "__ecereMethod_");
2471 FullClassNameCat(newId, symbol->string, 0);
2473 strcat(newId, id->string);
2474 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2476 if(method->type != 1)
2480 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2481 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2489 if(initDeclarators != (((void *)0)))
2490 FreeList(initDeclarators, FreeInitDeclarator);
2493 void PreProcessClassDefinitions()
2495 struct External * external, * next;
2497 curExternal = (((void *)0));
2500 for(external = (*ast).first; external; external = next)
2502 next = external->next;
2503 curExternal = external;
2504 if(external->type == 2)
2506 struct ClassDefinition * _class = external->__anon1._class;
2508 if(_class->definitions)
2510 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2513 else if(external->type == 1)
2515 struct Declaration * declaration = external->__anon1.declaration;
2517 if(declaration->type == 1)
2519 if(declaration->__anon1.__anon1.specifiers)
2521 struct Specifier * specifier;
2523 for(specifier = (*declaration->__anon1.__anon1.specifiers).first; specifier; specifier = specifier->next)
2525 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->__anon1.__anon2.id && specifier->__anon1.__anon2.id->string && (declaration->declMode || specifier->__anon1.__anon2.baseSpecs || (specifier->type == 2 && specifier->__anon1.__anon2.definitions)))
2527 struct Symbol * symbol = FindClass(specifier->__anon1.__anon2.id->string);
2531 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2532 struct ExtDecl * extDecl = specifier->__anon1.__anon2.extDeclStruct;
2534 specifier->__anon1.__anon2.extDeclStruct = (((void *)0));
2537 initDeclarators = declaration->__anon1.__anon1.declarators;
2538 declaration->__anon1.__anon1.declarators = (((void *)0));
2540 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->__anon1.__anon2.definitions, symbol, specifier->__anon1.__anon2.baseSpecs, specifier->__anon1.__anon2.list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2546 else if(inCompiler && declaration->type == 3)
2548 yylloc = declaration->loc;
2549 if(declaration->declMode == 1)
2550 CheckPublicExpression(declaration->__anon1.__anon2.exp, 1);
2551 else if(declaration->declMode != 3)
2552 CheckPublicExpression(declaration->__anon1.__anon2.exp, 2);
2555 else if(external->type == 3)
2558 else if(inCompiler && external->type == 0)
2560 yylloc = external->__anon1.function->loc;
2561 if(!external->__anon1.function->type)
2562 external->__anon1.function->type = ProcessType(external->__anon1.function->specifiers, external->__anon1.function->declarator);
2563 if(external->__anon1.function->declMode == 1)
2564 CheckPublicDataType(external->__anon1.function->type, 1, "function");
2565 else if(external->__anon1.function->declMode != 3)
2566 CheckPublicDataType(external->__anon1.function->type, 2, "function");
2572 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2574 struct __ecereNameSpace__ecere__com__GlobalFunction;
2576 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(const char * name, const char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
2578 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2580 struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
2582 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, const char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2583 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2586 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)