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 } __attribute__ ((gcc_struct));
761 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
763 struct __ecereNameSpace__ecere__com__Class
765 struct __ecereNameSpace__ecere__com__Class * prev;
766 struct __ecereNameSpace__ecere__com__Class * next;
772 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
773 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
776 struct __ecereNameSpace__ecere__com__Class * base;
777 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
778 struct __ecereNameSpace__ecere__sys__BinaryTree members;
779 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
780 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
781 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
782 struct __ecereNameSpace__ecere__sys__OldList derivatives;
786 struct __ecereNameSpace__ecere__com__Instance * module;
787 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
788 char * dataTypeString;
789 struct Type * dataType;
791 int defaultAlignment;
792 void (* Initialize)();
794 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
795 char * designerClass;
796 unsigned int noExpansion;
797 char * defaultProperty;
798 unsigned int comRedefinition;
800 unsigned int isRemote;
801 unsigned int internalDecl;
803 unsigned int computeSize;
805 int destructionWatchOffset;
807 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
808 int inheritanceAccess;
811 struct __ecereNameSpace__ecere__sys__OldList conversions;
812 struct __ecereNameSpace__ecere__sys__OldList templateParams;
813 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
814 struct __ecereNameSpace__ecere__com__Class * templateClass;
815 struct __ecereNameSpace__ecere__sys__OldList templatized;
817 unsigned int isInstanceClass;
818 } __attribute__ ((gcc_struct));
820 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
822 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
824 struct __ecereNameSpace__ecere__com__Instance
827 struct __ecereNameSpace__ecere__com__Class * _class;
829 } __attribute__ ((gcc_struct));
831 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
833 struct __ecereNameSpace__ecere__com__DataMember
835 struct __ecereNameSpace__ecere__com__DataMember * prev;
836 struct __ecereNameSpace__ecere__com__DataMember * next;
838 unsigned int isProperty;
841 struct __ecereNameSpace__ecere__com__Class * _class;
842 char * dataTypeString;
843 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
844 struct Type * dataType;
848 struct __ecereNameSpace__ecere__sys__OldList members;
849 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
852 } __attribute__ ((gcc_struct));
854 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
856 struct __ecereNameSpace__ecere__com__SerialBuffer
858 unsigned char * _buffer;
862 } __attribute__ ((gcc_struct));
864 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
866 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
872 char * dataTypeString;
873 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
874 } __attribute__ ((gcc_struct));
875 struct __ecereNameSpace__ecere__com__DataValue expression;
881 struct __ecereNameSpace__ecere__com__DataMember * member;
882 struct __ecereNameSpace__ecere__com__Property * prop;
883 struct __ecereNameSpace__ecere__com__Method * method;
884 } __attribute__ ((gcc_struct));
885 } __attribute__ ((gcc_struct));
886 } __attribute__ ((gcc_struct));
887 } __attribute__ ((gcc_struct));
891 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
894 typedef union YYSTYPE
899 struct Identifier * id;
900 struct Expression * exp;
901 struct Specifier * specifier;
902 struct __ecereNameSpace__ecere__sys__OldList * list;
903 struct Enumerator * enumerator;
904 struct Declarator * declarator;
905 struct Pointer * pointer;
906 struct Initializer * initializer;
907 struct InitDeclarator * initDeclarator;
908 struct TypeName * typeName;
909 struct Declaration * declaration;
910 struct Statement * stmt;
911 struct FunctionDefinition * function;
912 struct External * external;
913 struct Context * context;
914 struct AsmField * asmField;
915 struct Attrib * attrib;
916 struct ExtDecl * extDecl;
917 struct Attribute * attribute;
918 struct Instantiation * instance;
919 struct MembersInit * membersInit;
920 struct MemberInit * memberInit;
921 struct ClassFunction * classFunction;
922 struct ClassDefinition * _class;
923 struct ClassDef * classDef;
924 struct PropertyDef * prop;
926 struct Symbol * symbol;
927 struct PropertyWatch * propertyWatch;
928 struct TemplateParameter * templateParameter;
929 struct TemplateArgument * templateArgument;
930 struct TemplateDatatype * templateDatatype;
931 struct DBTableEntry * dbtableEntry;
932 struct DBIndexItem * dbindexItem;
933 struct DBTableDef * dbtableDef;
934 } __attribute__ ((gcc_struct)) YYSTYPE;
936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
940 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
942 struct InitDeclarator;
944 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
948 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
952 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
956 struct ClassFunction * prev;
957 struct ClassFunction * next;
959 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
960 struct Declarator * declarator;
961 struct __ecereNameSpace__ecere__sys__OldList * declarations;
962 struct Statement * body;
963 struct __ecereNameSpace__ecere__com__Class * _class;
964 struct __ecereNameSpace__ecere__sys__OldList attached;
967 struct Symbol * propSet;
968 unsigned int isVirtual;
969 unsigned int isConstructor;
970 unsigned int isDestructor;
971 unsigned int dontMangle;
974 } __attribute__ ((gcc_struct));
976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
980 struct MembersInit * prev;
981 struct MembersInit * next;
986 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
987 struct ClassFunction * function;
988 } __attribute__ ((gcc_struct));
989 } __attribute__ ((gcc_struct));
991 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
995 struct MemberInit * prev;
996 struct MemberInit * next;
998 struct Location realLoc;
999 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1000 struct Initializer * initializer;
1002 unsigned int variable;
1003 unsigned int takeOutExp;
1004 } __attribute__ ((gcc_struct));
1006 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1010 struct PropertyDef * prev;
1011 struct PropertyDef * next;
1012 struct Location loc;
1013 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1014 struct Declarator * declarator;
1015 struct Identifier * id;
1016 struct Statement * getStmt;
1017 struct Statement * setStmt;
1018 struct Statement * issetStmt;
1019 struct Symbol * symbol;
1020 unsigned int conversion;
1021 unsigned int isWatchable;
1022 struct Expression * category;
1023 } __attribute__ ((gcc_struct));
1025 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1027 struct PropertyWatch;
1029 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1033 struct ClassDef * prev;
1034 struct ClassDef * next;
1035 struct Location loc;
1039 struct Declaration * decl;
1040 struct ClassFunction * function;
1041 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1042 struct PropertyDef * propertyDef;
1043 struct PropertyWatch * propertyWatch;
1045 struct Identifier * defaultProperty;
1048 struct Identifier * id;
1049 struct Initializer * initializer;
1050 } __attribute__ ((gcc_struct));
1051 } __attribute__ ((gcc_struct));
1054 } __attribute__ ((gcc_struct));
1056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1058 struct DBTableEntry;
1060 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1064 extern YYSTYPE yylval;
1066 extern struct Location yylloc;
1068 extern struct External * curExternal;
1070 void MangleClassName(char * className)
1076 for(c = 0; (ch = className[c]); c++)
1115 output[d] = (char)0;
1118 extern char * strcat(char * , const char * );
1120 extern size_t strlen(const char * );
1122 void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams)
1128 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1132 strcat(output, "__ecereNameSpace__");
1136 len = strlen(output);
1137 for(c = 0; (ch = className[c]); c++)
1140 output[len++] = '_';
1142 output[len++] = '_';
1145 output[len++] = '_';
1146 output[len++] = 'P';
1147 output[len++] = 'T';
1148 output[len++] = 'R';
1149 output[len++] = '_';
1153 output[len++] = '_';
1154 output[len++] = 'E';
1155 output[len++] = 'Q';
1156 output[len++] = 'U';
1157 output[len++] = '_';
1161 if(!includeTemplateParams)
1163 output[len++] = '_';
1164 output[len++] = 'T';
1165 output[len++] = 'P';
1166 output[len++] = 'L';
1167 output[len++] = '_';
1171 output[len++] = '_';
1175 output[len++] = '__';
1180 output[len++] = (char)0;
1183 extern int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding);
1185 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1187 if(_class->type != 1000)
1188 AddMembers(list, _class, 0x0, (((void *)0)), topClass, (((void *)0)));
1191 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1193 struct __ecereNameSpace__ecere__com__NameSpace
1196 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1197 struct __ecereNameSpace__ecere__com__NameSpace * left;
1198 struct __ecereNameSpace__ecere__com__NameSpace * right;
1200 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1201 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1202 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1203 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1204 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1205 } __attribute__ ((gcc_struct));
1207 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1211 else if((*ns).parent)
1212 return NameSpaceContained((*ns).parent, parent);
1217 extern void Compiler_Error(char * format, ...);
1219 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
1221 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
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(__thisModule, "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(__thisModule, "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(__thisModule, "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(__thisModule, "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(__thisModule, "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 char * strstr(const char * , const char * );
1634 extern char * sourceFile;
1636 extern struct Specifier * MkSpecifier(int specifier);
1638 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1640 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1642 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1644 extern struct Context * PushContext(void);
1646 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1648 extern struct Expression * CopyExpression(struct Expression * exp);
1650 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1652 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1654 extern void PopContext(struct Context * ctx);
1656 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1658 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1660 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1662 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1664 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1666 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1668 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1670 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1672 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1674 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1676 extern void FreeInitializer(struct Initializer * initializer);
1678 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1680 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1682 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1684 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1686 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1688 extern int sprintf(char * , char * , ...);
1690 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1692 extern struct Context * curContext;
1694 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1696 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1698 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1700 extern void FreeType(struct Type * type);
1702 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1704 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1706 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1708 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1710 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1712 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1714 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1716 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1718 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1720 static void ProcessClass(int classType, struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol, struct __ecereNameSpace__ecere__sys__OldList * baseSpecs, struct __ecereNameSpace__ecere__sys__OldList * enumValues, struct Location * loc, struct __ecereNameSpace__ecere__sys__OldList * defs, void * after, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators, struct ExtDecl * extDecl)
1722 char structName[1024];
1723 char className[1024];
1724 char constructorName[1024];
1725 char destructorName[1024];
1726 struct __ecereNameSpace__ecere__com__Class * regClass;
1727 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1728 unsigned int redefinition = 0x0;
1729 unsigned int isUnion = classType == 6;
1730 struct External * external = (((void *)0));
1731 struct ClassDef * def;
1732 struct __ecereNameSpace__ecere__sys__OldList * list;
1733 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1738 classDataList = MkList();
1740 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1743 classType = regClass->type;
1747 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1749 if(!regClass->base->symbol)
1750 regClass->base->symbol = FindClass(regClass->base->fullName);
1751 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class", (((void *)0))));
1753 else if(!symbol->isStatic && regClass->base)
1755 if(!regClass->base->symbol)
1756 regClass->base->symbol = FindClass(regClass->base->fullName);
1757 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString(__thisModule, "class", (((void *)0))));
1760 if(definitions != (((void *)0)))
1762 for(def = definitions->first; def; def = def->next)
1766 struct __ecereNameSpace__ecere__com__DataMember * member;
1767 struct __ecereNameSpace__ecere__com__Property * prop;
1768 struct __ecereNameSpace__ecere__com__Method * method;
1770 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->id->string, privateModule)))
1772 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1774 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->id->string, privateModule, (((void *)0)), (((void *)0)))))
1776 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->id->string, (((void *)0)), 0, 0, def->memberAccess);
1778 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->id->string, privateModule)))
1780 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1785 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't find member %s to override\n", (((void *)0))), def->id->string);
1792 external = MkExternalDeclaration((((void *)0)));
1793 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1794 curExternal = external;
1795 curExternal->symbol = symbol;
1797 if((classType == 1 || classType == 5) && inCompiler)
1799 AddSimpleBaseMembers(list, regClass->base, regClass);
1801 if(definitions != (((void *)0)))
1805 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1806 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1807 else if(!symbol->isStatic)
1808 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1810 for(def = definitions->first; def; def = def->next)
1814 struct Declaration * decl = def->decl;
1818 if(inCompiler && classType != 2)
1820 ListAdd(list, MkClassDefDeclaration(decl));
1821 def->decl = (((void *)0));
1824 else if(decl->type == 2)
1826 struct Instantiation * inst = decl->inst;
1827 struct Expression * exp = inst->exp;
1828 struct Symbol * classSym;
1832 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1833 struct Declarator * d;
1835 ListAdd(specifiers, MkSpecifierName(inst->_class->name));
1836 d = MkDeclaratorIdentifier(MkIdentifier(exp->identifier->string));
1839 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1841 ListAdd(declarators, d);
1842 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1843 ListAdd(list, MkClassDefDeclaration(decl));
1845 exp->member.member = exp->identifier;
1846 exp->member.exp = QMkExpId("this");
1847 exp->member.memberType = 3;
1848 exp->member.thisPtr = 0x1;
1853 FreeList(specifiers, FreeSpecifier);
1856 classSym = inst->_class->symbol;
1857 if(classSym && classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 2 || classSym->registered->type == 3))
1859 if(inst->members && (*inst->members).count)
1860 symbol->needConstructor = 0x1;
1864 symbol->needConstructor = 0x1;
1865 symbol->needDestructor = 0x1;
1869 else if(def->type == 9)
1871 struct Declaration * decl = def->decl;
1875 if(inCompiler && classType != 2)
1877 ListAdd(classDataList, MkClassDefDeclaration(decl));
1878 def->decl = (((void *)0));
1882 else if(def->type == 1)
1883 symbol->needConstructor = 0x1;
1884 else if(def->type == 4)
1885 symbol->needConstructor = 0x1;
1886 else if(def->type == 0)
1888 struct ClassFunction * func = def->function;
1890 if(func->isDestructor)
1895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1899 symbol->needDestructor = 0x1;
1901 if(!inCompiler && func->body)
1903 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1905 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1909 if(func->isConstructor)
1914 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1918 symbol->needConstructor = 0x1;
1920 if(!inCompiler && func->body)
1922 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1924 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1933 external->symbol = (((void *)0));
1936 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1938 initDeclarators = (((void *)0));
1939 strcpy(structName, symbol->string);
1940 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1942 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1944 spec->extDeclStruct = extDecl;
1945 ListAdd(specs, spec);
1947 external->symbol = symbol;
1948 symbol->structExternal = external;
1949 external->declaration = MkDeclaration(specs, declarators);
1951 symbol->declaredStruct = 0x1;
1955 curExternal = external->prev;
1956 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1957 FreeExternal(external);
1958 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1960 if((*classDataList).count)
1962 char classDataStructName[1024];
1963 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1964 struct External * external;
1966 strcpy(classDataStructName, "__ecereClassData_");
1967 FullClassNameCat(classDataStructName, symbol->string, 0x0);
1969 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1970 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1971 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1973 symbol->classData = 0x1;
1976 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1981 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
1983 strcpy(className, "__ecereClass_");
1984 FullClassNameCat(className, symbol->string, 0x1);
1985 MangleClassName(className);
1986 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
1987 if(!strstr(sourceFile, ".main.ec"))
1988 ListAdd(specs, MkSpecifier(STATIC));
1989 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
1990 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
1991 symbol->methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
1992 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->methodExternal);
1993 after = symbol->methodExternal;
1995 if(symbol->needDestructor)
1997 struct ClassFunction * function;
1998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1999 struct Declarator * decl;
2000 struct Statement * body;
2001 struct Context * context;
2002 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2004 strcpy(destructorName, "__ecereDestructor_");
2005 FullClassNameCat(destructorName, symbol->string, 0x0);
2006 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2007 ListAdd(specs, MkSpecifier(VOID));
2008 context = PushContext();
2009 statements = MkList();
2010 if(definitions != (((void *)0)))
2012 for(def = definitions->first; def; def = def->next)
2014 if(def->type == 2 && def->decl && def->decl->type == 2)
2016 struct Instantiation * inst = def->decl->inst;
2017 struct Symbol * classSym = inst->_class->symbol;
2019 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2021 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2023 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2025 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 5))
2027 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2029 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2034 if(destructor && destructor->body)
2036 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2037 destructor->body->compound.context->parent = context;
2038 destructor->body = (((void *)0));
2040 body = MkCompoundStmt(declarations, statements);
2041 PopContext(context);
2042 body->compound.context = context;
2043 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2044 decl->symbol = __extension__ ({
2045 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2047 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2050 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2051 ProcessClassFunctionBody(function, body);
2052 function->id = symbol->id;
2053 function->idCode = symbol->idCode;
2054 function->dontMangle = 0x1;
2055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2057 if(symbol->needConstructor && inCompiler)
2059 struct ClassFunction * function;
2060 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2061 struct Declarator * decl;
2062 struct Statement * body;
2063 struct Context * context;
2064 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2066 strcpy(constructorName, "__ecereConstructor_");
2067 FullClassNameCat(constructorName, symbol->string, 0x0);
2068 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2069 ListAdd(specs, MkSpecifierName("bool"));
2070 context = PushContext();
2071 statements = MkList();
2072 if(definitions != (((void *)0)))
2074 for(def = definitions->first; def; def = def->next)
2076 if(def->type == 2 && def->decl && def->decl->type == 2)
2078 struct Instantiation * inst = def->decl->inst;
2079 struct Symbol * classSym = inst->_class->symbol;
2081 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2083 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2086 newInst->members = (((void *)0));
2087 newInst->exp = CopyExpression(inst->exp);
2088 newInst->_class = CopySpecifier(inst->_class);
2089 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2092 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2094 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2098 for(def = definitions->first; def; def = def->next)
2100 if(def->type == 1 && def->defProperties)
2102 struct MemberInit * propertyDef;
2104 for(propertyDef = (*def->defProperties).first; propertyDef; propertyDef = propertyDef->next)
2106 struct Expression * memberExp;
2107 struct Identifier * id = (*propertyDef->identifiers).first;
2111 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2112 for(id = id->next; id; id = id->next)
2113 memberExp = MkExpMember(memberExp, id);
2114 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->exp : (((void *)0)))))));
2116 if(propertyDef->initializer)
2118 if(propertyDef->initializer->type == 0)
2119 propertyDef->initializer->exp = (((void *)0));
2120 FreeInitializer(propertyDef->initializer);
2122 propertyDef->initializer = (((void *)0));
2123 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2127 for(def = definitions->first; def; def = def->next)
2129 if(def->type == 2 && def->decl && def->decl->type == 2)
2131 struct Instantiation * inst = def->decl->inst;
2132 struct Symbol * classSym = inst->_class->symbol;
2134 if(inst->exp || (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2136 if(!(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5)) || (inst->members && (*inst->members).count))
2138 def->decl->inst = (((void *)0));
2139 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2145 if(constructor && constructor->body)
2147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2148 constructor->body->compound.context->parent = context;
2149 constructor->body = (((void *)0));
2151 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2152 body = MkCompoundStmt(declarations, statements);
2153 PopContext(context);
2154 body->compound.context = context;
2155 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2156 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2157 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2158 decl->symbol->id = symbol->id;
2159 decl->symbol->idCode = symbol->idCode;
2160 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2161 ProcessClassFunctionBody(function, body);
2162 function->id = symbol->id;
2163 function->idCode = symbol->idCode;
2164 function->dontMangle = 0x1;
2165 if(definitions != (((void *)0)))
2166 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2169 if(definitions != (((void *)0)))
2171 for(def = definitions->first; def; def = def->next)
2173 if(def->type == 3 && def->propertyDef)
2175 struct PropertyDef * propertyDef = def->propertyDef;
2176 struct ClassDef * after = def;
2177 struct ClassDef * newDef;
2181 yylloc = propertyDef->loc;
2182 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2183 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2184 else if(!symbol->isStatic)
2185 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2189 struct ClassFunction * func;
2190 struct Declarator * decl;
2192 struct __ecereNameSpace__ecere__sys__OldList * params;
2194 if(propertyDef->getStmt && propertyDef->id)
2196 strcpy(name, "__ecereProp_");
2197 FullClassNameCat(name, symbol->string, 0x0);
2198 strcat(name, "_Get_");
2199 FullClassNameCat(name, propertyDef->id->string, 0x1);
2200 MangleClassName(name);
2202 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)
2204 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2205 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2206 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2210 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2211 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2213 ProcessClassFunctionBody(func, propertyDef->getStmt);
2214 func->declarator->symbol = propertyDef->symbol;
2215 propertyDef->symbol->externalGet = (struct External *)func;
2216 func->dontMangle = 0x1;
2217 newDef = MkClassDefFunction(func);
2218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2221 propertyDef->getStmt = (((void *)0));
2223 func->body = (((void *)0));
2225 if(propertyDef->setStmt && propertyDef->id)
2227 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2229 strcpy(name, "__ecereProp_");
2230 FullClassNameCat(name, symbol->string, 0x0);
2231 strcat(name, "_Set_");
2232 FullClassNameCat(name, propertyDef->id->string, 0x1);
2233 MangleClassName(name);
2235 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2236 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2237 if(!propertyDef->symbol->_property || !propertyDef->symbol->_property->conversion)
2238 ListAdd(specifiers, MkSpecifier(VOID));
2241 if(regClass->type == 1)
2242 ListAdd(specifiers, MkSpecifier(VOID));
2244 ListAdd(specifiers, MkSpecifierName(regClass->fullName));
2246 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2247 ProcessClassFunctionBody(func, propertyDef->setStmt);
2248 func->dontMangle = 0x1;
2249 func->declarator->symbol = propertyDef->symbol;
2250 propertyDef->symbol->externalSet = (struct External *)func;
2251 if(!propertyDef->conversion && regClass->type == 0)
2252 func->propSet = propertyDef->symbol;
2253 newDef = MkClassDefFunction(func);
2254 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2257 propertyDef->setStmt = (((void *)0));
2259 func->body = (((void *)0));
2261 if(propertyDef->issetStmt && propertyDef->id)
2263 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2265 strcpy(name, "__ecereProp_");
2266 FullClassNameCat(name, symbol->string, 0x0);
2267 strcat(name, "_IsSet_");
2268 FullClassNameCat(name, propertyDef->id->string, 0x1);
2269 MangleClassName(name);
2271 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2272 ListAdd(specifiers, MkSpecifierName("bool"));
2273 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2274 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2275 func->dontMangle = 0x1;
2276 func->declarator->symbol = propertyDef->symbol;
2277 propertyDef->symbol->externalIsSet = (struct External *)func;
2278 newDef = MkClassDefFunction(func);
2279 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2282 propertyDef->issetStmt = (((void *)0));
2284 func->body = (((void *)0));
2286 if(propertyDef->id && inCompiler)
2288 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->registered, propertyDef->id->string, privateModule);
2289 struct Declaration * decl;
2290 struct External * external;
2291 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2294 ListAdd(specifiers, MkSpecifierName("Property"));
2295 strcpy(name, "__ecereProp_");
2296 FullClassNameCat(name, symbol->string, 0x0);
2298 FullClassNameCat(name, propertyDef->id->string, 0x1);
2299 MangleClassName(name);
2301 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2303 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2304 strcpy(name, "__ecerePropM_");
2305 FullClassNameCat(name, symbol->string, 0x0);
2307 FullClassNameCat(name, propertyDef->id->string, 0x1);
2308 MangleClassName(name);
2309 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2310 decl = MkDeclaration(specifiers, list);
2312 external = MkExternalDeclaration(decl);
2313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2314 external->symbol = propertyDef->symbol;
2315 propertyDef->symbol->externalPtr = external;
2316 if(inCompiler && prop && prop->symbol)
2317 ((struct Symbol *)prop->symbol)->externalPtr = external;
2322 else if(def->type == 10 && def->propertyDef)
2324 struct PropertyDef * propertyDef = def->propertyDef;
2325 struct ClassDef * after = def;
2326 struct ClassDef * newDef;
2331 yylloc = propertyDef->loc;
2332 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2333 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2334 else if(!symbol->isStatic)
2335 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2338 struct ClassFunction * func;
2339 struct Declarator * decl;
2341 struct __ecereNameSpace__ecere__sys__OldList * params;
2343 if(propertyDef->getStmt && propertyDef->id)
2345 struct Declarator * declId;
2347 sprintf(name, "class::__ecereClassProp_");
2348 FullClassNameCat(name, symbol->string, 0x0);
2349 strcat(name, "_Get_");
2350 strcat(name, propertyDef->id->string);
2351 MangleClassName(name);
2353 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2355 decl = MkDeclaratorFunction(declId, params);
2356 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2358 ProcessClassFunctionBody(func, propertyDef->getStmt);
2359 func->declarator->symbol = propertyDef->symbol;
2360 propertyDef->symbol->externalGet = (struct External *)func;
2361 func->dontMangle = 0x1;
2362 newDef = MkClassDefFunction(func);
2363 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2365 func->type = ProcessType(propertyDef->specifiers, MkDeclaratorFunction(propertyDef->declarator, (((void *)0))));
2366 if(func->type->returnType->kind == 8 && func->type->returnType->_class && func->type->returnType->_class->registered && func->type->returnType->_class->registered->type == 1)
2367 func->type->returnType->byReference = 0x1;
2369 propertyDef->getStmt = (((void *)0));
2371 func->body = (((void *)0));
2373 if(propertyDef->setStmt && propertyDef->id)
2375 struct Context * prevCurContext;
2376 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2377 struct Statement * body = propertyDef->setStmt;
2378 struct Declarator * ptrDecl;
2380 strcpy(name, "class::__ecereClassProp_");
2381 FullClassNameCat(name, symbol->string, 0x0);
2382 strcat(name, "_Set_");
2383 strcat(name, propertyDef->id->string);
2384 MangleClassName(name);
2386 prevCurContext = curContext;
2387 curContext = body->compound.context;
2388 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2389 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2390 if(!body->compound.declarations)
2391 body->compound.declarations = MkList();
2392 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)
2393 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2395 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2396 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"))))))));
2397 curContext = prevCurContext;
2399 struct Symbol * sym = ptrDecl->symbol;
2402 FreeType(sym->type);
2403 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2405 ListAdd(specifiers, MkSpecifier(VOID));
2406 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2407 ProcessClassFunctionBody(func, propertyDef->setStmt);
2408 func->dontMangle = 0x1;
2409 func->declarator->symbol = propertyDef->symbol;
2410 propertyDef->symbol->externalSet = (struct External *)func;
2411 newDef = MkClassDefFunction(func);
2412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2415 propertyDef->setStmt = (((void *)0));
2417 func->body = (((void *)0));
2422 else if(def->type == 0 && def->function->declarator)
2424 struct ClassFunction * func = def->function;
2426 func->_class = regClass;
2427 if(!func->dontMangle)
2429 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2430 struct Identifier * id = GetDeclId(funcDecl);
2431 struct __ecereNameSpace__ecere__com__Method * method;
2433 if(!funcDecl->function.parameters || !(*funcDecl->function.parameters).first)
2435 if(!funcDecl->function.parameters)
2436 funcDecl->function.parameters = MkList();
2437 ListAdd(funcDecl->function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2439 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2440 FreeSpecifier(id->_class);
2441 id->_class = (((void *)0));
2442 if(inCompiler && method)
2444 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2447 ProcessMethodType(method);
2449 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2450 CheckPublicDataType(method->dataType, 1, "class method");
2451 strcpy(newId, "__ecereMethod_");
2452 FullClassNameCat(newId, symbol->string, 0x0);
2454 strcat(newId, id->string);
2455 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2457 if(method->type != 1)
2461 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2462 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2470 if(initDeclarators != (((void *)0)))
2471 FreeList(initDeclarators, FreeInitDeclarator);
2474 void PreProcessClassDefinitions()
2476 struct External * external, * next;
2478 curExternal = (((void *)0));
2481 for(external = (*ast).first; external; external = next)
2483 next = external->next;
2484 curExternal = external;
2485 if(external->type == 2)
2487 struct ClassDefinition * _class = external->_class;
2489 if(_class->definitions)
2491 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2494 else if(external->type == 1)
2496 struct Declaration * declaration = external->declaration;
2498 if(declaration->type == 1)
2500 if(declaration->specifiers)
2502 struct Specifier * specifier;
2504 for(specifier = (*declaration->specifiers).first; specifier; specifier = specifier->next)
2506 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->id && specifier->id->string && (declaration->declMode || specifier->baseSpecs || (specifier->type == 2 && specifier->definitions)))
2508 struct Symbol * symbol = FindClass(specifier->id->string);
2512 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2513 struct ExtDecl * extDecl = specifier->extDeclStruct;
2515 specifier->extDeclStruct = (((void *)0));
2518 initDeclarators = declaration->declarators;
2519 declaration->declarators = (((void *)0));
2521 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->definitions, symbol, specifier->baseSpecs, specifier->list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2527 else if(inCompiler && declaration->type == 3)
2529 yylloc = declaration->loc;
2530 if(declaration->declMode == 1)
2531 CheckPublicExpression(declaration->exp, 1);
2532 else if(declaration->declMode != 3)
2533 CheckPublicExpression(declaration->exp, 2);
2536 else if(external->type == 3)
2539 else if(inCompiler && external->type == 0)
2541 yylloc = external->function->loc;
2542 if(!external->function->type)
2543 external->function->type = ProcessType(external->function->specifiers, external->function->declarator);
2544 if(external->function->declMode == 1)
2545 CheckPublicDataType(external->function->type, 1, "function");
2546 else if(external->function->declMode != 3)
2547 CheckPublicDataType(external->function->type, 2, "function");
2553 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2555 struct __ecereNameSpace__ecere__com__GlobalFunction;
2557 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);
2559 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2561 struct __ecereNameSpace__ecere__com__Class * class;
2563 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MangleClassName", "void MangleClassName(char * className)", MangleClassName, module, 1);
2564 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2565 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2568 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)