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;
385 unsigned int intlString;
386 } __attribute__ ((gcc_struct));
387 struct __ecereNameSpace__ecere__sys__OldList * list;
390 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
391 struct Declarator * decl;
392 } __attribute__ ((gcc_struct)) _classExp;
395 struct Identifier * id;
396 } __attribute__ ((gcc_struct)) classData;
399 struct Expression * exp;
400 struct __ecereNameSpace__ecere__sys__OldList * arguments;
401 struct Location argLoc;
402 } __attribute__ ((gcc_struct)) call;
405 struct Expression * exp;
406 struct __ecereNameSpace__ecere__sys__OldList * index;
407 } __attribute__ ((gcc_struct)) index;
410 struct Expression * exp;
411 struct Identifier * member;
413 unsigned int thisPtr;
414 } __attribute__ ((gcc_struct)) member;
418 struct Expression * exp1;
419 struct Expression * exp2;
420 } __attribute__ ((gcc_struct)) op;
421 struct TypeName * typeName;
422 struct Specifier * _class;
425 struct TypeName * typeName;
426 struct Expression * exp;
427 } __attribute__ ((gcc_struct)) cast;
430 struct Expression * cond;
431 struct __ecereNameSpace__ecere__sys__OldList * exp;
432 struct Expression * elseExp;
433 } __attribute__ ((gcc_struct)) cond;
436 struct TypeName * typeName;
437 struct Expression * size;
438 } __attribute__ ((gcc_struct)) _new;
441 struct TypeName * typeName;
442 struct Expression * size;
443 struct Expression * exp;
444 } __attribute__ ((gcc_struct)) _renew;
448 struct Identifier * id;
449 } __attribute__ ((gcc_struct)) db;
452 struct Expression * ds;
453 struct Expression * name;
454 } __attribute__ ((gcc_struct)) dbopen;
457 struct TypeName * typeName;
458 struct Initializer * initializer;
459 } __attribute__ ((gcc_struct)) initializer;
462 struct Expression * exp;
463 struct TypeName * typeName;
464 } __attribute__ ((gcc_struct)) vaArg;
465 } __attribute__ ((gcc_struct));
466 unsigned int debugValue;
467 struct __ecereNameSpace__ecere__com__DataValue val;
469 unsigned int hasAddress;
470 struct Type * expType;
471 struct Type * destType;
474 unsigned int byReference;
475 unsigned int isConstant;
476 unsigned int addedThis;
477 unsigned int needCast;
478 unsigned int thisPtr;
479 } __attribute__ ((gcc_struct));
481 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
483 struct TemplateDatatype;
485 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
487 struct TemplateArgument;
489 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
491 struct TemplateParameter;
493 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
497 struct Specifier * prev;
498 struct Specifier * next;
506 struct ExtDecl * extDecl;
508 struct Symbol * symbol;
509 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
510 } __attribute__ ((gcc_struct));
513 struct Identifier * id;
514 struct __ecereNameSpace__ecere__sys__OldList * list;
515 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
516 struct __ecereNameSpace__ecere__sys__OldList * definitions;
517 unsigned int addNameSpace;
518 struct Context * ctx;
519 struct ExtDecl * extDeclStruct;
520 } __attribute__ ((gcc_struct));
521 struct Expression * expression;
522 struct Specifier * _class;
523 struct TemplateParameter * templateParameter;
524 } __attribute__ ((gcc_struct));
525 } __attribute__ ((gcc_struct));
527 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
531 struct Identifier * prev;
532 struct Identifier * next;
534 struct Symbol * classSym;
535 struct Specifier * _class;
537 struct Identifier * badID;
538 } __attribute__ ((gcc_struct));
540 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
544 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
548 struct Declarator * prev;
549 struct Declarator * next;
552 struct Symbol * symbol;
553 struct Declarator * declarator;
556 struct Identifier * identifier;
559 struct Expression * exp;
560 struct Expression * posExp;
561 struct Attrib * attrib;
562 } __attribute__ ((gcc_struct)) structDecl;
565 struct Expression * exp;
566 struct Specifier * enumClass;
567 } __attribute__ ((gcc_struct)) array;
570 struct __ecereNameSpace__ecere__sys__OldList * parameters;
571 } __attribute__ ((gcc_struct)) function;
574 struct Pointer * pointer;
575 } __attribute__ ((gcc_struct)) pointer;
578 struct ExtDecl * extended;
579 } __attribute__ ((gcc_struct)) extended;
580 } __attribute__ ((gcc_struct));
581 } __attribute__ ((gcc_struct));
583 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
585 struct FunctionDefinition
587 struct FunctionDefinition * prev;
588 struct FunctionDefinition * next;
590 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
591 struct Declarator * declarator;
592 struct __ecereNameSpace__ecere__sys__OldList * declarations;
593 struct Statement * body;
594 struct __ecereNameSpace__ecere__com__Class * _class;
595 struct __ecereNameSpace__ecere__sys__OldList attached;
598 struct Symbol * propSet;
600 unsigned int propertyNoThis;
601 } __attribute__ ((gcc_struct));
603 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
607 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
611 struct External * prev;
612 struct External * next;
615 struct Symbol * symbol;
618 struct FunctionDefinition * function;
619 struct ClassDefinition * _class;
620 struct Declaration * declaration;
622 struct Identifier * id;
623 struct DBTableDef * table;
624 } __attribute__ ((gcc_struct));
626 } __attribute__ ((gcc_struct));
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
636 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
641 struct Symbol * parent;
642 struct Symbol * left;
643 struct Symbol * right;
648 struct __ecereNameSpace__ecere__com__Method * method;
649 struct __ecereNameSpace__ecere__com__Property * _property;
650 struct __ecereNameSpace__ecere__com__Class * registered;
651 } __attribute__ ((gcc_struct));
658 struct External * pointerExternal;
659 struct External * structExternal;
660 } __attribute__ ((gcc_struct));
663 struct External * externalGet;
664 struct External * externalSet;
665 struct External * externalPtr;
666 struct External * externalIsSet;
667 } __attribute__ ((gcc_struct));
670 struct External * methodExternal;
671 struct External * methodCodeExternal;
672 } __attribute__ ((gcc_struct));
673 } __attribute__ ((gcc_struct));
674 unsigned int imported;
675 unsigned int declaredStructSym;
676 struct __ecereNameSpace__ecere__com__Class * _class;
677 unsigned int declaredStruct;
678 unsigned int needConstructor;
679 unsigned int needDestructor;
680 char * constructorName;
683 char * destructorName;
684 struct ModuleImport * module;
685 struct ClassImport * _import;
686 struct Location nameLoc;
687 unsigned int isParam;
688 unsigned int isRemote;
689 unsigned int isStruct;
690 unsigned int fireWatchersDone;
692 unsigned int classData;
693 unsigned int isStatic;
695 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
696 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
697 struct Context * ctx;
699 struct Expression * propCategory;
700 } __attribute__ ((gcc_struct));
702 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
711 struct Symbol * _class;
714 struct __ecereNameSpace__ecere__sys__OldList members;
716 } __attribute__ ((gcc_struct));
719 struct Type * returnType;
720 struct __ecereNameSpace__ecere__sys__OldList params;
721 struct Symbol * thisClass;
722 unsigned int staticMethod;
723 struct TemplateParameter * thisClassTemplate;
724 } __attribute__ ((gcc_struct));
727 struct __ecereNameSpace__ecere__com__Method * method;
728 struct __ecereNameSpace__ecere__com__Class * methodClass;
729 struct __ecereNameSpace__ecere__com__Class * usedClass;
730 } __attribute__ ((gcc_struct));
733 struct Type * arrayType;
735 struct Expression * arraySizeExp;
736 unsigned int freeExp;
737 struct Symbol * enumClass;
738 } __attribute__ ((gcc_struct));
740 struct TemplateParameter * templateParameter;
741 } __attribute__ ((gcc_struct));
751 unsigned int isSigned : 1;
752 unsigned int constant : 1;
753 unsigned int truth : 1;
754 unsigned int byReference : 1;
755 unsigned int extraParam : 1;
756 unsigned int directClassAccess : 1;
757 unsigned int computing : 1;
758 unsigned int keepCast : 1;
759 unsigned int passAsTemplate : 1;
760 unsigned int dllExport : 1;
761 unsigned int attrStdcall : 1;
762 unsigned int declaredWithStruct : 1;
763 unsigned int typedByReference : 1;
764 } __attribute__ ((gcc_struct));
766 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
768 struct __ecereNameSpace__ecere__com__Class
770 struct __ecereNameSpace__ecere__com__Class * prev;
771 struct __ecereNameSpace__ecere__com__Class * next;
777 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
778 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
781 struct __ecereNameSpace__ecere__com__Class * base;
782 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
783 struct __ecereNameSpace__ecere__sys__BinaryTree members;
784 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
785 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
786 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
787 struct __ecereNameSpace__ecere__sys__OldList derivatives;
791 struct __ecereNameSpace__ecere__com__Instance * module;
792 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
793 char * dataTypeString;
794 struct Type * dataType;
796 int defaultAlignment;
797 void (* Initialize)();
799 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
800 char * designerClass;
801 unsigned int noExpansion;
802 char * defaultProperty;
803 unsigned int comRedefinition;
805 unsigned int isRemote;
806 unsigned int internalDecl;
808 unsigned int computeSize;
810 int destructionWatchOffset;
812 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
813 int inheritanceAccess;
816 struct __ecereNameSpace__ecere__sys__OldList conversions;
817 struct __ecereNameSpace__ecere__sys__OldList templateParams;
818 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
819 struct __ecereNameSpace__ecere__com__Class * templateClass;
820 struct __ecereNameSpace__ecere__sys__OldList templatized;
822 unsigned int isInstanceClass;
823 unsigned int byValueSystemClass;
824 } __attribute__ ((gcc_struct));
826 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
828 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
830 struct __ecereNameSpace__ecere__com__Instance
833 struct __ecereNameSpace__ecere__com__Class * _class;
835 } __attribute__ ((gcc_struct));
837 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
839 struct __ecereNameSpace__ecere__com__DataMember
841 struct __ecereNameSpace__ecere__com__DataMember * prev;
842 struct __ecereNameSpace__ecere__com__DataMember * next;
844 unsigned int isProperty;
847 struct __ecereNameSpace__ecere__com__Class * _class;
848 char * dataTypeString;
849 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
850 struct Type * dataType;
854 struct __ecereNameSpace__ecere__sys__OldList members;
855 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
858 } __attribute__ ((gcc_struct));
860 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
862 struct __ecereNameSpace__ecere__com__SerialBuffer
864 unsigned char * _buffer;
868 } __attribute__ ((gcc_struct));
870 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
872 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
878 char * dataTypeString;
879 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
880 } __attribute__ ((gcc_struct));
881 struct __ecereNameSpace__ecere__com__DataValue expression;
887 struct __ecereNameSpace__ecere__com__DataMember * member;
888 struct __ecereNameSpace__ecere__com__Property * prop;
889 struct __ecereNameSpace__ecere__com__Method * method;
890 } __attribute__ ((gcc_struct));
891 } __attribute__ ((gcc_struct));
892 } __attribute__ ((gcc_struct));
893 } __attribute__ ((gcc_struct));
897 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
900 typedef union YYSTYPE
905 struct Identifier * id;
906 struct Expression * exp;
907 struct Specifier * specifier;
908 struct __ecereNameSpace__ecere__sys__OldList * list;
909 struct Enumerator * enumerator;
910 struct Declarator * declarator;
911 struct Pointer * pointer;
912 struct Initializer * initializer;
913 struct InitDeclarator * initDeclarator;
914 struct TypeName * typeName;
915 struct Declaration * declaration;
916 struct Statement * stmt;
917 struct FunctionDefinition * function;
918 struct External * external;
919 struct Context * context;
920 struct AsmField * asmField;
921 struct Attrib * attrib;
922 struct ExtDecl * extDecl;
923 struct Attribute * attribute;
924 struct Instantiation * instance;
925 struct MembersInit * membersInit;
926 struct MemberInit * memberInit;
927 struct ClassFunction * classFunction;
928 struct ClassDefinition * _class;
929 struct ClassDef * classDef;
930 struct PropertyDef * prop;
932 struct Symbol * symbol;
933 struct PropertyWatch * propertyWatch;
934 struct TemplateParameter * templateParameter;
935 struct TemplateArgument * templateArgument;
936 struct TemplateDatatype * templateDatatype;
937 struct DBTableEntry * dbtableEntry;
938 struct DBIndexItem * dbindexItem;
939 struct DBTableDef * dbtableDef;
940 } __attribute__ ((gcc_struct)) YYSTYPE;
942 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
946 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
948 struct InitDeclarator;
950 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
954 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
958 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
962 struct ClassFunction * prev;
963 struct ClassFunction * next;
965 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
966 struct Declarator * declarator;
967 struct __ecereNameSpace__ecere__sys__OldList * declarations;
968 struct Statement * body;
969 struct __ecereNameSpace__ecere__com__Class * _class;
970 struct __ecereNameSpace__ecere__sys__OldList attached;
973 struct Symbol * propSet;
974 unsigned int isVirtual;
975 unsigned int isConstructor;
976 unsigned int isDestructor;
977 unsigned int dontMangle;
980 } __attribute__ ((gcc_struct));
982 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
986 struct MembersInit * prev;
987 struct MembersInit * next;
992 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
993 struct ClassFunction * function;
994 } __attribute__ ((gcc_struct));
995 } __attribute__ ((gcc_struct));
997 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1001 struct MemberInit * prev;
1002 struct MemberInit * next;
1003 struct Location loc;
1004 struct Location realLoc;
1005 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1006 struct Initializer * initializer;
1008 unsigned int variable;
1009 unsigned int takeOutExp;
1010 } __attribute__ ((gcc_struct));
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1016 struct PropertyDef * prev;
1017 struct PropertyDef * next;
1018 struct Location loc;
1019 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1020 struct Declarator * declarator;
1021 struct Identifier * id;
1022 struct Statement * getStmt;
1023 struct Statement * setStmt;
1024 struct Statement * issetStmt;
1025 struct Symbol * symbol;
1026 unsigned int conversion;
1027 unsigned int isWatchable;
1028 struct Expression * category;
1029 } __attribute__ ((gcc_struct));
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1033 struct PropertyWatch;
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1039 struct ClassDef * prev;
1040 struct ClassDef * next;
1041 struct Location loc;
1045 struct Declaration * decl;
1046 struct ClassFunction * function;
1047 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1048 struct PropertyDef * propertyDef;
1049 struct PropertyWatch * propertyWatch;
1051 struct Identifier * defaultProperty;
1054 struct Identifier * id;
1055 struct Initializer * initializer;
1056 } __attribute__ ((gcc_struct));
1057 } __attribute__ ((gcc_struct));
1060 } __attribute__ ((gcc_struct));
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1064 struct DBTableEntry;
1066 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1070 extern YYSTYPE yylval;
1072 extern struct Location yylloc;
1074 extern struct External * curExternal;
1076 void MangleClassName(char * className)
1082 for(c = 0; (ch = className[c]); c++)
1121 output[d] = (char)0;
1124 extern char * strcat(char * , const char * );
1126 extern size_t strlen(const char * );
1128 void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams)
1134 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1138 strcat(output, "__ecereNameSpace__");
1142 len = strlen(output);
1143 for(c = 0; (ch = className[c]); c++)
1146 output[len++] = '_';
1148 output[len++] = '_';
1151 output[len++] = '_';
1152 output[len++] = 'P';
1153 output[len++] = 'T';
1154 output[len++] = 'R';
1155 output[len++] = '_';
1159 output[len++] = '_';
1160 output[len++] = 'E';
1161 output[len++] = 'Q';
1162 output[len++] = 'U';
1163 output[len++] = '_';
1167 if(!includeTemplateParams)
1169 output[len++] = '_';
1170 output[len++] = 'T';
1171 output[len++] = 'P';
1172 output[len++] = 'L';
1173 output[len++] = '_';
1177 output[len++] = '_';
1181 output[len++] = '__';
1186 output[len++] = (char)0;
1189 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);
1191 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1193 if(_class->type != 1000)
1194 AddMembers(list, _class, 0x0, (((void *)0)), topClass, (((void *)0)));
1197 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1199 struct __ecereNameSpace__ecere__com__NameSpace
1202 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1203 struct __ecereNameSpace__ecere__com__NameSpace * left;
1204 struct __ecereNameSpace__ecere__com__NameSpace * right;
1206 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1207 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1208 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1209 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1210 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1211 } __attribute__ ((gcc_struct));
1213 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1217 else if((*ns).parent)
1218 return NameSpaceContained((*ns).parent, parent);
1223 extern void Compiler_Error(char * format, ...);
1225 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
1227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1229 struct __ecereNameSpace__ecere__com__Module
1231 struct __ecereNameSpace__ecere__com__Instance * application;
1232 struct __ecereNameSpace__ecere__sys__OldList classes;
1233 struct __ecereNameSpace__ecere__sys__OldList defines;
1234 struct __ecereNameSpace__ecere__sys__OldList functions;
1235 struct __ecereNameSpace__ecere__sys__OldList modules;
1236 struct __ecereNameSpace__ecere__com__Instance * prev;
1237 struct __ecereNameSpace__ecere__com__Instance * next;
1243 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1244 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1245 } __attribute__ ((gcc_struct));
1247 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1249 struct __ecereNameSpace__ecere__com__Application
1254 unsigned int isGUIApp;
1255 struct __ecereNameSpace__ecere__sys__OldList allModules;
1256 char * parsedCommand;
1257 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1258 } __attribute__ ((gcc_struct));
1260 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1262 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1264 static void CheckPublicClass(struct Symbol * classSym, int access, char * word)
1266 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->registered : (((void *)0));
1270 if(regClass->templateClass)
1271 regClass = regClass->templateClass;
1272 if(classSym->isStatic && access != 3)
1274 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1276 else if(access == 1)
1278 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->application + structSize_Module)))->systemNameSpace))
1280 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1281 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1287 static void CheckPublicTypeName(struct TypeName * type, int access)
1289 if(type->qualifiers)
1291 struct Specifier * spec;
1293 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1297 struct Symbol * classSym = spec->symbol;
1299 CheckPublicClass(classSym, access, "define");
1305 static void CheckPublicExpression(struct Expression * exp, int access);
1307 static void CheckPublicInitializer(struct Initializer * init, int access)
1312 CheckPublicExpression(init->exp, access);
1316 struct Initializer * i;
1318 for(i = (*init->list).first; i; i = i->next)
1319 CheckPublicInitializer(i, access);
1325 static void CheckPublicExpression(struct Expression * exp, int access)
1339 CheckPublicExpression(exp->op.exp1, access);
1341 CheckPublicExpression(exp->op.exp2, access);
1345 struct Expression * e;
1347 for(e = (*exp->list).first; e; e = e->next)
1348 CheckPublicExpression(e, access);
1353 struct Expression * e;
1355 CheckPublicExpression(exp->index.exp, access);
1356 for(e = (*exp->index.index).first; e; e = e->next)
1357 CheckPublicExpression(e, access);
1362 struct Expression * e;
1364 CheckPublicExpression(exp->call.exp, access);
1365 if(exp->call.arguments)
1367 for(e = (*exp->call.arguments).first; e; e = e->next)
1368 CheckPublicExpression(e, access);
1374 CheckPublicExpression(exp->member.exp, access);
1379 CheckPublicExpression(exp->member.exp, access);
1383 CheckPublicTypeName(exp->typeName, access);
1387 struct Type * type = exp->expType;
1389 CheckPublicTypeName(exp->cast.typeName, access);
1391 CheckPublicExpression(exp->cast.exp, access);
1396 struct Expression * e;
1398 CheckPublicExpression(exp->cond.cond, access);
1399 for(e = (*exp->cond.exp).first; e; e = e->next)
1400 CheckPublicExpression(e, access);
1401 CheckPublicExpression(exp->cond.elseExp, access);
1406 CheckPublicExpression(exp->_new.size, access);
1410 CheckPublicExpression(exp->_renew.size, access);
1411 CheckPublicExpression(exp->_renew.exp, access);
1415 struct MembersInit * members;
1417 CheckPublicClass(exp->instance->_class->symbol, access, "define");
1418 for(members = (*exp->instance->members).first; members; members = members->next)
1420 if(members->type == 0)
1422 struct MemberInit * member;
1424 for(member = (*members->dataMembers).first; member; member = member->next)
1426 CheckPublicInitializer(member->initializer, access);
1436 static void CheckPublicDataType(struct Type * type, int access, char * word)
1444 CheckPublicClass(type->_class, access, word);
1454 struct Type * param;
1456 CheckPublicDataType(type->returnType, access, word);
1457 for(param = type->params.first; param; param = param->next)
1458 CheckPublicDataType(param, access, word);
1459 CheckPublicClass(type->thisClass, access, word);
1463 CheckPublicDataType(type->arrayType, access, word);
1465 CheckPublicClass(type->enumClass, access, word);
1469 CheckPublicDataType(type->type, access, word);
1478 CheckPublicClass(type->_class, access, word);
1485 extern struct Identifier * GetDeclId(struct Declarator * decl);
1487 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1489 struct __ecereNameSpace__ecere__com__BTNamedLink
1492 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1493 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1494 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1497 } __attribute__ ((gcc_struct));
1499 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);
1501 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1503 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1505 if(definitions != (((void *)0)))
1507 struct ClassDef * def;
1509 for(def = definitions->first; def; def = def->next)
1513 struct Declaration * decl = def->decl;
1514 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1519 struct Declarator * d;
1521 if(decl->declarators)
1523 for(d = (*decl->declarators).first; d; d = d->next)
1525 struct Identifier * declId = GetDeclId(d);
1531 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1533 dataMember = link ? link->data : (((void *)0));
1536 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1538 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1542 else if(decl->specifiers)
1544 struct Specifier * spec;
1546 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
1548 if(spec->type == 3 || spec->type == 4)
1550 if(spec->definitions && !spec->id)
1552 CheckMembersDefinitions(regClass, member, spec->definitions, (def->memberAccess == 2) ? 2 : access);
1554 else if(spec->definitions && spec->id)
1558 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->id->string);
1560 dataMember = link ? link->data : (((void *)0));
1563 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->id->string, privateModule, (((void *)0)), (((void *)0)));
1565 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1571 else if(decl->type == 2)
1573 CheckPublicClass(decl->inst->_class->symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1580 extern unsigned int inCompiler;
1582 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1584 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
1586 extern struct Symbol * FindClass(char * name);
1588 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);
1590 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);
1592 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);
1594 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);
1596 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);
1598 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1600 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1602 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1604 extern struct Specifier * MkSpecifierName(char * name);
1606 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1608 extern struct Identifier * MkIdentifier(char * string);
1610 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1612 extern struct Expression * QMkExpId(char * id);
1614 extern void FreeDeclarator(struct Declarator * decl);
1616 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
1618 extern void FreeSpecifier(struct Specifier * spec);
1620 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1622 extern struct Type * MkClassType(char * name);
1624 extern char * strcpy(char * , const char * );
1626 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1628 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1630 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1632 extern void FreeExternal(struct External * external);
1634 extern int declMode;
1636 extern int structDeclMode;
1638 extern char * strstr(const char * , const char * );
1640 extern char * sourceFile;
1642 extern struct Specifier * MkSpecifier(int specifier);
1644 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1646 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1648 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1650 extern struct Context * PushContext(void);
1652 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1654 extern struct Expression * CopyExpression(struct Expression * exp);
1656 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1658 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1660 extern void PopContext(struct Context * ctx);
1662 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1664 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1666 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1668 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1670 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1672 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1674 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1676 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1678 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1680 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1682 extern void FreeInitializer(struct Initializer * initializer);
1684 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1686 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1688 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1690 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1692 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1694 extern int sprintf(char * , char * , ...);
1696 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1698 extern struct Context * curContext;
1700 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1702 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1704 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1706 extern void FreeType(struct Type * type);
1708 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1710 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1712 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1714 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1716 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1718 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1720 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1722 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1724 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1726 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)
1728 char structName[1024];
1729 char className[1024];
1730 char constructorName[1024];
1731 char destructorName[1024];
1732 struct __ecereNameSpace__ecere__com__Class * regClass;
1733 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1734 unsigned int redefinition = 0x0;
1735 unsigned int isUnion = classType == 6;
1736 struct External * external = (((void *)0));
1737 struct ClassDef * def;
1738 struct __ecereNameSpace__ecere__sys__OldList * list;
1739 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1744 classDataList = MkList();
1746 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1749 classType = regClass->type;
1753 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1755 if(!regClass->base->symbol)
1756 regClass->base->symbol = FindClass(regClass->base->fullName);
1757 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1759 else if(!symbol->isStatic && regClass->base)
1761 if(!regClass->base->symbol)
1762 regClass->base->symbol = FindClass(regClass->base->fullName);
1763 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1766 if(definitions != (((void *)0)))
1768 for(def = definitions->first; def; def = def->next)
1772 struct __ecereNameSpace__ecere__com__DataMember * member;
1773 struct __ecereNameSpace__ecere__com__Property * prop;
1774 struct __ecereNameSpace__ecere__com__Method * method;
1776 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->id->string, privateModule)))
1778 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1780 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->id->string, privateModule, (((void *)0)), (((void *)0)))))
1782 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->id->string, (((void *)0)), 0, 0, def->memberAccess);
1784 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->id->string, privateModule)))
1786 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1791 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->id->string);
1798 external = MkExternalDeclaration((((void *)0)));
1799 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1800 curExternal = external;
1801 curExternal->symbol = symbol;
1803 if((classType == 1 || classType == 5) && inCompiler)
1805 AddSimpleBaseMembers(list, regClass->base, regClass);
1807 if(definitions != (((void *)0)))
1811 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1812 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1813 else if(!symbol->isStatic)
1814 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1816 for(def = definitions->first; def; def = def->next)
1820 struct Declaration * decl = def->decl;
1824 if(inCompiler && classType != 2)
1826 ListAdd(list, MkClassDefDeclaration(decl));
1827 def->decl = (((void *)0));
1830 else if(decl->type == 2)
1832 struct Instantiation * inst = decl->inst;
1833 struct Expression * exp = inst->exp;
1834 struct Symbol * classSym;
1838 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1839 struct Declarator * d;
1841 ListAdd(specifiers, MkSpecifierName(inst->_class->name));
1842 d = MkDeclaratorIdentifier(MkIdentifier(exp->identifier->string));
1845 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1847 ListAdd(declarators, d);
1848 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1849 ListAdd(list, MkClassDefDeclaration(decl));
1851 exp->member.member = exp->identifier;
1852 exp->member.exp = QMkExpId("this");
1853 exp->member.memberType = 3;
1854 exp->member.thisPtr = 0x1;
1859 FreeList(specifiers, FreeSpecifier);
1862 classSym = inst->_class->symbol;
1863 if(classSym && classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 2 || classSym->registered->type == 3))
1865 if(inst->members && (*inst->members).count)
1866 symbol->needConstructor = 0x1;
1870 symbol->needConstructor = 0x1;
1871 symbol->needDestructor = 0x1;
1875 else if(def->type == 9)
1877 struct Declaration * decl = def->decl;
1881 if(inCompiler && classType != 2)
1883 ListAdd(classDataList, MkClassDefDeclaration(decl));
1884 def->decl = (((void *)0));
1888 else if(def->type == 1)
1889 symbol->needConstructor = 0x1;
1890 else if(def->type == 4)
1891 symbol->needConstructor = 0x1;
1892 else if(def->type == 0)
1894 struct ClassFunction * func = def->function;
1896 if(func->isDestructor)
1901 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1905 symbol->needDestructor = 0x1;
1907 if(!inCompiler && func->body)
1909 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1911 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1915 if(func->isConstructor)
1920 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1924 symbol->needConstructor = 0x1;
1926 if(!inCompiler && func->body)
1928 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1930 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1939 external->symbol = (((void *)0));
1942 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1944 initDeclarators = (((void *)0));
1945 strcpy(structName, symbol->string);
1946 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1948 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1950 spec->extDeclStruct = extDecl;
1951 ListAdd(specs, spec);
1953 external->symbol = symbol;
1954 symbol->structExternal = external;
1955 external->declaration = MkDeclaration(specs, declarators);
1957 symbol->declaredStruct = 0x1;
1961 curExternal = external->prev;
1962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1963 FreeExternal(external);
1964 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1966 if((*classDataList).count)
1968 char classDataStructName[1024];
1969 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1970 struct External * external;
1972 strcpy(classDataStructName, "__ecereClassData_");
1973 FullClassNameCat(classDataStructName, symbol->string, 0x0);
1974 declMode = structDeclMode = 0;
1975 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1976 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1977 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1979 symbol->classData = 0x1;
1982 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1987 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1989 strcpy(className, "__ecereClass_");
1990 FullClassNameCat(className, symbol->string, 0x1);
1991 MangleClassName(className);
1992 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
1993 if(!strstr(sourceFile, ".main.ec"))
1994 ListAdd(specs, MkSpecifier(STATIC));
1995 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
1996 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
1997 symbol->methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
1998 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->methodExternal);
1999 after = symbol->methodExternal;
2001 if(symbol->needDestructor)
2003 struct ClassFunction * function;
2004 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2005 struct Declarator * decl;
2006 struct Statement * body;
2007 struct Context * context;
2008 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2010 strcpy(destructorName, "__ecereDestructor_");
2011 FullClassNameCat(destructorName, symbol->string, 0x0);
2012 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2013 ListAdd(specs, MkSpecifier(VOID));
2014 context = PushContext();
2015 statements = MkList();
2016 if(definitions != (((void *)0)))
2018 for(def = definitions->first; def; def = def->next)
2020 if(def->type == 2 && def->decl && def->decl->type == 2)
2022 struct Instantiation * inst = def->decl->inst;
2023 struct Symbol * classSym = inst->_class->symbol;
2025 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2027 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2029 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2031 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 5))
2033 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2035 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2040 if(destructor && destructor->body)
2042 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2043 destructor->body->compound.context->parent = context;
2044 destructor->body = (((void *)0));
2046 body = MkCompoundStmt(declarations, statements);
2047 PopContext(context);
2048 body->compound.context = context;
2049 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2050 decl->symbol = __extension__ ({
2051 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2053 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2056 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2057 ProcessClassFunctionBody(function, body);
2058 function->id = symbol->id;
2059 function->idCode = symbol->idCode;
2060 function->dontMangle = 0x1;
2061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2063 if(symbol->needConstructor && inCompiler)
2065 struct ClassFunction * function;
2066 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2067 struct Declarator * decl;
2068 struct Statement * body;
2069 struct Context * context;
2070 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2072 strcpy(constructorName, "__ecereConstructor_");
2073 FullClassNameCat(constructorName, symbol->string, 0x0);
2074 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2075 ListAdd(specs, MkSpecifierName("bool"));
2076 context = PushContext();
2077 statements = MkList();
2078 if(definitions != (((void *)0)))
2080 for(def = definitions->first; def; def = def->next)
2082 if(def->type == 2 && def->decl && def->decl->type == 2)
2084 struct Instantiation * inst = def->decl->inst;
2085 struct Symbol * classSym = inst->_class->symbol;
2087 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2089 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2092 newInst->members = (((void *)0));
2093 newInst->exp = CopyExpression(inst->exp);
2094 newInst->_class = CopySpecifier(inst->_class);
2095 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2098 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2100 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2104 for(def = definitions->first; def; def = def->next)
2106 if(def->type == 1 && def->defProperties)
2108 struct MemberInit * propertyDef;
2110 for(propertyDef = (*def->defProperties).first; propertyDef; propertyDef = propertyDef->next)
2112 struct Expression * memberExp;
2113 struct Identifier * id = (*propertyDef->identifiers).first;
2117 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2118 for(id = id->next; id; id = id->next)
2119 memberExp = MkExpMember(memberExp, id);
2120 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->exp : (((void *)0)))))));
2122 if(propertyDef->initializer)
2124 if(propertyDef->initializer->type == 0)
2125 propertyDef->initializer->exp = (((void *)0));
2126 FreeInitializer(propertyDef->initializer);
2128 propertyDef->initializer = (((void *)0));
2129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2133 for(def = definitions->first; def; def = def->next)
2135 if(def->type == 2 && def->decl && def->decl->type == 2)
2137 struct Instantiation * inst = def->decl->inst;
2138 struct Symbol * classSym = inst->_class->symbol;
2140 if(inst->exp || (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2142 if(!(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5)) || (inst->members && (*inst->members).count))
2144 def->decl->inst = (((void *)0));
2145 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2151 if(constructor && constructor->body)
2153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2154 constructor->body->compound.context->parent = context;
2155 constructor->body = (((void *)0));
2157 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2158 body = MkCompoundStmt(declarations, statements);
2159 PopContext(context);
2160 body->compound.context = context;
2161 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2162 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2163 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2164 decl->symbol->id = symbol->id;
2165 decl->symbol->idCode = symbol->idCode;
2166 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2167 ProcessClassFunctionBody(function, body);
2168 function->id = symbol->id;
2169 function->idCode = symbol->idCode;
2170 function->dontMangle = 0x1;
2171 if(definitions != (((void *)0)))
2172 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2175 if(definitions != (((void *)0)))
2177 for(def = definitions->first; def; def = def->next)
2179 if(def->type == 3 && def->propertyDef)
2181 struct PropertyDef * propertyDef = def->propertyDef;
2182 struct ClassDef * after = def;
2183 struct ClassDef * newDef;
2187 yylloc = propertyDef->loc;
2188 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2189 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2190 else if(!symbol->isStatic)
2191 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2195 struct ClassFunction * func;
2196 struct Declarator * decl;
2198 struct __ecereNameSpace__ecere__sys__OldList * params;
2200 if(propertyDef->getStmt && propertyDef->id)
2202 strcpy(name, "__ecereProp_");
2203 FullClassNameCat(name, symbol->string, 0x0);
2204 strcat(name, "_Get_");
2205 FullClassNameCat(name, propertyDef->id->string, 0x1);
2206 MangleClassName(name);
2208 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)
2210 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2211 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2212 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2216 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2217 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2219 ProcessClassFunctionBody(func, propertyDef->getStmt);
2220 func->declarator->symbol = propertyDef->symbol;
2221 propertyDef->symbol->externalGet = (struct External *)func;
2222 func->dontMangle = 0x1;
2223 newDef = MkClassDefFunction(func);
2224 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2227 propertyDef->getStmt = (((void *)0));
2229 func->body = (((void *)0));
2231 if(propertyDef->setStmt && propertyDef->id)
2233 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2235 strcpy(name, "__ecereProp_");
2236 FullClassNameCat(name, symbol->string, 0x0);
2237 strcat(name, "_Set_");
2238 FullClassNameCat(name, propertyDef->id->string, 0x1);
2239 MangleClassName(name);
2241 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2242 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2243 if((regClass->type == 1 || regClass->type == 6) || ((regClass->type == 5 || regClass->type == 0) && (!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion)))
2244 ListAdd(specifiers, MkSpecifier(VOID));
2247 if(regClass->type != 5 && regClass->type != 0 && (!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion))
2248 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2249 ListAdd(specifiers, MkSpecifierName(regClass->fullName));
2251 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2252 ProcessClassFunctionBody(func, propertyDef->setStmt);
2253 func->dontMangle = 0x1;
2254 func->declarator->symbol = propertyDef->symbol;
2255 propertyDef->symbol->externalSet = (struct External *)func;
2256 if(!propertyDef->conversion && regClass->type == 0)
2257 func->propSet = propertyDef->symbol;
2258 newDef = MkClassDefFunction(func);
2259 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2262 propertyDef->setStmt = (((void *)0));
2264 func->body = (((void *)0));
2266 if(propertyDef->issetStmt && propertyDef->id)
2268 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2270 strcpy(name, "__ecereProp_");
2271 FullClassNameCat(name, symbol->string, 0x0);
2272 strcat(name, "_IsSet_");
2273 FullClassNameCat(name, propertyDef->id->string, 0x1);
2274 MangleClassName(name);
2276 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2277 ListAdd(specifiers, MkSpecifierName("bool"));
2278 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2279 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2280 func->dontMangle = 0x1;
2281 func->declarator->symbol = propertyDef->symbol;
2282 propertyDef->symbol->externalIsSet = (struct External *)func;
2283 newDef = MkClassDefFunction(func);
2284 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2287 propertyDef->issetStmt = (((void *)0));
2289 func->body = (((void *)0));
2291 if(propertyDef->id && inCompiler)
2293 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->registered, propertyDef->id->string, privateModule);
2294 struct Declaration * decl;
2295 struct External * external;
2296 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2298 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2299 ListAdd(specifiers, MkSpecifierName("Property"));
2300 strcpy(name, "__ecereProp_");
2301 FullClassNameCat(name, symbol->string, 0x0);
2303 FullClassNameCat(name, propertyDef->id->string, 0x1);
2304 MangleClassName(name);
2306 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2308 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2309 strcpy(name, "__ecerePropM_");
2310 FullClassNameCat(name, symbol->string, 0x0);
2312 FullClassNameCat(name, propertyDef->id->string, 0x1);
2313 MangleClassName(name);
2314 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2315 decl = MkDeclaration(specifiers, list);
2317 external = MkExternalDeclaration(decl);
2318 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2319 external->symbol = propertyDef->symbol;
2320 propertyDef->symbol->externalPtr = external;
2321 if(inCompiler && prop && prop->symbol)
2322 ((struct Symbol *)prop->symbol)->externalPtr = external;
2327 else if(def->type == 10 && def->propertyDef)
2329 struct PropertyDef * propertyDef = def->propertyDef;
2330 struct ClassDef * after = def;
2331 struct ClassDef * newDef;
2336 yylloc = propertyDef->loc;
2337 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2338 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2339 else if(!symbol->isStatic)
2340 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2343 struct ClassFunction * func;
2344 struct Declarator * decl;
2346 struct __ecereNameSpace__ecere__sys__OldList * params;
2348 if(propertyDef->getStmt && propertyDef->id)
2350 struct Declarator * declId;
2352 sprintf(name, "class::__ecereClassProp_");
2353 FullClassNameCat(name, symbol->string, 0x0);
2354 strcat(name, "_Get_");
2355 strcat(name, propertyDef->id->string);
2356 MangleClassName(name);
2358 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2360 decl = MkDeclaratorFunction(declId, params);
2361 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2363 ProcessClassFunctionBody(func, propertyDef->getStmt);
2364 func->declarator->symbol = propertyDef->symbol;
2365 propertyDef->symbol->externalGet = (struct External *)func;
2366 func->dontMangle = 0x1;
2367 newDef = MkClassDefFunction(func);
2368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2370 func->type = ProcessType(propertyDef->specifiers, MkDeclaratorFunction(propertyDef->declarator, (((void *)0))));
2371 if(func->type->returnType->kind == 8 && func->type->returnType->_class && func->type->returnType->_class->registered && func->type->returnType->_class->registered->type == 1)
2372 func->type->returnType->byReference = 0x1;
2374 propertyDef->getStmt = (((void *)0));
2376 func->body = (((void *)0));
2378 if(propertyDef->setStmt && propertyDef->id)
2380 struct Context * prevCurContext;
2381 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2382 struct Statement * body = propertyDef->setStmt;
2383 struct Declarator * ptrDecl;
2385 strcpy(name, "class::__ecereClassProp_");
2386 FullClassNameCat(name, symbol->string, 0x0);
2387 strcat(name, "_Set_");
2388 strcat(name, propertyDef->id->string);
2389 MangleClassName(name);
2391 prevCurContext = curContext;
2392 curContext = body->compound.context;
2393 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2394 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2395 if(!body->compound.declarations)
2396 body->compound.declarations = MkList();
2397 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)
2398 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2400 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2401 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"))))))));
2402 curContext = prevCurContext;
2404 struct Symbol * sym = ptrDecl->symbol;
2407 FreeType(sym->type);
2408 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2410 ListAdd(specifiers, MkSpecifier(VOID));
2411 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2412 ProcessClassFunctionBody(func, propertyDef->setStmt);
2413 func->dontMangle = 0x1;
2414 func->declarator->symbol = propertyDef->symbol;
2415 propertyDef->symbol->externalSet = (struct External *)func;
2416 newDef = MkClassDefFunction(func);
2417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2420 propertyDef->setStmt = (((void *)0));
2422 func->body = (((void *)0));
2427 else if(def->type == 0 && def->function->declarator)
2429 struct ClassFunction * func = def->function;
2431 func->_class = regClass;
2432 if(!func->dontMangle)
2434 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2435 struct Identifier * id = GetDeclId(funcDecl);
2436 struct __ecereNameSpace__ecere__com__Method * method;
2438 if(!funcDecl->function.parameters || !(*funcDecl->function.parameters).first)
2440 if(!funcDecl->function.parameters)
2441 funcDecl->function.parameters = MkList();
2442 ListAdd(funcDecl->function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2444 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2445 FreeSpecifier(id->_class);
2446 id->_class = (((void *)0));
2447 if(inCompiler && method)
2449 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2452 ProcessMethodType(method);
2454 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2455 CheckPublicDataType(method->dataType, 1, "class method");
2456 strcpy(newId, "__ecereMethod_");
2457 FullClassNameCat(newId, symbol->string, 0x0);
2459 strcat(newId, id->string);
2460 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2462 if(method->type != 1)
2466 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2467 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2475 if(initDeclarators != (((void *)0)))
2476 FreeList(initDeclarators, FreeInitDeclarator);
2479 void PreProcessClassDefinitions()
2481 struct External * external, * next;
2483 curExternal = (((void *)0));
2486 for(external = (*ast).first; external; external = next)
2488 next = external->next;
2489 curExternal = external;
2490 if(external->type == 2)
2492 struct ClassDefinition * _class = external->_class;
2494 if(_class->definitions)
2496 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2499 else if(external->type == 1)
2501 struct Declaration * declaration = external->declaration;
2503 if(declaration->type == 1)
2505 if(declaration->specifiers)
2507 struct Specifier * specifier;
2509 for(specifier = (*declaration->specifiers).first; specifier; specifier = specifier->next)
2511 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->id && specifier->id->string && (declaration->declMode || specifier->baseSpecs || (specifier->type == 2 && specifier->definitions)))
2513 struct Symbol * symbol = FindClass(specifier->id->string);
2517 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2518 struct ExtDecl * extDecl = specifier->extDeclStruct;
2520 specifier->extDeclStruct = (((void *)0));
2523 initDeclarators = declaration->declarators;
2524 declaration->declarators = (((void *)0));
2526 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->definitions, symbol, specifier->baseSpecs, specifier->list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2532 else if(inCompiler && declaration->type == 3)
2534 yylloc = declaration->loc;
2535 if(declaration->declMode == 1)
2536 CheckPublicExpression(declaration->exp, 1);
2537 else if(declaration->declMode != 3)
2538 CheckPublicExpression(declaration->exp, 2);
2541 else if(external->type == 3)
2544 else if(inCompiler && external->type == 0)
2546 yylloc = external->function->loc;
2547 if(!external->function->type)
2548 external->function->type = ProcessType(external->function->specifiers, external->function->declarator);
2549 if(external->function->declMode == 1)
2550 CheckPublicDataType(external->function->type, 1, "function");
2551 else if(external->function->declMode != 3)
2552 CheckPublicDataType(external->function->type, 2, "function");
2558 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2560 struct __ecereNameSpace__ecere__com__GlobalFunction;
2562 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);
2564 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2566 struct __ecereNameSpace__ecere__com__Class * class;
2568 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MangleClassName", "void MangleClassName(char * className)", MangleClassName, module, 1);
2569 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2570 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2573 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)