1 /* Code generated from eC source file: pass0.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
44 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
50 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
52 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
54 struct __ecereNameSpace__ecere__sys__BTNode;
56 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
58 struct __ecereNameSpace__ecere__sys__BinaryTree
60 struct __ecereNameSpace__ecere__sys__BTNode * root;
62 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
63 void (* FreeKey)(void * key);
64 } __attribute__ ((gcc_struct));
66 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
68 struct __ecereNameSpace__ecere__sys__OldList
75 } __attribute__ ((gcc_struct));
77 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
79 struct __ecereNameSpace__ecere__com__Method
82 struct __ecereNameSpace__ecere__com__Method * parent;
83 struct __ecereNameSpace__ecere__com__Method * left;
84 struct __ecereNameSpace__ecere__com__Method * right;
89 struct __ecereNameSpace__ecere__com__Class * _class;
91 char * dataTypeString;
92 struct Type * dataType;
94 } __attribute__ ((gcc_struct));
96 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
98 struct __ecereNameSpace__ecere__com__Property
100 struct __ecereNameSpace__ecere__com__Property * prev;
101 struct __ecereNameSpace__ecere__com__Property * next;
103 unsigned int isProperty;
106 struct __ecereNameSpace__ecere__com__Class * _class;
107 char * dataTypeString;
108 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
109 struct Type * dataType;
110 void (* Set)(void * , int);
111 int (* Get)(void * );
112 unsigned int (* IsSet)(void * );
116 unsigned int conversion;
117 unsigned int watcherOffset;
119 unsigned int compiled;
120 unsigned int selfWatchable;
121 unsigned int isWatchable;
122 } __attribute__ ((gcc_struct));
124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
132 } __attribute__ ((gcc_struct));
134 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138 struct CodePosition start;
139 struct CodePosition end;
140 } __attribute__ ((gcc_struct));
142 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
152 struct ClassDefinition
154 struct ClassDefinition * prev;
155 struct ClassDefinition * next;
157 struct Specifier * _class;
158 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
159 struct __ecereNameSpace__ecere__sys__OldList * definitions;
160 struct Symbol * symbol;
161 struct Location blockStart;
162 struct Location nameLoc;
165 unsigned int deleteWatchable;
166 } __attribute__ ((gcc_struct));
168 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
172 struct Context * parent;
173 struct __ecereNameSpace__ecere__sys__BinaryTree types;
174 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
175 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
176 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
179 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
180 struct ClassDefinition * classDef;
181 unsigned int templateTypesOnly;
182 unsigned int hasNameSpace;
183 } __attribute__ ((gcc_struct));
185 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
189 struct Instantiation * prev;
190 struct Instantiation * next;
192 struct Specifier * _class;
193 struct Expression * exp;
194 struct __ecereNameSpace__ecere__sys__OldList * members;
195 struct Symbol * symbol;
196 unsigned int fullSet;
197 unsigned int isConstant;
198 unsigned char * data;
199 struct Location nameLoc;
200 struct Location insideLoc;
202 } __attribute__ ((gcc_struct));
204 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
208 struct Declaration * prev;
209 struct Declaration * next;
216 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
217 struct __ecereNameSpace__ecere__sys__OldList * declarators;
218 } __attribute__ ((gcc_struct));
219 struct Instantiation * inst;
222 struct Identifier * id;
223 struct Expression * exp;
224 } __attribute__ ((gcc_struct));
225 } __attribute__ ((gcc_struct));
226 struct Specifier * extStorage;
227 struct Symbol * symbol;
229 } __attribute__ ((gcc_struct));
231 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
235 struct Statement * prev;
236 struct Statement * next;
241 struct __ecereNameSpace__ecere__sys__OldList * expressions;
244 struct Identifier * id;
245 struct Statement * stmt;
246 } __attribute__ ((gcc_struct)) labeled;
249 struct Expression * exp;
250 struct Statement * stmt;
251 } __attribute__ ((gcc_struct)) caseStmt;
254 struct __ecereNameSpace__ecere__sys__OldList * declarations;
255 struct __ecereNameSpace__ecere__sys__OldList * statements;
256 struct Context * context;
257 unsigned int isSwitch;
258 } __attribute__ ((gcc_struct)) compound;
261 struct __ecereNameSpace__ecere__sys__OldList * exp;
262 struct Statement * stmt;
263 struct Statement * elseStmt;
264 } __attribute__ ((gcc_struct)) ifStmt;
267 struct __ecereNameSpace__ecere__sys__OldList * exp;
268 struct Statement * stmt;
269 } __attribute__ ((gcc_struct)) switchStmt;
272 struct __ecereNameSpace__ecere__sys__OldList * exp;
273 struct Statement * stmt;
274 } __attribute__ ((gcc_struct)) whileStmt;
277 struct __ecereNameSpace__ecere__sys__OldList * exp;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) doWhile;
282 struct Statement * init;
283 struct Statement * check;
284 struct __ecereNameSpace__ecere__sys__OldList * increment;
285 struct Statement * stmt;
286 } __attribute__ ((gcc_struct)) forStmt;
289 struct Identifier * id;
290 } __attribute__ ((gcc_struct)) gotoStmt;
293 struct Specifier * spec;
295 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
296 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
297 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
298 } __attribute__ ((gcc_struct)) asmStmt;
301 struct Expression * watcher;
302 struct Expression * object;
303 struct __ecereNameSpace__ecere__sys__OldList * watches;
304 } __attribute__ ((gcc_struct)) _watch;
307 struct Identifier * id;
308 struct __ecereNameSpace__ecere__sys__OldList * exp;
309 struct __ecereNameSpace__ecere__sys__OldList * filter;
310 struct Statement * stmt;
311 } __attribute__ ((gcc_struct)) forEachStmt;
312 struct Declaration * decl;
313 } __attribute__ ((gcc_struct));
314 } __attribute__ ((gcc_struct));
316 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
320 struct TypeName * prev;
321 struct TypeName * next;
323 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
324 struct Declarator * declarator;
326 struct Expression * bitCount;
327 } __attribute__ ((gcc_struct));
329 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
333 struct Initializer * prev;
334 struct Initializer * next;
339 struct Expression * exp;
340 struct __ecereNameSpace__ecere__sys__OldList * list;
341 } __attribute__ ((gcc_struct));
342 unsigned int isConstant;
343 } __attribute__ ((gcc_struct));
345 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
347 struct __ecereNameSpace__ecere__com__DataValue
362 } __attribute__ ((gcc_struct));
363 } __attribute__ ((gcc_struct));
365 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
369 struct Expression * prev;
370 struct Expression * next;
378 struct Identifier * identifier;
379 } __attribute__ ((gcc_struct));
380 struct Statement * compound;
381 struct Instantiation * instance;
383 struct __ecereNameSpace__ecere__sys__OldList * list;
386 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
387 struct Declarator * decl;
388 } __attribute__ ((gcc_struct)) _classExp;
391 struct Identifier * id;
392 } __attribute__ ((gcc_struct)) classData;
395 struct Expression * exp;
396 struct __ecereNameSpace__ecere__sys__OldList * arguments;
397 struct Location argLoc;
398 } __attribute__ ((gcc_struct)) call;
401 struct Expression * exp;
402 struct __ecereNameSpace__ecere__sys__OldList * index;
403 } __attribute__ ((gcc_struct)) index;
406 struct Expression * exp;
407 struct Identifier * member;
409 unsigned int thisPtr;
410 } __attribute__ ((gcc_struct)) member;
414 struct Expression * exp1;
415 struct Expression * exp2;
416 } __attribute__ ((gcc_struct)) op;
417 struct TypeName * typeName;
418 struct Specifier * _class;
421 struct TypeName * typeName;
422 struct Expression * exp;
423 } __attribute__ ((gcc_struct)) cast;
426 struct Expression * cond;
427 struct __ecereNameSpace__ecere__sys__OldList * exp;
428 struct Expression * elseExp;
429 } __attribute__ ((gcc_struct)) cond;
432 struct TypeName * typeName;
433 struct Expression * size;
434 } __attribute__ ((gcc_struct)) _new;
437 struct TypeName * typeName;
438 struct Expression * size;
439 struct Expression * exp;
440 } __attribute__ ((gcc_struct)) _renew;
444 struct Identifier * id;
445 } __attribute__ ((gcc_struct)) db;
448 struct Expression * ds;
449 struct Expression * name;
450 } __attribute__ ((gcc_struct)) dbopen;
453 struct TypeName * typeName;
454 struct Initializer * initializer;
455 } __attribute__ ((gcc_struct)) initializer;
458 struct Expression * exp;
459 struct TypeName * typeName;
460 } __attribute__ ((gcc_struct)) vaArg;
461 } __attribute__ ((gcc_struct));
462 unsigned int debugValue;
463 struct __ecereNameSpace__ecere__com__DataValue val;
465 unsigned int hasAddress;
466 struct Type * expType;
467 struct Type * destType;
470 unsigned int byReference;
471 unsigned int isConstant;
472 unsigned int addedThis;
473 unsigned int needCast;
474 unsigned int thisPtr;
475 } __attribute__ ((gcc_struct));
477 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
479 struct TemplateDatatype;
481 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
483 struct TemplateArgument;
485 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
487 struct TemplateParameter;
489 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
493 struct Specifier * prev;
494 struct Specifier * next;
502 struct ExtDecl * extDecl;
504 struct Symbol * symbol;
505 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
506 } __attribute__ ((gcc_struct));
509 struct Identifier * id;
510 struct __ecereNameSpace__ecere__sys__OldList * list;
511 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
512 struct __ecereNameSpace__ecere__sys__OldList * definitions;
513 unsigned int addNameSpace;
514 struct Context * ctx;
515 struct ExtDecl * extDeclStruct;
516 } __attribute__ ((gcc_struct));
517 struct Expression * expression;
518 struct Specifier * _class;
519 struct TemplateParameter * templateParameter;
520 } __attribute__ ((gcc_struct));
521 } __attribute__ ((gcc_struct));
523 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
527 struct Identifier * prev;
528 struct Identifier * next;
530 struct Symbol * classSym;
531 struct Specifier * _class;
533 struct Identifier * badID;
534 } __attribute__ ((gcc_struct));
536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
540 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
544 struct Declarator * prev;
545 struct Declarator * next;
548 struct Symbol * symbol;
549 struct Declarator * declarator;
552 struct Identifier * identifier;
555 struct Expression * exp;
556 struct Expression * posExp;
557 struct Attrib * attrib;
558 } __attribute__ ((gcc_struct)) structDecl;
561 struct Expression * exp;
562 struct Specifier * enumClass;
563 } __attribute__ ((gcc_struct)) array;
566 struct __ecereNameSpace__ecere__sys__OldList * parameters;
567 } __attribute__ ((gcc_struct)) function;
570 struct Pointer * pointer;
571 } __attribute__ ((gcc_struct)) pointer;
574 struct ExtDecl * extended;
575 } __attribute__ ((gcc_struct)) extended;
576 } __attribute__ ((gcc_struct));
577 } __attribute__ ((gcc_struct));
579 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
581 struct FunctionDefinition
583 struct FunctionDefinition * prev;
584 struct FunctionDefinition * next;
586 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
587 struct Declarator * declarator;
588 struct __ecereNameSpace__ecere__sys__OldList * declarations;
589 struct Statement * body;
590 struct __ecereNameSpace__ecere__com__Class * _class;
591 struct __ecereNameSpace__ecere__sys__OldList attached;
594 struct Symbol * propSet;
596 unsigned int propertyNoThis;
597 } __attribute__ ((gcc_struct));
599 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
603 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
607 struct External * prev;
608 struct External * next;
611 struct Symbol * symbol;
614 struct FunctionDefinition * function;
615 struct ClassDefinition * _class;
616 struct Declaration * declaration;
618 struct Identifier * id;
619 struct DBTableDef * table;
620 } __attribute__ ((gcc_struct));
622 } __attribute__ ((gcc_struct));
624 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
637 struct Symbol * parent;
638 struct Symbol * left;
639 struct Symbol * right;
644 struct __ecereNameSpace__ecere__com__Method * method;
645 struct __ecereNameSpace__ecere__com__Property * _property;
646 struct __ecereNameSpace__ecere__com__Class * registered;
647 } __attribute__ ((gcc_struct));
654 struct External * pointerExternal;
655 struct External * structExternal;
656 } __attribute__ ((gcc_struct));
659 struct External * externalGet;
660 struct External * externalSet;
661 struct External * externalPtr;
662 struct External * externalIsSet;
663 } __attribute__ ((gcc_struct));
666 struct External * methodExternal;
667 struct External * methodCodeExternal;
668 } __attribute__ ((gcc_struct));
669 } __attribute__ ((gcc_struct));
670 unsigned int imported;
671 unsigned int declaredStructSym;
672 struct __ecereNameSpace__ecere__com__Class * _class;
673 unsigned int declaredStruct;
674 unsigned int needConstructor;
675 unsigned int needDestructor;
676 char * constructorName;
679 char * destructorName;
680 struct ModuleImport * module;
681 struct ClassImport * _import;
682 struct Location nameLoc;
683 unsigned int isParam;
684 unsigned int isRemote;
685 unsigned int isStruct;
686 unsigned int fireWatchersDone;
688 unsigned int classData;
689 unsigned int isStatic;
691 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
692 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
693 struct Context * ctx;
695 struct Expression * propCategory;
696 } __attribute__ ((gcc_struct));
698 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
707 struct Symbol * _class;
710 struct __ecereNameSpace__ecere__sys__OldList members;
712 } __attribute__ ((gcc_struct));
715 struct Type * returnType;
716 struct __ecereNameSpace__ecere__sys__OldList params;
717 struct Symbol * thisClass;
718 unsigned int staticMethod;
719 struct TemplateParameter * thisClassTemplate;
720 } __attribute__ ((gcc_struct));
723 struct __ecereNameSpace__ecere__com__Method * method;
724 struct __ecereNameSpace__ecere__com__Class * methodClass;
725 struct __ecereNameSpace__ecere__com__Class * usedClass;
726 } __attribute__ ((gcc_struct));
729 struct Type * arrayType;
731 struct Expression * arraySizeExp;
732 unsigned int freeExp;
733 struct Symbol * enumClass;
734 } __attribute__ ((gcc_struct));
736 struct TemplateParameter * templateParameter;
737 } __attribute__ ((gcc_struct));
747 unsigned int isSigned : 1;
748 unsigned int constant : 1;
749 unsigned int truth : 1;
750 unsigned int byReference : 1;
751 unsigned int extraParam : 1;
752 unsigned int directClassAccess : 1;
753 unsigned int computing : 1;
754 unsigned int keepCast : 1;
755 unsigned int passAsTemplate : 1;
756 unsigned int dllExport : 1;
757 unsigned int attrStdcall : 1;
758 unsigned int declaredWithStruct : 1;
759 unsigned int typedByReference : 1;
760 } __attribute__ ((gcc_struct));
762 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
764 struct __ecereNameSpace__ecere__com__Class
766 struct __ecereNameSpace__ecere__com__Class * prev;
767 struct __ecereNameSpace__ecere__com__Class * next;
773 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
774 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
777 struct __ecereNameSpace__ecere__com__Class * base;
778 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
779 struct __ecereNameSpace__ecere__sys__BinaryTree members;
780 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
781 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
782 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
783 struct __ecereNameSpace__ecere__sys__OldList derivatives;
787 struct __ecereNameSpace__ecere__com__Instance * module;
788 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
789 char * dataTypeString;
790 struct Type * dataType;
792 int defaultAlignment;
793 void (* Initialize)();
795 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
796 char * designerClass;
797 unsigned int noExpansion;
798 char * defaultProperty;
799 unsigned int comRedefinition;
801 unsigned int isRemote;
802 unsigned int internalDecl;
804 unsigned int computeSize;
806 int destructionWatchOffset;
808 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
809 int inheritanceAccess;
812 struct __ecereNameSpace__ecere__sys__OldList conversions;
813 struct __ecereNameSpace__ecere__sys__OldList templateParams;
814 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
815 struct __ecereNameSpace__ecere__com__Class * templateClass;
816 struct __ecereNameSpace__ecere__sys__OldList templatized;
818 unsigned int isInstanceClass;
819 unsigned int byValueSystemClass;
820 } __attribute__ ((gcc_struct));
822 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
824 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
826 struct __ecereNameSpace__ecere__com__Instance
829 struct __ecereNameSpace__ecere__com__Class * _class;
831 } __attribute__ ((gcc_struct));
833 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
835 struct __ecereNameSpace__ecere__com__DataMember
837 struct __ecereNameSpace__ecere__com__DataMember * prev;
838 struct __ecereNameSpace__ecere__com__DataMember * next;
840 unsigned int isProperty;
843 struct __ecereNameSpace__ecere__com__Class * _class;
844 char * dataTypeString;
845 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
846 struct Type * dataType;
850 struct __ecereNameSpace__ecere__sys__OldList members;
851 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
854 } __attribute__ ((gcc_struct));
856 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
858 struct __ecereNameSpace__ecere__com__SerialBuffer
860 unsigned char * _buffer;
864 } __attribute__ ((gcc_struct));
866 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
868 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
874 char * dataTypeString;
875 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
876 } __attribute__ ((gcc_struct));
877 struct __ecereNameSpace__ecere__com__DataValue expression;
883 struct __ecereNameSpace__ecere__com__DataMember * member;
884 struct __ecereNameSpace__ecere__com__Property * prop;
885 struct __ecereNameSpace__ecere__com__Method * method;
886 } __attribute__ ((gcc_struct));
887 } __attribute__ ((gcc_struct));
888 } __attribute__ ((gcc_struct));
889 } __attribute__ ((gcc_struct));
893 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
896 typedef union YYSTYPE
901 struct Identifier * id;
902 struct Expression * exp;
903 struct Specifier * specifier;
904 struct __ecereNameSpace__ecere__sys__OldList * list;
905 struct Enumerator * enumerator;
906 struct Declarator * declarator;
907 struct Pointer * pointer;
908 struct Initializer * initializer;
909 struct InitDeclarator * initDeclarator;
910 struct TypeName * typeName;
911 struct Declaration * declaration;
912 struct Statement * stmt;
913 struct FunctionDefinition * function;
914 struct External * external;
915 struct Context * context;
916 struct AsmField * asmField;
917 struct Attrib * attrib;
918 struct ExtDecl * extDecl;
919 struct Attribute * attribute;
920 struct Instantiation * instance;
921 struct MembersInit * membersInit;
922 struct MemberInit * memberInit;
923 struct ClassFunction * classFunction;
924 struct ClassDefinition * _class;
925 struct ClassDef * classDef;
926 struct PropertyDef * prop;
928 struct Symbol * symbol;
929 struct PropertyWatch * propertyWatch;
930 struct TemplateParameter * templateParameter;
931 struct TemplateArgument * templateArgument;
932 struct TemplateDatatype * templateDatatype;
933 struct DBTableEntry * dbtableEntry;
934 struct DBIndexItem * dbindexItem;
935 struct DBTableDef * dbtableDef;
936 } __attribute__ ((gcc_struct)) YYSTYPE;
938 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
942 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
944 struct InitDeclarator;
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
950 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
954 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
958 struct ClassFunction * prev;
959 struct ClassFunction * next;
961 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
962 struct Declarator * declarator;
963 struct __ecereNameSpace__ecere__sys__OldList * declarations;
964 struct Statement * body;
965 struct __ecereNameSpace__ecere__com__Class * _class;
966 struct __ecereNameSpace__ecere__sys__OldList attached;
969 struct Symbol * propSet;
970 unsigned int isVirtual;
971 unsigned int isConstructor;
972 unsigned int isDestructor;
973 unsigned int dontMangle;
976 } __attribute__ ((gcc_struct));
978 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
982 struct MembersInit * prev;
983 struct MembersInit * next;
988 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
989 struct ClassFunction * function;
990 } __attribute__ ((gcc_struct));
991 } __attribute__ ((gcc_struct));
993 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
997 struct MemberInit * prev;
998 struct MemberInit * next;
1000 struct Location realLoc;
1001 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1002 struct Initializer * initializer;
1004 unsigned int variable;
1005 unsigned int takeOutExp;
1006 } __attribute__ ((gcc_struct));
1008 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1012 struct PropertyDef * prev;
1013 struct PropertyDef * next;
1014 struct Location loc;
1015 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1016 struct Declarator * declarator;
1017 struct Identifier * id;
1018 struct Statement * getStmt;
1019 struct Statement * setStmt;
1020 struct Statement * issetStmt;
1021 struct Symbol * symbol;
1022 unsigned int conversion;
1023 unsigned int isWatchable;
1024 struct Expression * category;
1025 } __attribute__ ((gcc_struct));
1027 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1029 struct PropertyWatch;
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1035 struct ClassDef * prev;
1036 struct ClassDef * next;
1037 struct Location loc;
1041 struct Declaration * decl;
1042 struct ClassFunction * function;
1043 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1044 struct PropertyDef * propertyDef;
1045 struct PropertyWatch * propertyWatch;
1047 struct Identifier * defaultProperty;
1050 struct Identifier * id;
1051 struct Initializer * initializer;
1052 } __attribute__ ((gcc_struct));
1053 } __attribute__ ((gcc_struct));
1056 } __attribute__ ((gcc_struct));
1058 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1060 struct DBTableEntry;
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1066 extern YYSTYPE yylval;
1068 extern struct Location yylloc;
1070 extern struct External * curExternal;
1072 void MangleClassName(char * className)
1078 for(c = 0; (ch = className[c]); c++)
1117 output[d] = (char)0;
1120 extern char * strcat(char * , const char * );
1122 extern size_t strlen(const char * );
1124 void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams)
1130 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1134 strcat(output, "__ecereNameSpace__");
1138 len = strlen(output);
1139 for(c = 0; (ch = className[c]); c++)
1142 output[len++] = '_';
1144 output[len++] = '_';
1147 output[len++] = '_';
1148 output[len++] = 'P';
1149 output[len++] = 'T';
1150 output[len++] = 'R';
1151 output[len++] = '_';
1155 output[len++] = '_';
1156 output[len++] = 'E';
1157 output[len++] = 'Q';
1158 output[len++] = 'U';
1159 output[len++] = '_';
1163 if(!includeTemplateParams)
1165 output[len++] = '_';
1166 output[len++] = 'T';
1167 output[len++] = 'P';
1168 output[len++] = 'L';
1169 output[len++] = '_';
1173 output[len++] = '_';
1177 output[len++] = '__';
1182 output[len++] = (char)0;
1185 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);
1187 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1189 if(_class->type != 1000)
1190 AddMembers(list, _class, 0x0, (((void *)0)), topClass, (((void *)0)));
1193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1195 struct __ecereNameSpace__ecere__com__NameSpace
1198 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1199 struct __ecereNameSpace__ecere__com__NameSpace * left;
1200 struct __ecereNameSpace__ecere__com__NameSpace * right;
1202 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1203 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1204 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1205 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1206 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1207 } __attribute__ ((gcc_struct));
1209 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1213 else if((*ns).parent)
1214 return NameSpaceContained((*ns).parent, parent);
1219 extern void Compiler_Error(char * format, ...);
1221 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
1223 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1225 struct __ecereNameSpace__ecere__com__Module
1227 struct __ecereNameSpace__ecere__com__Instance * application;
1228 struct __ecereNameSpace__ecere__sys__OldList classes;
1229 struct __ecereNameSpace__ecere__sys__OldList defines;
1230 struct __ecereNameSpace__ecere__sys__OldList functions;
1231 struct __ecereNameSpace__ecere__sys__OldList modules;
1232 struct __ecereNameSpace__ecere__com__Instance * prev;
1233 struct __ecereNameSpace__ecere__com__Instance * next;
1239 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1240 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1241 } __attribute__ ((gcc_struct));
1243 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1245 struct __ecereNameSpace__ecere__com__Application
1250 unsigned int isGUIApp;
1251 struct __ecereNameSpace__ecere__sys__OldList allModules;
1252 char * parsedCommand;
1253 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1254 } __attribute__ ((gcc_struct));
1256 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1258 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1260 static void CheckPublicClass(struct Symbol * classSym, int access, char * word)
1262 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->registered : (((void *)0));
1266 if(regClass->templateClass)
1267 regClass = regClass->templateClass;
1268 if(classSym->isStatic && access != 3)
1270 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1272 else if(access == 1)
1274 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->application + structSize_Module)))->systemNameSpace))
1276 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1277 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1283 static void CheckPublicTypeName(struct TypeName * type, int access)
1285 if(type->qualifiers)
1287 struct Specifier * spec;
1289 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1293 struct Symbol * classSym = spec->symbol;
1295 CheckPublicClass(classSym, access, "define");
1301 static void CheckPublicExpression(struct Expression * exp, int access);
1303 static void CheckPublicInitializer(struct Initializer * init, int access)
1308 CheckPublicExpression(init->exp, access);
1312 struct Initializer * i;
1314 for(i = (*init->list).first; i; i = i->next)
1315 CheckPublicInitializer(i, access);
1321 static void CheckPublicExpression(struct Expression * exp, int access)
1335 CheckPublicExpression(exp->op.exp1, access);
1337 CheckPublicExpression(exp->op.exp2, access);
1341 struct Expression * e;
1343 for(e = (*exp->list).first; e; e = e->next)
1344 CheckPublicExpression(e, access);
1349 struct Expression * e;
1351 CheckPublicExpression(exp->index.exp, access);
1352 for(e = (*exp->index.index).first; e; e = e->next)
1353 CheckPublicExpression(e, access);
1358 struct Expression * e;
1360 CheckPublicExpression(exp->call.exp, access);
1361 if(exp->call.arguments)
1363 for(e = (*exp->call.arguments).first; e; e = e->next)
1364 CheckPublicExpression(e, access);
1370 CheckPublicExpression(exp->member.exp, access);
1375 CheckPublicExpression(exp->member.exp, access);
1379 CheckPublicTypeName(exp->typeName, access);
1383 struct Type * type = exp->expType;
1385 CheckPublicTypeName(exp->cast.typeName, access);
1387 CheckPublicExpression(exp->cast.exp, access);
1392 struct Expression * e;
1394 CheckPublicExpression(exp->cond.cond, access);
1395 for(e = (*exp->cond.exp).first; e; e = e->next)
1396 CheckPublicExpression(e, access);
1397 CheckPublicExpression(exp->cond.elseExp, access);
1402 CheckPublicExpression(exp->_new.size, access);
1406 CheckPublicExpression(exp->_renew.size, access);
1407 CheckPublicExpression(exp->_renew.exp, access);
1411 struct MembersInit * members;
1413 CheckPublicClass(exp->instance->_class->symbol, access, "define");
1414 for(members = (*exp->instance->members).first; members; members = members->next)
1416 if(members->type == 0)
1418 struct MemberInit * member;
1420 for(member = (*members->dataMembers).first; member; member = member->next)
1422 CheckPublicInitializer(member->initializer, access);
1432 static void CheckPublicDataType(struct Type * type, int access, char * word)
1440 CheckPublicClass(type->_class, access, word);
1450 struct Type * param;
1452 CheckPublicDataType(type->returnType, access, word);
1453 for(param = type->params.first; param; param = param->next)
1454 CheckPublicDataType(param, access, word);
1455 CheckPublicClass(type->thisClass, access, word);
1459 CheckPublicDataType(type->arrayType, access, word);
1461 CheckPublicClass(type->enumClass, access, word);
1465 CheckPublicDataType(type->type, access, word);
1474 CheckPublicClass(type->_class, access, word);
1481 extern struct Identifier * GetDeclId(struct Declarator * decl);
1483 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1485 struct __ecereNameSpace__ecere__com__BTNamedLink
1488 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1489 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1490 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1493 } __attribute__ ((gcc_struct));
1495 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
1497 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1499 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1501 if(definitions != (((void *)0)))
1503 struct ClassDef * def;
1505 for(def = definitions->first; def; def = def->next)
1509 struct Declaration * decl = def->decl;
1510 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1515 struct Declarator * d;
1517 if(decl->declarators)
1519 for(d = (*decl->declarators).first; d; d = d->next)
1521 struct Identifier * declId = GetDeclId(d);
1527 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1529 dataMember = link ? link->data : (((void *)0));
1532 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1534 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1538 else if(decl->specifiers)
1540 struct Specifier * spec;
1542 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
1544 if(spec->type == 3 || spec->type == 4)
1546 if(spec->definitions && !spec->id)
1548 CheckMembersDefinitions(regClass, member, spec->definitions, (def->memberAccess == 2) ? 2 : access);
1550 else if(spec->definitions && spec->id)
1554 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->id->string);
1556 dataMember = link ? link->data : (((void *)0));
1559 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->id->string, privateModule, (((void *)0)), (((void *)0)));
1561 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1567 else if(decl->type == 2)
1569 CheckPublicClass(decl->inst->_class->symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1576 extern unsigned int inCompiler;
1578 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1580 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
1582 extern struct Symbol * FindClass(char * name);
1584 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1586 extern struct __ecereNameSpace__ecere__com__Property * __ecereNameSpace__ecere__com__eClass_AddProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * dataType, void * setStmt, void * getStmt, int declMode);
1588 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, unsigned int size, unsigned int alignment, int declMode);
1590 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_FindMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module);
1592 extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, char * name, char * type, void * function, int declMode);
1594 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1596 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1598 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1600 extern struct Specifier * MkSpecifierName(char * name);
1602 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1604 extern struct Identifier * MkIdentifier(char * string);
1606 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1608 extern struct Expression * QMkExpId(char * id);
1610 extern void FreeDeclarator(struct Declarator * decl);
1612 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
1614 extern void FreeSpecifier(struct Specifier * spec);
1616 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1618 extern struct Type * MkClassType(char * name);
1620 extern char * strcpy(char * , const char * );
1622 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1624 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1626 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1628 extern void FreeExternal(struct External * external);
1630 extern int declMode;
1632 extern int structDeclMode;
1634 extern char * strstr(const char * , const char * );
1636 extern char * sourceFile;
1638 extern struct Specifier * MkSpecifier(int specifier);
1640 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1642 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1644 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1646 extern struct Context * PushContext(void);
1648 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1650 extern struct Expression * CopyExpression(struct Expression * exp);
1652 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1654 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1656 extern void PopContext(struct Context * ctx);
1658 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1660 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1662 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1664 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1666 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1668 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1670 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1672 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1674 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1676 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1678 extern void FreeInitializer(struct Initializer * initializer);
1680 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1682 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1684 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1686 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1688 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1690 extern int sprintf(char * , char * , ...);
1692 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1694 extern struct Context * curContext;
1696 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1698 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1700 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1702 extern void FreeType(struct Type * type);
1704 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1706 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1708 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1710 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1712 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1714 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1716 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1718 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1720 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1722 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)
1724 char structName[1024];
1725 char className[1024];
1726 char constructorName[1024];
1727 char destructorName[1024];
1728 struct __ecereNameSpace__ecere__com__Class * regClass;
1729 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1730 unsigned int redefinition = 0x0;
1731 unsigned int isUnion = classType == 6;
1732 struct External * external = (((void *)0));
1733 struct ClassDef * def;
1734 struct __ecereNameSpace__ecere__sys__OldList * list;
1735 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1740 classDataList = MkList();
1742 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1745 classType = regClass->type;
1749 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1751 if(!regClass->base->symbol)
1752 regClass->base->symbol = FindClass(regClass->base->fullName);
1753 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1755 else if(!symbol->isStatic && regClass->base)
1757 if(!regClass->base->symbol)
1758 regClass->base->symbol = FindClass(regClass->base->fullName);
1759 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1762 if(definitions != (((void *)0)))
1764 for(def = definitions->first; def; def = def->next)
1768 struct __ecereNameSpace__ecere__com__DataMember * member;
1769 struct __ecereNameSpace__ecere__com__Property * prop;
1770 struct __ecereNameSpace__ecere__com__Method * method;
1772 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->id->string, privateModule)))
1774 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1776 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->id->string, privateModule, (((void *)0)), (((void *)0)))))
1778 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->id->string, (((void *)0)), 0, 0, def->memberAccess);
1780 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->id->string, privateModule)))
1782 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1787 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->id->string);
1794 external = MkExternalDeclaration((((void *)0)));
1795 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1796 curExternal = external;
1797 curExternal->symbol = symbol;
1799 if((classType == 1 || classType == 5) && inCompiler)
1801 AddSimpleBaseMembers(list, regClass->base, regClass);
1803 if(definitions != (((void *)0)))
1807 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1808 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1809 else if(!symbol->isStatic)
1810 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1812 for(def = definitions->first; def; def = def->next)
1816 struct Declaration * decl = def->decl;
1820 if(inCompiler && classType != 2)
1822 ListAdd(list, MkClassDefDeclaration(decl));
1823 def->decl = (((void *)0));
1826 else if(decl->type == 2)
1828 struct Instantiation * inst = decl->inst;
1829 struct Expression * exp = inst->exp;
1830 struct Symbol * classSym;
1834 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1835 struct Declarator * d;
1837 ListAdd(specifiers, MkSpecifierName(inst->_class->name));
1838 d = MkDeclaratorIdentifier(MkIdentifier(exp->identifier->string));
1841 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1843 ListAdd(declarators, d);
1844 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1845 ListAdd(list, MkClassDefDeclaration(decl));
1847 exp->member.member = exp->identifier;
1848 exp->member.exp = QMkExpId("this");
1849 exp->member.memberType = 3;
1850 exp->member.thisPtr = 0x1;
1855 FreeList(specifiers, FreeSpecifier);
1858 classSym = inst->_class->symbol;
1859 if(classSym && classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 2 || classSym->registered->type == 3))
1861 if(inst->members && (*inst->members).count)
1862 symbol->needConstructor = 0x1;
1866 symbol->needConstructor = 0x1;
1867 symbol->needDestructor = 0x1;
1871 else if(def->type == 9)
1873 struct Declaration * decl = def->decl;
1877 if(inCompiler && classType != 2)
1879 ListAdd(classDataList, MkClassDefDeclaration(decl));
1880 def->decl = (((void *)0));
1884 else if(def->type == 1)
1885 symbol->needConstructor = 0x1;
1886 else if(def->type == 4)
1887 symbol->needConstructor = 0x1;
1888 else if(def->type == 0)
1890 struct ClassFunction * func = def->function;
1892 if(func->isDestructor)
1897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1901 symbol->needDestructor = 0x1;
1903 if(!inCompiler && func->body)
1905 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1907 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1911 if(func->isConstructor)
1916 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1920 symbol->needConstructor = 0x1;
1922 if(!inCompiler && func->body)
1924 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1926 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1935 external->symbol = (((void *)0));
1938 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1940 initDeclarators = (((void *)0));
1941 strcpy(structName, symbol->string);
1942 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1944 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1946 spec->extDeclStruct = extDecl;
1947 ListAdd(specs, spec);
1949 external->symbol = symbol;
1950 symbol->structExternal = external;
1951 external->declaration = MkDeclaration(specs, declarators);
1953 symbol->declaredStruct = 0x1;
1957 curExternal = external->prev;
1958 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1959 FreeExternal(external);
1960 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1962 if((*classDataList).count)
1964 char classDataStructName[1024];
1965 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1966 struct External * external;
1968 strcpy(classDataStructName, "__ecereClassData_");
1969 FullClassNameCat(classDataStructName, symbol->string, 0x0);
1970 declMode = structDeclMode = 0;
1971 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1972 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1973 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1975 symbol->classData = 0x1;
1978 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1983 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1985 strcpy(className, "__ecereClass_");
1986 FullClassNameCat(className, symbol->string, 0x1);
1987 MangleClassName(className);
1988 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
1989 if(!strstr(sourceFile, ".main.ec"))
1990 ListAdd(specs, MkSpecifier(STATIC));
1991 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
1992 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
1993 symbol->methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
1994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->methodExternal);
1995 after = symbol->methodExternal;
1997 if(symbol->needDestructor)
1999 struct ClassFunction * function;
2000 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2001 struct Declarator * decl;
2002 struct Statement * body;
2003 struct Context * context;
2004 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2006 strcpy(destructorName, "__ecereDestructor_");
2007 FullClassNameCat(destructorName, symbol->string, 0x0);
2008 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2009 ListAdd(specs, MkSpecifier(VOID));
2010 context = PushContext();
2011 statements = MkList();
2012 if(definitions != (((void *)0)))
2014 for(def = definitions->first; def; def = def->next)
2016 if(def->type == 2 && def->decl && def->decl->type == 2)
2018 struct Instantiation * inst = def->decl->inst;
2019 struct Symbol * classSym = inst->_class->symbol;
2021 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2023 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2025 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2027 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 5))
2029 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2031 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2036 if(destructor && destructor->body)
2038 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2039 destructor->body->compound.context->parent = context;
2040 destructor->body = (((void *)0));
2042 body = MkCompoundStmt(declarations, statements);
2043 PopContext(context);
2044 body->compound.context = context;
2045 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2046 decl->symbol = __extension__ ({
2047 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2049 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2051 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2052 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2053 ProcessClassFunctionBody(function, body);
2054 function->id = symbol->id;
2055 function->idCode = symbol->idCode;
2056 function->dontMangle = 0x1;
2057 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2059 if(symbol->needConstructor && inCompiler)
2061 struct ClassFunction * function;
2062 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2063 struct Declarator * decl;
2064 struct Statement * body;
2065 struct Context * context;
2066 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2068 strcpy(constructorName, "__ecereConstructor_");
2069 FullClassNameCat(constructorName, symbol->string, 0x0);
2070 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2071 ListAdd(specs, MkSpecifierName("bool"));
2072 context = PushContext();
2073 statements = MkList();
2074 if(definitions != (((void *)0)))
2076 for(def = definitions->first; def; def = def->next)
2078 if(def->type == 2 && def->decl && def->decl->type == 2)
2080 struct Instantiation * inst = def->decl->inst;
2081 struct Symbol * classSym = inst->_class->symbol;
2083 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2085 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2088 newInst->members = (((void *)0));
2089 newInst->exp = CopyExpression(inst->exp);
2090 newInst->_class = CopySpecifier(inst->_class);
2091 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2094 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2096 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2100 for(def = definitions->first; def; def = def->next)
2102 if(def->type == 1 && def->defProperties)
2104 struct MemberInit * propertyDef;
2106 for(propertyDef = (*def->defProperties).first; propertyDef; propertyDef = propertyDef->next)
2108 struct Expression * memberExp;
2109 struct Identifier * id = (*propertyDef->identifiers).first;
2113 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2114 for(id = id->next; id; id = id->next)
2115 memberExp = MkExpMember(memberExp, id);
2116 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->exp : (((void *)0)))))));
2118 if(propertyDef->initializer)
2120 if(propertyDef->initializer->type == 0)
2121 propertyDef->initializer->exp = (((void *)0));
2122 FreeInitializer(propertyDef->initializer);
2124 propertyDef->initializer = (((void *)0));
2125 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2129 for(def = definitions->first; def; def = def->next)
2131 if(def->type == 2 && def->decl && def->decl->type == 2)
2133 struct Instantiation * inst = def->decl->inst;
2134 struct Symbol * classSym = inst->_class->symbol;
2136 if(inst->exp || (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2138 if(!(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5)) || (inst->members && (*inst->members).count))
2140 def->decl->inst = (((void *)0));
2141 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2147 if(constructor && constructor->body)
2149 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2150 constructor->body->compound.context->parent = context;
2151 constructor->body = (((void *)0));
2153 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2154 body = MkCompoundStmt(declarations, statements);
2155 PopContext(context);
2156 body->compound.context = context;
2157 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2158 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2160 decl->symbol->id = symbol->id;
2161 decl->symbol->idCode = symbol->idCode;
2162 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2163 ProcessClassFunctionBody(function, body);
2164 function->id = symbol->id;
2165 function->idCode = symbol->idCode;
2166 function->dontMangle = 0x1;
2167 if(definitions != (((void *)0)))
2168 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2171 if(definitions != (((void *)0)))
2173 for(def = definitions->first; def; def = def->next)
2175 if(def->type == 3 && def->propertyDef)
2177 struct PropertyDef * propertyDef = def->propertyDef;
2178 struct ClassDef * after = def;
2179 struct ClassDef * newDef;
2183 yylloc = propertyDef->loc;
2184 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2185 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2186 else if(!symbol->isStatic)
2187 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2191 struct ClassFunction * func;
2192 struct Declarator * decl;
2194 struct __ecereNameSpace__ecere__sys__OldList * params;
2196 if(propertyDef->getStmt && propertyDef->id)
2198 strcpy(name, "__ecereProp_");
2199 FullClassNameCat(name, symbol->string, 0x0);
2200 strcat(name, "_Get_");
2201 FullClassNameCat(name, propertyDef->id->string, 0x1);
2202 MangleClassName(name);
2204 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->_class && propertyDef->symbol->type->_class->registered && propertyDef->symbol->type->_class->registered->type == 1)
2206 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2207 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2208 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2212 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2213 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2215 ProcessClassFunctionBody(func, propertyDef->getStmt);
2216 func->declarator->symbol = propertyDef->symbol;
2217 propertyDef->symbol->externalGet = (struct External *)func;
2218 func->dontMangle = 0x1;
2219 newDef = MkClassDefFunction(func);
2220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2223 propertyDef->getStmt = (((void *)0));
2225 func->body = (((void *)0));
2227 if(propertyDef->setStmt && propertyDef->id)
2229 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2231 strcpy(name, "__ecereProp_");
2232 FullClassNameCat(name, symbol->string, 0x0);
2233 strcat(name, "_Set_");
2234 FullClassNameCat(name, propertyDef->id->string, 0x1);
2235 MangleClassName(name);
2237 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2238 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2239 if(!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion)
2240 ListAdd(specifiers, MkSpecifier(VOID));
2243 if(regClass->type == 1)
2244 ListAdd(specifiers, MkSpecifier(VOID));
2246 ListAdd(specifiers, MkSpecifierName(regClass->fullName));
2248 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2249 ProcessClassFunctionBody(func, propertyDef->setStmt);
2250 func->dontMangle = 0x1;
2251 func->declarator->symbol = propertyDef->symbol;
2252 propertyDef->symbol->externalSet = (struct External *)func;
2253 if(!propertyDef->conversion && regClass->type == 0)
2254 func->propSet = propertyDef->symbol;
2255 newDef = MkClassDefFunction(func);
2256 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2259 propertyDef->setStmt = (((void *)0));
2261 func->body = (((void *)0));
2263 if(propertyDef->issetStmt && propertyDef->id)
2265 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2267 strcpy(name, "__ecereProp_");
2268 FullClassNameCat(name, symbol->string, 0x0);
2269 strcat(name, "_IsSet_");
2270 FullClassNameCat(name, propertyDef->id->string, 0x1);
2271 MangleClassName(name);
2273 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2274 ListAdd(specifiers, MkSpecifierName("bool"));
2275 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2276 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2277 func->dontMangle = 0x1;
2278 func->declarator->symbol = propertyDef->symbol;
2279 propertyDef->symbol->externalIsSet = (struct External *)func;
2280 newDef = MkClassDefFunction(func);
2281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2284 propertyDef->issetStmt = (((void *)0));
2286 func->body = (((void *)0));
2288 if(propertyDef->id && inCompiler)
2290 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->registered, propertyDef->id->string, privateModule);
2291 struct Declaration * decl;
2292 struct External * external;
2293 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2296 ListAdd(specifiers, MkSpecifierName("Property"));
2297 strcpy(name, "__ecereProp_");
2298 FullClassNameCat(name, symbol->string, 0x0);
2300 FullClassNameCat(name, propertyDef->id->string, 0x1);
2301 MangleClassName(name);
2303 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2305 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2306 strcpy(name, "__ecerePropM_");
2307 FullClassNameCat(name, symbol->string, 0x0);
2309 FullClassNameCat(name, propertyDef->id->string, 0x1);
2310 MangleClassName(name);
2311 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2312 decl = MkDeclaration(specifiers, list);
2314 external = MkExternalDeclaration(decl);
2315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2316 external->symbol = propertyDef->symbol;
2317 propertyDef->symbol->externalPtr = external;
2318 if(inCompiler && prop && prop->symbol)
2319 ((struct Symbol *)prop->symbol)->externalPtr = external;
2324 else if(def->type == 10 && def->propertyDef)
2326 struct PropertyDef * propertyDef = def->propertyDef;
2327 struct ClassDef * after = def;
2328 struct ClassDef * newDef;
2333 yylloc = propertyDef->loc;
2334 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2335 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2336 else if(!symbol->isStatic)
2337 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2340 struct ClassFunction * func;
2341 struct Declarator * decl;
2343 struct __ecereNameSpace__ecere__sys__OldList * params;
2345 if(propertyDef->getStmt && propertyDef->id)
2347 struct Declarator * declId;
2349 sprintf(name, "class::__ecereClassProp_");
2350 FullClassNameCat(name, symbol->string, 0x0);
2351 strcat(name, "_Get_");
2352 strcat(name, propertyDef->id->string);
2353 MangleClassName(name);
2355 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2357 decl = MkDeclaratorFunction(declId, params);
2358 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2360 ProcessClassFunctionBody(func, propertyDef->getStmt);
2361 func->declarator->symbol = propertyDef->symbol;
2362 propertyDef->symbol->externalGet = (struct External *)func;
2363 func->dontMangle = 0x1;
2364 newDef = MkClassDefFunction(func);
2365 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2367 func->type = ProcessType(propertyDef->specifiers, MkDeclaratorFunction(propertyDef->declarator, (((void *)0))));
2368 if(func->type->returnType->kind == 8 && func->type->returnType->_class && func->type->returnType->_class->registered && func->type->returnType->_class->registered->type == 1)
2369 func->type->returnType->byReference = 0x1;
2371 propertyDef->getStmt = (((void *)0));
2373 func->body = (((void *)0));
2375 if(propertyDef->setStmt && propertyDef->id)
2377 struct Context * prevCurContext;
2378 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2379 struct Statement * body = propertyDef->setStmt;
2380 struct Declarator * ptrDecl;
2382 strcpy(name, "class::__ecereClassProp_");
2383 FullClassNameCat(name, symbol->string, 0x0);
2384 strcat(name, "_Set_");
2385 strcat(name, propertyDef->id->string);
2386 MangleClassName(name);
2388 prevCurContext = curContext;
2389 curContext = body->compound.context;
2390 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2391 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2392 if(!body->compound.declarations)
2393 body->compound.declarations = MkList();
2394 if(propertyDef->symbol->type && propertyDef->symbol->type->kind == 8 && propertyDef->symbol->type->_class && propertyDef->symbol->type->_class->registered && propertyDef->symbol->type->_class->registered->type == 1)
2395 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2397 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2398 ListAdd(body->compound.declarations, MkDeclaration(CopyList(propertyDef->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(ptrDecl, MkInitializerAssignment(MkExpCast(MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), CopyDeclarator(propertyDef->declarator)), MkExpIdentifier(MkIdentifier("_value"))))))));
2399 curContext = prevCurContext;
2401 struct Symbol * sym = ptrDecl->symbol;
2404 FreeType(sym->type);
2405 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2407 ListAdd(specifiers, MkSpecifier(VOID));
2408 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2409 ProcessClassFunctionBody(func, propertyDef->setStmt);
2410 func->dontMangle = 0x1;
2411 func->declarator->symbol = propertyDef->symbol;
2412 propertyDef->symbol->externalSet = (struct External *)func;
2413 newDef = MkClassDefFunction(func);
2414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2417 propertyDef->setStmt = (((void *)0));
2419 func->body = (((void *)0));
2424 else if(def->type == 0 && def->function->declarator)
2426 struct ClassFunction * func = def->function;
2428 func->_class = regClass;
2429 if(!func->dontMangle)
2431 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2432 struct Identifier * id = GetDeclId(funcDecl);
2433 struct __ecereNameSpace__ecere__com__Method * method;
2435 if(!funcDecl->function.parameters || !(*funcDecl->function.parameters).first)
2437 if(!funcDecl->function.parameters)
2438 funcDecl->function.parameters = MkList();
2439 ListAdd(funcDecl->function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2441 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2442 FreeSpecifier(id->_class);
2443 id->_class = (((void *)0));
2444 if(inCompiler && method)
2446 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2449 ProcessMethodType(method);
2451 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2452 CheckPublicDataType(method->dataType, 1, "class method");
2453 strcpy(newId, "__ecereMethod_");
2454 FullClassNameCat(newId, symbol->string, 0x0);
2456 strcat(newId, id->string);
2457 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2459 if(method->type != 1)
2463 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2464 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2472 if(initDeclarators != (((void *)0)))
2473 FreeList(initDeclarators, FreeInitDeclarator);
2476 void PreProcessClassDefinitions()
2478 struct External * external, * next;
2480 curExternal = (((void *)0));
2483 for(external = (*ast).first; external; external = next)
2485 next = external->next;
2486 curExternal = external;
2487 if(external->type == 2)
2489 struct ClassDefinition * _class = external->_class;
2491 if(_class->definitions)
2493 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2496 else if(external->type == 1)
2498 struct Declaration * declaration = external->declaration;
2500 if(declaration->type == 1)
2502 if(declaration->specifiers)
2504 struct Specifier * specifier;
2506 for(specifier = (*declaration->specifiers).first; specifier; specifier = specifier->next)
2508 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->id && specifier->id->string && (declaration->declMode || specifier->baseSpecs || (specifier->type == 2 && specifier->definitions)))
2510 struct Symbol * symbol = FindClass(specifier->id->string);
2514 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2515 struct ExtDecl * extDecl = specifier->extDeclStruct;
2517 specifier->extDeclStruct = (((void *)0));
2520 initDeclarators = declaration->declarators;
2521 declaration->declarators = (((void *)0));
2523 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->definitions, symbol, specifier->baseSpecs, specifier->list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2529 else if(inCompiler && declaration->type == 3)
2531 yylloc = declaration->loc;
2532 if(declaration->declMode == 1)
2533 CheckPublicExpression(declaration->exp, 1);
2534 else if(declaration->declMode != 3)
2535 CheckPublicExpression(declaration->exp, 2);
2538 else if(external->type == 3)
2541 else if(inCompiler && external->type == 0)
2543 yylloc = external->function->loc;
2544 if(!external->function->type)
2545 external->function->type = ProcessType(external->function->specifiers, external->function->declarator);
2546 if(external->function->declMode == 1)
2547 CheckPublicDataType(external->function->type, 1, "function");
2548 else if(external->function->declMode != 3)
2549 CheckPublicDataType(external->function->type, 2, "function");
2555 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2557 struct __ecereNameSpace__ecere__com__GlobalFunction;
2559 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_RegisterFunction(char * name, char * type, void * func, struct __ecereNameSpace__ecere__com__Instance * module, int declMode);
2561 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2563 struct __ecereNameSpace__ecere__com__Class * class;
2565 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MangleClassName", "void MangleClassName(char * className)", MangleClassName, module, 1);
2566 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2567 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2570 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)