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 void __ecereNameSpace__ecere__com__eSystem_Delete(void * memory);
54 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
56 struct __ecereNameSpace__ecere__sys__BTNode;
58 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
60 struct __ecereNameSpace__ecere__sys__BinaryTree
62 struct __ecereNameSpace__ecere__sys__BTNode * root;
64 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
65 void (* FreeKey)(void * key);
66 } __attribute__ ((gcc_struct));
68 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
70 struct __ecereNameSpace__ecere__sys__OldList
77 } __attribute__ ((gcc_struct));
79 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
81 struct __ecereNameSpace__ecere__com__Method
84 struct __ecereNameSpace__ecere__com__Method * parent;
85 struct __ecereNameSpace__ecere__com__Method * left;
86 struct __ecereNameSpace__ecere__com__Method * right;
91 struct __ecereNameSpace__ecere__com__Class * _class;
93 char * dataTypeString;
94 struct Type * dataType;
96 } __attribute__ ((gcc_struct));
98 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
100 struct __ecereNameSpace__ecere__com__Property
102 struct __ecereNameSpace__ecere__com__Property * prev;
103 struct __ecereNameSpace__ecere__com__Property * next;
105 unsigned int isProperty;
108 struct __ecereNameSpace__ecere__com__Class * _class;
109 char * dataTypeString;
110 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
111 struct Type * dataType;
112 void (* Set)(void * , int);
113 int (* Get)(void * );
114 unsigned int (* IsSet)(void * );
118 unsigned int conversion;
119 unsigned int watcherOffset;
121 unsigned int compiled;
122 unsigned int selfWatchable;
123 unsigned int isWatchable;
124 } __attribute__ ((gcc_struct));
126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
134 } __attribute__ ((gcc_struct));
136 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
140 struct CodePosition start;
141 struct CodePosition end;
142 } __attribute__ ((gcc_struct));
144 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
148 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
152 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
154 struct ClassDefinition
156 struct ClassDefinition * prev;
157 struct ClassDefinition * next;
159 struct Specifier * _class;
160 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
161 struct __ecereNameSpace__ecere__sys__OldList * definitions;
162 struct Symbol * symbol;
163 struct Location blockStart;
164 struct Location nameLoc;
167 unsigned int deleteWatchable;
168 } __attribute__ ((gcc_struct));
170 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
174 struct Context * parent;
175 struct __ecereNameSpace__ecere__sys__BinaryTree types;
176 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
177 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
178 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
181 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
182 struct ClassDefinition * classDef;
183 unsigned int templateTypesOnly;
184 unsigned int hasNameSpace;
185 } __attribute__ ((gcc_struct));
187 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
191 struct Instantiation * prev;
192 struct Instantiation * next;
194 struct Specifier * _class;
195 struct Expression * exp;
196 struct __ecereNameSpace__ecere__sys__OldList * members;
197 struct Symbol * symbol;
198 unsigned int fullSet;
199 unsigned int isConstant;
200 unsigned char * data;
201 struct Location nameLoc;
202 struct Location insideLoc;
204 } __attribute__ ((gcc_struct));
206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
210 struct Declaration * prev;
211 struct Declaration * next;
218 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
219 struct __ecereNameSpace__ecere__sys__OldList * declarators;
220 } __attribute__ ((gcc_struct));
221 struct Instantiation * inst;
224 struct Identifier * id;
225 struct Expression * exp;
226 } __attribute__ ((gcc_struct));
227 } __attribute__ ((gcc_struct));
228 struct Specifier * extStorage;
229 struct Symbol * symbol;
231 } __attribute__ ((gcc_struct));
233 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
237 struct Statement * prev;
238 struct Statement * next;
243 struct __ecereNameSpace__ecere__sys__OldList * expressions;
246 struct Identifier * id;
247 struct Statement * stmt;
248 } __attribute__ ((gcc_struct)) labeled;
251 struct Expression * exp;
252 struct Statement * stmt;
253 } __attribute__ ((gcc_struct)) caseStmt;
256 struct __ecereNameSpace__ecere__sys__OldList * declarations;
257 struct __ecereNameSpace__ecere__sys__OldList * statements;
258 struct Context * context;
259 unsigned int isSwitch;
260 } __attribute__ ((gcc_struct)) compound;
263 struct __ecereNameSpace__ecere__sys__OldList * exp;
264 struct Statement * stmt;
265 struct Statement * elseStmt;
266 } __attribute__ ((gcc_struct)) ifStmt;
269 struct __ecereNameSpace__ecere__sys__OldList * exp;
270 struct Statement * stmt;
271 } __attribute__ ((gcc_struct)) switchStmt;
274 struct __ecereNameSpace__ecere__sys__OldList * exp;
275 struct Statement * stmt;
276 } __attribute__ ((gcc_struct)) whileStmt;
279 struct __ecereNameSpace__ecere__sys__OldList * exp;
280 struct Statement * stmt;
281 } __attribute__ ((gcc_struct)) doWhile;
284 struct Statement * init;
285 struct Statement * check;
286 struct __ecereNameSpace__ecere__sys__OldList * increment;
287 struct Statement * stmt;
288 } __attribute__ ((gcc_struct)) forStmt;
291 struct Identifier * id;
292 } __attribute__ ((gcc_struct)) gotoStmt;
295 struct Specifier * spec;
297 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
298 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
299 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
300 } __attribute__ ((gcc_struct)) asmStmt;
303 struct Expression * watcher;
304 struct Expression * object;
305 struct __ecereNameSpace__ecere__sys__OldList * watches;
306 } __attribute__ ((gcc_struct)) _watch;
309 struct Identifier * id;
310 struct __ecereNameSpace__ecere__sys__OldList * exp;
311 struct __ecereNameSpace__ecere__sys__OldList * filter;
312 struct Statement * stmt;
313 } __attribute__ ((gcc_struct)) forEachStmt;
314 struct Declaration * decl;
315 } __attribute__ ((gcc_struct));
316 } __attribute__ ((gcc_struct));
318 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
322 struct TypeName * prev;
323 struct TypeName * next;
325 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
326 struct Declarator * declarator;
328 struct Expression * bitCount;
329 } __attribute__ ((gcc_struct));
331 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
335 struct Initializer * prev;
336 struct Initializer * next;
341 struct Expression * exp;
342 struct __ecereNameSpace__ecere__sys__OldList * list;
343 } __attribute__ ((gcc_struct));
344 unsigned int isConstant;
345 } __attribute__ ((gcc_struct));
347 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
349 struct __ecereNameSpace__ecere__com__DataValue
364 } __attribute__ ((gcc_struct));
365 } __attribute__ ((gcc_struct));
367 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
371 struct Expression * prev;
372 struct Expression * next;
380 struct Identifier * identifier;
381 } __attribute__ ((gcc_struct));
382 struct Statement * compound;
383 struct Instantiation * instance;
387 unsigned int intlString;
388 } __attribute__ ((gcc_struct));
389 struct __ecereNameSpace__ecere__sys__OldList * list;
392 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
393 struct Declarator * decl;
394 } __attribute__ ((gcc_struct)) _classExp;
397 struct Identifier * id;
398 } __attribute__ ((gcc_struct)) classData;
401 struct Expression * exp;
402 struct __ecereNameSpace__ecere__sys__OldList * arguments;
403 struct Location argLoc;
404 } __attribute__ ((gcc_struct)) call;
407 struct Expression * exp;
408 struct __ecereNameSpace__ecere__sys__OldList * index;
409 } __attribute__ ((gcc_struct)) index;
412 struct Expression * exp;
413 struct Identifier * member;
415 unsigned int thisPtr;
416 } __attribute__ ((gcc_struct)) member;
420 struct Expression * exp1;
421 struct Expression * exp2;
422 } __attribute__ ((gcc_struct)) op;
423 struct TypeName * typeName;
424 struct Specifier * _class;
427 struct TypeName * typeName;
428 struct Expression * exp;
429 } __attribute__ ((gcc_struct)) cast;
432 struct Expression * cond;
433 struct __ecereNameSpace__ecere__sys__OldList * exp;
434 struct Expression * elseExp;
435 } __attribute__ ((gcc_struct)) cond;
438 struct TypeName * typeName;
439 struct Expression * size;
440 } __attribute__ ((gcc_struct)) _new;
443 struct TypeName * typeName;
444 struct Expression * size;
445 struct Expression * exp;
446 } __attribute__ ((gcc_struct)) _renew;
450 struct Identifier * id;
451 } __attribute__ ((gcc_struct)) db;
454 struct Expression * ds;
455 struct Expression * name;
456 } __attribute__ ((gcc_struct)) dbopen;
459 struct TypeName * typeName;
460 struct Initializer * initializer;
461 } __attribute__ ((gcc_struct)) initializer;
464 struct Expression * exp;
465 struct TypeName * typeName;
466 } __attribute__ ((gcc_struct)) vaArg;
467 } __attribute__ ((gcc_struct));
468 unsigned int debugValue;
469 struct __ecereNameSpace__ecere__com__DataValue val;
471 unsigned int hasAddress;
472 struct Type * expType;
473 struct Type * destType;
476 unsigned int byReference;
477 unsigned int isConstant;
478 unsigned int addedThis;
479 unsigned int needCast;
480 unsigned int thisPtr;
481 unsigned int opDestType;
482 } __attribute__ ((gcc_struct));
484 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
486 struct TemplateDatatype;
488 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
490 struct TemplateArgument;
492 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
494 struct TemplateParameter;
496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
500 struct Specifier * prev;
501 struct Specifier * next;
509 struct ExtDecl * extDecl;
511 struct Symbol * symbol;
512 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
513 } __attribute__ ((gcc_struct));
516 struct Identifier * id;
517 struct __ecereNameSpace__ecere__sys__OldList * list;
518 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
519 struct __ecereNameSpace__ecere__sys__OldList * definitions;
520 unsigned int addNameSpace;
521 struct Context * ctx;
522 struct ExtDecl * extDeclStruct;
523 } __attribute__ ((gcc_struct));
524 struct Expression * expression;
525 struct Specifier * _class;
526 struct TemplateParameter * templateParameter;
527 } __attribute__ ((gcc_struct));
528 } __attribute__ ((gcc_struct));
530 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
534 struct Identifier * prev;
535 struct Identifier * next;
537 struct Symbol * classSym;
538 struct Specifier * _class;
540 struct Identifier * badID;
541 } __attribute__ ((gcc_struct));
543 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
547 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
551 struct Declarator * prev;
552 struct Declarator * next;
555 struct Symbol * symbol;
556 struct Declarator * declarator;
559 struct Identifier * identifier;
562 struct Expression * exp;
563 struct Expression * posExp;
564 struct Attrib * attrib;
565 } __attribute__ ((gcc_struct)) structDecl;
568 struct Expression * exp;
569 struct Specifier * enumClass;
570 } __attribute__ ((gcc_struct)) array;
573 struct __ecereNameSpace__ecere__sys__OldList * parameters;
574 } __attribute__ ((gcc_struct)) function;
577 struct Pointer * pointer;
578 } __attribute__ ((gcc_struct)) pointer;
581 struct ExtDecl * extended;
582 } __attribute__ ((gcc_struct)) extended;
583 } __attribute__ ((gcc_struct));
584 } __attribute__ ((gcc_struct));
586 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
588 struct FunctionDefinition
590 struct FunctionDefinition * prev;
591 struct FunctionDefinition * next;
593 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
594 struct Declarator * declarator;
595 struct __ecereNameSpace__ecere__sys__OldList * declarations;
596 struct Statement * body;
597 struct __ecereNameSpace__ecere__com__Class * _class;
598 struct __ecereNameSpace__ecere__sys__OldList attached;
601 struct Symbol * propSet;
603 unsigned int propertyNoThis;
604 } __attribute__ ((gcc_struct));
606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
610 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
614 struct External * prev;
615 struct External * next;
618 struct Symbol * symbol;
621 struct FunctionDefinition * function;
622 struct ClassDefinition * _class;
623 struct Declaration * declaration;
625 struct Identifier * id;
626 struct DBTableDef * table;
627 } __attribute__ ((gcc_struct));
629 } __attribute__ ((gcc_struct));
631 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
635 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
639 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
644 struct Symbol * parent;
645 struct Symbol * left;
646 struct Symbol * right;
651 struct __ecereNameSpace__ecere__com__Method * method;
652 struct __ecereNameSpace__ecere__com__Property * _property;
653 struct __ecereNameSpace__ecere__com__Class * registered;
654 } __attribute__ ((gcc_struct));
661 struct External * pointerExternal;
662 struct External * structExternal;
663 } __attribute__ ((gcc_struct));
666 struct External * externalGet;
667 struct External * externalSet;
668 struct External * externalPtr;
669 struct External * externalIsSet;
670 } __attribute__ ((gcc_struct));
673 struct External * methodExternal;
674 struct External * methodCodeExternal;
675 } __attribute__ ((gcc_struct));
676 } __attribute__ ((gcc_struct));
677 unsigned int imported;
678 unsigned int declaredStructSym;
679 struct __ecereNameSpace__ecere__com__Class * _class;
680 unsigned int declaredStruct;
681 unsigned int needConstructor;
682 unsigned int needDestructor;
683 char * constructorName;
686 char * destructorName;
687 struct ModuleImport * module;
688 struct ClassImport * _import;
689 struct Location nameLoc;
690 unsigned int isParam;
691 unsigned int isRemote;
692 unsigned int isStruct;
693 unsigned int fireWatchersDone;
695 unsigned int classData;
696 unsigned int isStatic;
698 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
699 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
700 struct Context * ctx;
702 struct Expression * propCategory;
703 } __attribute__ ((gcc_struct));
705 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
714 struct Symbol * _class;
717 struct __ecereNameSpace__ecere__sys__OldList members;
719 } __attribute__ ((gcc_struct));
722 struct Type * returnType;
723 struct __ecereNameSpace__ecere__sys__OldList params;
724 struct Symbol * thisClass;
725 unsigned int staticMethod;
726 struct TemplateParameter * thisClassTemplate;
727 } __attribute__ ((gcc_struct));
730 struct __ecereNameSpace__ecere__com__Method * method;
731 struct __ecereNameSpace__ecere__com__Class * methodClass;
732 struct __ecereNameSpace__ecere__com__Class * usedClass;
733 } __attribute__ ((gcc_struct));
736 struct Type * arrayType;
738 struct Expression * arraySizeExp;
739 unsigned int freeExp;
740 struct Symbol * enumClass;
741 } __attribute__ ((gcc_struct));
743 struct TemplateParameter * templateParameter;
744 } __attribute__ ((gcc_struct));
754 unsigned int isSigned : 1;
755 unsigned int constant : 1;
756 unsigned int truth : 1;
757 unsigned int byReference : 1;
758 unsigned int extraParam : 1;
759 unsigned int directClassAccess : 1;
760 unsigned int computing : 1;
761 unsigned int keepCast : 1;
762 unsigned int passAsTemplate : 1;
763 unsigned int dllExport : 1;
764 unsigned int attrStdcall : 1;
765 unsigned int declaredWithStruct : 1;
766 unsigned int typedByReference : 1;
767 } __attribute__ ((gcc_struct));
769 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
771 struct __ecereNameSpace__ecere__com__Class
773 struct __ecereNameSpace__ecere__com__Class * prev;
774 struct __ecereNameSpace__ecere__com__Class * next;
780 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
781 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
784 struct __ecereNameSpace__ecere__com__Class * base;
785 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
786 struct __ecereNameSpace__ecere__sys__BinaryTree members;
787 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
788 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
789 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
790 struct __ecereNameSpace__ecere__sys__OldList derivatives;
794 struct __ecereNameSpace__ecere__com__Instance * module;
795 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
796 char * dataTypeString;
797 struct Type * dataType;
799 int defaultAlignment;
800 void (* Initialize)();
802 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
803 char * designerClass;
804 unsigned int noExpansion;
805 char * defaultProperty;
806 unsigned int comRedefinition;
809 unsigned int internalDecl;
811 unsigned int computeSize;
813 int destructionWatchOffset;
815 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
816 int inheritanceAccess;
819 struct __ecereNameSpace__ecere__sys__OldList conversions;
820 struct __ecereNameSpace__ecere__sys__OldList templateParams;
821 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
822 struct __ecereNameSpace__ecere__com__Class * templateClass;
823 struct __ecereNameSpace__ecere__sys__OldList templatized;
825 unsigned int isInstanceClass;
826 unsigned int byValueSystemClass;
827 } __attribute__ ((gcc_struct));
829 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
831 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
833 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
835 struct __ecereNameSpace__ecere__com__Instance
838 struct __ecereNameSpace__ecere__com__Class * _class;
840 } __attribute__ ((gcc_struct));
842 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
844 struct __ecereNameSpace__ecere__com__DataMember
846 struct __ecereNameSpace__ecere__com__DataMember * prev;
847 struct __ecereNameSpace__ecere__com__DataMember * next;
849 unsigned int isProperty;
852 struct __ecereNameSpace__ecere__com__Class * _class;
853 char * dataTypeString;
854 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
855 struct Type * dataType;
859 struct __ecereNameSpace__ecere__sys__OldList members;
860 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
863 } __attribute__ ((gcc_struct));
865 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
867 struct __ecereNameSpace__ecere__com__SerialBuffer
869 unsigned char * _buffer;
873 } __attribute__ ((gcc_struct));
875 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
877 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
883 char * dataTypeString;
884 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
885 } __attribute__ ((gcc_struct));
886 struct __ecereNameSpace__ecere__com__DataValue expression;
892 struct __ecereNameSpace__ecere__com__DataMember * member;
893 struct __ecereNameSpace__ecere__com__Property * prop;
894 struct __ecereNameSpace__ecere__com__Method * method;
895 } __attribute__ ((gcc_struct));
896 } __attribute__ ((gcc_struct));
897 } __attribute__ ((gcc_struct));
898 } __attribute__ ((gcc_struct));
902 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
905 typedef union YYSTYPE
910 struct Identifier * id;
911 struct Expression * exp;
912 struct Specifier * specifier;
913 struct __ecereNameSpace__ecere__sys__OldList * list;
914 struct Enumerator * enumerator;
915 struct Declarator * declarator;
916 struct Pointer * pointer;
917 struct Initializer * initializer;
918 struct InitDeclarator * initDeclarator;
919 struct TypeName * typeName;
920 struct Declaration * declaration;
921 struct Statement * stmt;
922 struct FunctionDefinition * function;
923 struct External * external;
924 struct Context * context;
925 struct AsmField * asmField;
926 struct Attrib * attrib;
927 struct ExtDecl * extDecl;
928 struct Attribute * attribute;
929 struct Instantiation * instance;
930 struct MembersInit * membersInit;
931 struct MemberInit * memberInit;
932 struct ClassFunction * classFunction;
933 struct ClassDefinition * _class;
934 struct ClassDef * classDef;
935 struct PropertyDef * prop;
937 struct Symbol * symbol;
938 struct PropertyWatch * propertyWatch;
939 struct TemplateParameter * templateParameter;
940 struct TemplateArgument * templateArgument;
941 struct TemplateDatatype * templateDatatype;
942 struct DBTableEntry * dbtableEntry;
943 struct DBIndexItem * dbindexItem;
944 struct DBTableDef * dbtableDef;
945 } __attribute__ ((gcc_struct)) YYSTYPE;
947 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
951 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
953 struct InitDeclarator;
955 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
959 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
963 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
967 struct ClassFunction * prev;
968 struct ClassFunction * next;
970 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
971 struct Declarator * declarator;
972 struct __ecereNameSpace__ecere__sys__OldList * declarations;
973 struct Statement * body;
974 struct __ecereNameSpace__ecere__com__Class * _class;
975 struct __ecereNameSpace__ecere__sys__OldList attached;
978 struct Symbol * propSet;
979 unsigned int isVirtual;
980 unsigned int isConstructor;
981 unsigned int isDestructor;
982 unsigned int dontMangle;
985 } __attribute__ ((gcc_struct));
987 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
991 struct MembersInit * prev;
992 struct MembersInit * next;
997 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
998 struct ClassFunction * function;
999 } __attribute__ ((gcc_struct));
1000 } __attribute__ ((gcc_struct));
1002 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1006 struct MemberInit * prev;
1007 struct MemberInit * next;
1008 struct Location loc;
1009 struct Location realLoc;
1010 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1011 struct Initializer * initializer;
1013 unsigned int variable;
1014 unsigned int takeOutExp;
1015 } __attribute__ ((gcc_struct));
1017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1021 struct PropertyDef * prev;
1022 struct PropertyDef * next;
1023 struct Location loc;
1024 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1025 struct Declarator * declarator;
1026 struct Identifier * id;
1027 struct Statement * getStmt;
1028 struct Statement * setStmt;
1029 struct Statement * issetStmt;
1030 struct Symbol * symbol;
1031 struct Expression * category;
1034 unsigned int conversion : 1;
1035 unsigned int isWatchable : 1;
1036 unsigned int isDBProp : 1;
1037 } __attribute__ ((gcc_struct));
1038 } __attribute__ ((gcc_struct));
1040 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1042 struct PropertyWatch;
1044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1048 struct ClassDef * prev;
1049 struct ClassDef * next;
1050 struct Location loc;
1054 struct Declaration * decl;
1055 struct ClassFunction * function;
1056 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1057 struct PropertyDef * propertyDef;
1058 struct PropertyWatch * propertyWatch;
1060 struct Identifier * defaultProperty;
1063 struct Identifier * id;
1064 struct Initializer * initializer;
1065 } __attribute__ ((gcc_struct));
1066 } __attribute__ ((gcc_struct));
1069 } __attribute__ ((gcc_struct));
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1073 struct DBTableEntry;
1075 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1079 extern YYSTYPE yylval;
1081 extern struct Location yylloc;
1083 extern struct External * curExternal;
1085 void MangleClassName(char * className)
1091 for(c = 0; (ch = className[c]); c++)
1130 output[d] = (char)0;
1133 extern char * strcat(char * , const char * );
1135 extern size_t strlen(const char * );
1137 void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams)
1143 for(c = 0; (ch = className[c]) && ch != '<'; c++)
1147 strcat(output, "__ecereNameSpace__");
1151 len = strlen(output);
1152 for(c = 0; (ch = className[c]); c++)
1155 output[len++] = '_';
1157 output[len++] = '_';
1160 output[len++] = '_';
1161 output[len++] = 'P';
1162 output[len++] = 'T';
1163 output[len++] = 'R';
1164 output[len++] = '_';
1168 output[len++] = '_';
1169 output[len++] = 'E';
1170 output[len++] = 'Q';
1171 output[len++] = 'U';
1172 output[len++] = '_';
1176 if(!includeTemplateParams)
1178 output[len++] = '_';
1179 output[len++] = 'T';
1180 output[len++] = 'P';
1181 output[len++] = 'L';
1182 output[len++] = '_';
1186 output[len++] = '_';
1190 output[len++] = '__';
1195 output[len++] = (char)0;
1198 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);
1200 static void AddSimpleBaseMembers(struct __ecereNameSpace__ecere__sys__OldList * list, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * topClass)
1202 if(_class->type != 1000)
1203 AddMembers(list, _class, 0x0, (((void *)0)), topClass, (((void *)0)));
1206 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
1208 struct __ecereNameSpace__ecere__com__NameSpace
1211 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
1212 struct __ecereNameSpace__ecere__com__NameSpace * left;
1213 struct __ecereNameSpace__ecere__com__NameSpace * right;
1215 struct __ecereNameSpace__ecere__com__NameSpace * parent;
1216 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
1217 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
1218 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
1219 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
1220 } __attribute__ ((gcc_struct));
1222 static unsigned int NameSpaceContained(struct __ecereNameSpace__ecere__com__NameSpace * ns, struct __ecereNameSpace__ecere__com__NameSpace * parent)
1226 else if((*ns).parent)
1227 return NameSpaceContained((*ns).parent, parent);
1232 extern void Compiler_Error(char * format, ...);
1234 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
1236 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
1238 struct __ecereNameSpace__ecere__com__Module
1240 struct __ecereNameSpace__ecere__com__Instance * application;
1241 struct __ecereNameSpace__ecere__sys__OldList classes;
1242 struct __ecereNameSpace__ecere__sys__OldList defines;
1243 struct __ecereNameSpace__ecere__sys__OldList functions;
1244 struct __ecereNameSpace__ecere__sys__OldList modules;
1245 struct __ecereNameSpace__ecere__com__Instance * prev;
1246 struct __ecereNameSpace__ecere__com__Instance * next;
1252 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
1253 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
1254 } __attribute__ ((gcc_struct));
1256 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
1258 struct __ecereNameSpace__ecere__com__Application
1263 unsigned int isGUIApp;
1264 struct __ecereNameSpace__ecere__sys__OldList allModules;
1265 char * parsedCommand;
1266 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
1267 } __attribute__ ((gcc_struct));
1269 extern unsigned int ModuleAccess(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor);
1271 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1273 static void CheckPublicClass(struct Symbol * classSym, int access, char * word)
1275 struct __ecereNameSpace__ecere__com__Class * regClass = classSym ? classSym->registered : (((void *)0));
1279 if(regClass->templateClass)
1280 regClass = regClass->templateClass;
1281 if(classSym->isStatic && access != 3)
1283 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Non-static %s making use of a static class\n", (((void *)0))), word);
1285 else if(access == 1)
1287 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->application + structSize_Module)))->systemNameSpace))
1289 if(NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) || !ModuleAccess(privateModule, regClass->module))
1290 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Public %s making use of a private class\n", (((void *)0))), word);
1296 static void CheckPublicTypeName(struct TypeName * type, int access)
1298 if(type->qualifiers)
1300 struct Specifier * spec;
1302 for(spec = (*type->qualifiers).first; spec; spec = spec->next)
1306 struct Symbol * classSym = spec->symbol;
1308 CheckPublicClass(classSym, access, "define");
1314 static void CheckPublicExpression(struct Expression * exp, int access);
1316 static void CheckPublicInitializer(struct Initializer * init, int access)
1321 CheckPublicExpression(init->exp, access);
1325 struct Initializer * i;
1327 for(i = (*init->list).first; i; i = i->next)
1328 CheckPublicInitializer(i, access);
1334 static void CheckPublicExpression(struct Expression * exp, int access)
1348 CheckPublicExpression(exp->op.exp1, access);
1350 CheckPublicExpression(exp->op.exp2, access);
1354 struct Expression * e;
1356 for(e = (*exp->list).first; e; e = e->next)
1357 CheckPublicExpression(e, access);
1362 struct Expression * e;
1364 CheckPublicExpression(exp->index.exp, access);
1365 for(e = (*exp->index.index).first; e; e = e->next)
1366 CheckPublicExpression(e, access);
1371 struct Expression * e;
1373 CheckPublicExpression(exp->call.exp, access);
1374 if(exp->call.arguments)
1376 for(e = (*exp->call.arguments).first; e; e = e->next)
1377 CheckPublicExpression(e, access);
1383 CheckPublicExpression(exp->member.exp, access);
1388 CheckPublicExpression(exp->member.exp, access);
1392 CheckPublicTypeName(exp->typeName, access);
1396 struct Type * type = exp->expType;
1398 CheckPublicTypeName(exp->cast.typeName, access);
1400 CheckPublicExpression(exp->cast.exp, access);
1405 struct Expression * e;
1407 CheckPublicExpression(exp->cond.cond, access);
1408 for(e = (*exp->cond.exp).first; e; e = e->next)
1409 CheckPublicExpression(e, access);
1410 CheckPublicExpression(exp->cond.elseExp, access);
1415 CheckPublicExpression(exp->_new.size, access);
1419 CheckPublicExpression(exp->_renew.size, access);
1420 CheckPublicExpression(exp->_renew.exp, access);
1424 struct MembersInit * members;
1426 CheckPublicClass(exp->instance->_class->symbol, access, "define");
1427 for(members = (*exp->instance->members).first; members; members = members->next)
1429 if(members->type == 0)
1431 struct MemberInit * member;
1433 for(member = (*members->dataMembers).first; member; member = member->next)
1435 CheckPublicInitializer(member->initializer, access);
1445 static void CheckPublicDataType(struct Type * type, int access, char * word)
1453 CheckPublicClass(type->_class, access, word);
1463 struct Type * param;
1465 CheckPublicDataType(type->returnType, access, word);
1466 for(param = type->params.first; param; param = param->next)
1467 CheckPublicDataType(param, access, word);
1468 CheckPublicClass(type->thisClass, access, word);
1472 CheckPublicDataType(type->arrayType, access, word);
1474 CheckPublicClass(type->enumClass, access, word);
1478 CheckPublicDataType(type->type, access, word);
1487 CheckPublicClass(type->_class, access, word);
1494 extern struct Identifier * GetDeclId(struct Declarator * decl);
1496 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
1498 struct __ecereNameSpace__ecere__com__BTNamedLink
1501 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
1502 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
1503 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
1506 } __attribute__ ((gcc_struct));
1508 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);
1510 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1512 static void CheckMembersDefinitions(struct __ecereNameSpace__ecere__com__Class * regClass, struct __ecereNameSpace__ecere__com__DataMember * member, struct __ecereNameSpace__ecere__sys__OldList * definitions, int access)
1514 if(definitions != (((void *)0)))
1516 struct ClassDef * def;
1518 for(def = definitions->first; def; def = def->next)
1522 struct Declaration * decl = def->decl;
1523 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
1528 struct Declarator * d;
1530 if(decl->declarators)
1532 for(d = (*decl->declarators).first; d; d = d->next)
1534 struct Identifier * declId = GetDeclId(d);
1540 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, declId->string);
1542 dataMember = link ? link->data : (((void *)0));
1545 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, declId->string, privateModule, (((void *)0)), (((void *)0)));
1547 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1551 else if(decl->specifiers)
1553 struct Specifier * spec;
1555 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
1557 if(spec->type == 3 || spec->type == 4)
1559 if(spec->definitions && !spec->id)
1561 CheckMembersDefinitions(regClass, member, spec->definitions, (def->memberAccess == 2) ? 2 : access);
1563 else if(spec->definitions && spec->id)
1567 struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&member->membersAlpha, spec->id->string);
1569 dataMember = link ? link->data : (((void *)0));
1572 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, spec->id->string, privateModule, (((void *)0)), (((void *)0)));
1574 CheckPublicDataType(dataMember->dataType, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class data member", (((void *)0))));
1580 else if(decl->type == 2)
1582 CheckPublicClass(decl->inst->_class->symbol, (def->memberAccess == 2) ? 2 : access, __ecereNameSpace__ecere__GetTranslatedString("ec", "class member instance", (((void *)0))));
1589 extern unsigned int inCompiler;
1591 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1593 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
1595 extern struct Symbol * FindClass(char * name);
1597 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);
1599 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);
1601 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);
1603 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);
1605 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);
1607 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
1609 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
1611 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
1613 extern struct Specifier * MkSpecifierName(char * name);
1615 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
1617 extern struct Identifier * MkIdentifier(char * string);
1619 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
1621 extern struct Expression * QMkExpId(char * id);
1623 extern void FreeDeclarator(struct Declarator * decl);
1625 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
1627 extern void FreeSpecifier(struct Specifier * spec);
1629 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1631 extern struct Type * MkClassType(char * name);
1633 extern char * strcpy(char * , const char * );
1635 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
1637 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1639 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
1641 extern void FreeExternal(struct External * external);
1643 extern int declMode;
1645 extern int structDeclMode;
1647 extern char * strstr(const char * , const char * );
1649 extern char * sourceFile;
1651 extern struct Specifier * MkSpecifier(int specifier);
1653 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
1655 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1657 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1659 extern struct Context * PushContext(void);
1661 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1663 extern struct Expression * CopyExpression(struct Expression * exp);
1665 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
1667 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
1669 extern void PopContext(struct Context * ctx);
1671 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
1673 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
1675 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
1677 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
1679 extern struct ClassDef * MkClassDefFunction(struct ClassFunction * function);
1681 extern struct Specifier * CopySpecifier(struct Specifier * spec);
1683 extern struct Expression * MkExpInstance(struct Instantiation * inst);
1685 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
1687 extern struct Expression * MkExpIdentifier(struct Identifier * id);
1689 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
1691 extern void FreeInitializer(struct Initializer * initializer);
1693 extern struct Statement * MkReturnStmt(struct __ecereNameSpace__ecere__sys__OldList * exp);
1695 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1697 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
1699 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
1701 extern void Compiler_Warning(char * format, ...);
1703 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1705 extern int sprintf(char * , char * , ...);
1707 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1709 extern struct Context * curContext;
1711 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
1713 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1715 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
1717 extern void FreeType(struct Type * type);
1719 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
1721 extern void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
1723 extern void FreeInitDeclarator(struct InitDeclarator * decl);
1725 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1727 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
1729 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
1731 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1733 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
1735 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
1737 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)
1739 char structName[1024];
1740 char className[1024];
1741 char constructorName[1024];
1742 char destructorName[1024];
1743 struct __ecereNameSpace__ecere__com__Class * regClass;
1744 struct ClassFunction * destructor = (((void *)0)), * constructor = (((void *)0));
1745 unsigned int redefinition = 0x0;
1746 unsigned int isUnion = classType == 6;
1747 struct External * external = (((void *)0));
1748 struct ClassDef * def;
1749 struct __ecereNameSpace__ecere__sys__OldList * list;
1750 struct __ecereNameSpace__ecere__sys__OldList * classDataList;
1755 classDataList = MkList();
1757 regClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, symbol->string);
1760 classType = regClass->type;
1764 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && regClass->inheritanceAccess == 1)
1766 if(!regClass->base->symbol)
1767 regClass->base->symbol = FindClass(regClass->base->fullName);
1768 CheckPublicClass(regClass->base->symbol, 1, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1770 else if(!symbol->isStatic && regClass->base)
1772 if(!regClass->base->symbol)
1773 regClass->base->symbol = FindClass(regClass->base->fullName);
1774 CheckPublicClass(regClass->base->symbol, 2, __ecereNameSpace__ecere__GetTranslatedString("ec", "class", (((void *)0))));
1777 if(definitions != (((void *)0)))
1779 for(def = definitions->first; def; def = def->next)
1783 struct __ecereNameSpace__ecere__com__DataMember * member;
1784 struct __ecereNameSpace__ecere__com__Property * prop;
1785 struct __ecereNameSpace__ecere__com__Method * method;
1787 if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(regClass, def->id->string, privateModule)))
1789 __ecereNameSpace__ecere__com__eClass_AddProperty(regClass, def->id->string, (((void *)0)), (((void *)0)), (((void *)0)), def->memberAccess);
1791 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(regClass, def->id->string, privateModule, (((void *)0)), (((void *)0)))))
1793 __ecereNameSpace__ecere__com__eClass_AddDataMember(regClass, def->id->string, (((void *)0)), 0, 0, def->memberAccess);
1795 else if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, def->id->string, privateModule)))
1797 __ecereNameSpace__ecere__com__eClass_AddMethod(regClass, def->id->string, (((void *)0)), (((void *)0)), def->memberAccess);
1802 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't find member %s to override\n", (((void *)0))), def->id->string);
1809 external = MkExternalDeclaration((((void *)0)));
1810 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1811 curExternal = external;
1812 curExternal->symbol = symbol;
1814 if((classType == 1 || classType == 5) && inCompiler)
1816 AddSimpleBaseMembers(list, regClass->base, regClass);
1818 if(definitions != (((void *)0)))
1822 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
1823 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 1);
1824 else if(!symbol->isStatic)
1825 CheckMembersDefinitions(regClass, (((void *)0)), definitions, 2);
1827 for(def = definitions->first; def; def = def->next)
1831 struct Declaration * decl = def->decl;
1835 if(inCompiler && classType != 2)
1837 ListAdd(list, MkClassDefDeclaration(decl));
1838 def->decl = (((void *)0));
1841 else if(decl->type == 2)
1843 struct Instantiation * inst = decl->inst;
1844 struct Expression * exp = inst->exp;
1845 struct Symbol * classSym;
1849 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
1850 struct Declarator * d;
1852 ListAdd(specifiers, MkSpecifierName(inst->_class->name));
1853 d = MkDeclaratorIdentifier(MkIdentifier(exp->identifier->string));
1856 struct __ecereNameSpace__ecere__sys__OldList * declarators = MkList();
1858 ListAdd(declarators, d);
1859 decl = MkStructDeclaration(specifiers, declarators, (((void *)0)));
1860 ListAdd(list, MkClassDefDeclaration(decl));
1862 exp->member.member = exp->identifier;
1863 exp->member.exp = QMkExpId("this");
1864 exp->member.memberType = 3;
1865 exp->member.thisPtr = 0x1;
1870 FreeList(specifiers, FreeSpecifier);
1873 classSym = inst->_class->symbol;
1874 if(classSym && classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 2 || classSym->registered->type == 3))
1876 if(inst->members && (*inst->members).count)
1877 symbol->needConstructor = 0x1;
1881 symbol->needConstructor = 0x1;
1882 symbol->needDestructor = 0x1;
1886 else if(def->type == 9)
1888 struct Declaration * decl = def->decl;
1892 if(inCompiler && classType != 2)
1894 ListAdd(classDataList, MkClassDefDeclaration(decl));
1895 def->decl = (((void *)0));
1899 else if(def->type == 1)
1900 symbol->needConstructor = 0x1;
1901 else if(def->type == 4)
1902 symbol->needConstructor = 0x1;
1903 else if(def->type == 0)
1905 struct ClassFunction * func = def->function;
1907 if(func->isDestructor)
1912 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of destructor for class %s\n", (((void *)0))), symbol->string);
1916 symbol->needDestructor = 0x1;
1918 if(!inCompiler && func->body)
1920 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1922 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1926 if(func->isConstructor)
1931 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "redefinition of constructor for class %s\n", (((void *)0))), symbol->string);
1935 symbol->needConstructor = 0x1;
1937 if(!inCompiler && func->body)
1939 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
1941 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&func->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
1950 external->symbol = (((void *)0));
1953 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = (initDeclarators != (((void *)0))) ? initDeclarators : MkList();
1955 initDeclarators = (((void *)0));
1956 strcpy(structName, symbol->string);
1957 symbol->structName = __ecereNameSpace__ecere__sys__CopyString(structName);
1959 struct Specifier * spec = MkStructOrUnion(3, MkIdentifier(structName), isUnion ? MkListOne(MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkStructOrUnion(4, (((void *)0)), list)), (((void *)0)), (((void *)0))))) : list);
1961 spec->extDeclStruct = extDecl;
1962 ListAdd(specs, spec);
1964 external->symbol = symbol;
1965 symbol->structExternal = external;
1966 external->declaration = MkDeclaration(specs, declarators);
1968 symbol->declaredStruct = 0x1;
1972 curExternal = external->prev;
1973 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(defs, external);
1974 FreeExternal(external);
1975 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
1977 if((*classDataList).count)
1979 char classDataStructName[1024];
1980 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1981 struct External * external;
1983 strcpy(classDataStructName, "__ecereClassData_");
1984 FullClassNameCat(classDataStructName, symbol->string, 0x0);
1985 declMode = structDeclMode = 0;
1986 ListAdd(specs, MkStructOrUnion(3, MkIdentifier(classDataStructName), classDataList));
1987 external = MkExternalDeclaration(MkDeclaration(specs, (((void *)0))));
1988 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, external);
1990 symbol->classData = 0x1;
1993 (__ecereNameSpace__ecere__com__eSystem_Delete(classDataList), classDataList = 0);
1998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * declarators = MkList();
2000 strcpy(className, "__ecereClass_");
2001 FullClassNameCat(className, symbol->string, 0x1);
2002 MangleClassName(className);
2003 symbol->className = __ecereNameSpace__ecere__sys__CopyString(className);
2004 if(!strstr(sourceFile, ".main.ec"))
2005 ListAdd(specs, MkSpecifier(STATIC));
2006 ListAdd(specs, MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
2007 ListAdd(declarators, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(className))), (((void *)0))));
2008 symbol->methodExternal = MkExternalDeclaration(MkDeclaration(specs, declarators));
2009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(defs, after, symbol->methodExternal);
2010 after = symbol->methodExternal;
2012 if(symbol->needDestructor)
2014 struct ClassFunction * function;
2015 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2016 struct Declarator * decl;
2017 struct Statement * body;
2018 struct Context * context;
2019 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2021 strcpy(destructorName, "__ecereDestructor_");
2022 FullClassNameCat(destructorName, symbol->string, 0x0);
2023 symbol->destructorName = __ecereNameSpace__ecere__sys__CopyString(destructorName);
2024 ListAdd(specs, MkSpecifier(VOID));
2025 context = PushContext();
2026 statements = MkList();
2027 if(definitions != (((void *)0)))
2029 for(def = definitions->first; def; def = def->next)
2031 if(def->type == 2 && def->decl && def->decl->type == 2)
2033 struct Instantiation * inst = def->decl->inst;
2034 struct Symbol * classSym = inst->_class->symbol;
2036 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2038 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2040 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2042 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 5))
2044 struct Expression * exp = MkExpOp((((void *)0)), DELETE, CopyExpression(inst->exp));
2046 ListAdd(statements, MkExpressionStmt(MkListOne(exp)));
2051 if(destructor && destructor->body)
2053 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*statements), (((void *)0)), destructor->body);
2054 destructor->body->compound.context->parent = context;
2055 destructor->body = (((void *)0));
2057 body = MkCompoundStmt(declarations, statements);
2058 PopContext(context);
2059 body->compound.context = context;
2060 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(destructorName)), (((void *)0)));
2061 decl->symbol = __extension__ ({
2062 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2064 __ecereInstance1->id = symbol->id, __ecereInstance1->idCode = symbol->idCode, __ecereInstance1;
2066 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2067 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2068 ProcessClassFunctionBody(function, body);
2069 function->id = symbol->id;
2070 function->idCode = symbol->idCode;
2071 function->dontMangle = 0x1;
2072 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2074 if(symbol->needConstructor && inCompiler)
2076 struct ClassFunction * function;
2077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
2078 struct Declarator * decl;
2079 struct Statement * body;
2080 struct Context * context;
2081 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0)), * statements;
2083 strcpy(constructorName, "__ecereConstructor_");
2084 FullClassNameCat(constructorName, symbol->string, 0x0);
2085 symbol->constructorName = __ecereNameSpace__ecere__sys__CopyString(constructorName);
2086 ListAdd(specs, MkSpecifierName("bool"));
2087 context = PushContext();
2088 statements = MkList();
2089 if(definitions != (((void *)0)))
2091 for(def = definitions->first; def; def = def->next)
2093 if(def->type == 2 && def->decl && def->decl->type == 2)
2095 struct Instantiation * inst = def->decl->inst;
2096 struct Symbol * classSym = inst->_class->symbol;
2098 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2100 struct Instantiation * newInst = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
2103 newInst->members = (((void *)0));
2104 newInst->exp = CopyExpression(inst->exp);
2105 newInst->_class = CopySpecifier(inst->_class);
2106 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(newInst))));
2109 if(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0))
2111 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_IncRef")), MkListOne(CopyExpression(inst->exp))))));
2115 for(def = definitions->first; def; def = def->next)
2117 if(def->type == 1 && def->defProperties)
2119 struct MemberInit * propertyDef;
2121 for(propertyDef = (*def->defProperties).first; propertyDef; propertyDef = propertyDef->next)
2123 struct Expression * memberExp;
2124 struct Identifier * id = (*propertyDef->identifiers).first;
2128 memberExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), id);
2129 for(id = id->next; id; id = id->next)
2130 memberExp = MkExpMember(memberExp, id);
2131 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(memberExp, '=', (propertyDef->initializer && propertyDef->initializer->type == 0 ? propertyDef->initializer->exp : (((void *)0)))))));
2133 if(propertyDef->initializer)
2135 if(propertyDef->initializer->type == 0)
2136 propertyDef->initializer->exp = (((void *)0));
2137 FreeInitializer(propertyDef->initializer);
2139 propertyDef->initializer = (((void *)0));
2140 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*propertyDef->identifiers));
2144 for(def = definitions->first; def; def = def->next)
2146 if(def->type == 2 && def->decl && def->decl->type == 2)
2148 struct Instantiation * inst = def->decl->inst;
2149 struct Symbol * classSym = inst->_class->symbol;
2151 if(inst->exp || (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5))
2153 if(!(inst->exp && (!classSym || !classSym->registered || classSym->registered->type == 0 || classSym->registered->type == 5)) || (inst->members && (*inst->members).count))
2155 def->decl->inst = (((void *)0));
2156 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpInstance(inst))));
2162 if(constructor && constructor->body)
2164 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*statements), constructor->body);
2165 constructor->body->compound.context->parent = context;
2166 constructor->body = (((void *)0));
2168 ListAdd(statements, MkReturnStmt(MkListOne(MkExpIdentifier(MkIdentifier("true")))));
2169 body = MkCompoundStmt(declarations, statements);
2170 PopContext(context);
2171 body->compound.context = context;
2172 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(constructorName)), (((void *)0)));
2173 decl->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
2174 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), decl->symbol);
2175 decl->symbol->id = symbol->id;
2176 decl->symbol->idCode = symbol->idCode;
2177 function = MkClassFunction(specs, (((void *)0)), decl, (((void *)0)));
2178 ProcessClassFunctionBody(function, body);
2179 function->id = symbol->id;
2180 function->idCode = symbol->idCode;
2181 function->dontMangle = 0x1;
2182 if(definitions != (((void *)0)))
2183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, (((void *)0)), MkClassDefFunction(function));
2186 if(definitions != (((void *)0)))
2188 for(def = definitions->first; def; def = def->next)
2190 if(def->type == 3 && def->propertyDef)
2192 struct PropertyDef * propertyDef = def->propertyDef;
2193 struct ClassDef * after = def;
2194 struct ClassDef * newDef;
2198 yylloc = propertyDef->loc;
2199 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && def->memberAccess == 1)
2200 CheckPublicDataType(propertyDef->symbol->type, 1, "class property");
2201 else if(!symbol->isStatic)
2202 CheckPublicDataType(propertyDef->symbol->type, 2, "class property");
2206 struct ClassFunction * func;
2207 struct Declarator * decl;
2209 struct __ecereNameSpace__ecere__sys__OldList * params;
2211 if(propertyDef->getStmt && propertyDef->id)
2213 strcpy(name, "__ecereProp_");
2214 FullClassNameCat(name, symbol->string, 0x0);
2215 strcat(name, "_Get_");
2216 FullClassNameCat(name, propertyDef->id->string, 0x1);
2217 MangleClassName(name);
2219 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)
2221 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), MkDeclaratorIdentifier(MkIdentifier("value"))));
2222 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2223 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), decl, (((void *)0)));
2227 decl = PlugDeclarator(propertyDef->declarator, MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params));
2228 func = MkClassFunction(CopyList(propertyDef->specifiers, CopySpecifier), (((void *)0)), decl, (((void *)0)));
2230 ProcessClassFunctionBody(func, propertyDef->getStmt);
2231 func->declarator->symbol = propertyDef->symbol;
2232 propertyDef->symbol->externalGet = (struct External *)func;
2233 func->dontMangle = 0x1;
2234 newDef = MkClassDefFunction(func);
2235 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2238 propertyDef->getStmt = (((void *)0));
2240 func->body = (((void *)0));
2242 if(propertyDef->setStmt && propertyDef->id)
2244 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2246 strcpy(name, "__ecereProp_");
2247 FullClassNameCat(name, symbol->string, 0x0);
2248 strcat(name, "_Set_");
2249 FullClassNameCat(name, propertyDef->id->string, 0x1);
2250 MangleClassName(name);
2252 ListAdd(params, MkTypeName(CopyList(propertyDef->specifiers, CopySpecifier), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")))));
2253 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2255 unsigned int isConversion = propertyDef->symbol->_property && propertyDef->symbol->_property->conversion;
2256 unsigned int useVoid = 0x0;
2258 switch(regClass->type)
2266 useVoid = !isConversion;
2269 useVoid = !isConversion;
2270 if(useVoid && !propertyDef->isDBProp)
2271 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "set defined on type without storage for non-conversion property\n", (((void *)0))));
2273 ListAdd(specifiers, useVoid ? MkSpecifier(VOID) : MkSpecifierName(regClass->fullName));
2275 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2276 ProcessClassFunctionBody(func, propertyDef->setStmt);
2277 func->dontMangle = 0x1;
2278 func->declarator->symbol = propertyDef->symbol;
2279 propertyDef->symbol->externalSet = (struct External *)func;
2280 if(!propertyDef->conversion && regClass->type == 0)
2281 func->propSet = propertyDef->symbol;
2282 newDef = MkClassDefFunction(func);
2283 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2286 propertyDef->setStmt = (((void *)0));
2288 func->body = (((void *)0));
2290 if(propertyDef->issetStmt && propertyDef->id)
2292 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2294 strcpy(name, "__ecereProp_");
2295 FullClassNameCat(name, symbol->string, 0x0);
2296 strcat(name, "_IsSet_");
2297 FullClassNameCat(name, propertyDef->id->string, 0x1);
2298 MangleClassName(name);
2300 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2301 ListAdd(specifiers, MkSpecifierName("bool"));
2302 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2303 ProcessClassFunctionBody(func, propertyDef->issetStmt);
2304 func->dontMangle = 0x1;
2305 func->declarator->symbol = propertyDef->symbol;
2306 propertyDef->symbol->externalIsSet = (struct External *)func;
2307 newDef = MkClassDefFunction(func);
2308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2311 propertyDef->issetStmt = (((void *)0));
2313 func->body = (((void *)0));
2315 if(propertyDef->id && inCompiler)
2317 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(symbol->registered, propertyDef->id->string, privateModule);
2318 struct Declaration * decl;
2319 struct External * external;
2320 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
2323 ListAdd(specifiers, MkSpecifierName("Property"));
2324 strcpy(name, "__ecereProp_");
2325 FullClassNameCat(name, symbol->string, 0x0);
2327 FullClassNameCat(name, propertyDef->id->string, 0x1);
2328 MangleClassName(name);
2330 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
2332 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2333 strcpy(name, "__ecerePropM_");
2334 FullClassNameCat(name, symbol->string, 0x0);
2336 FullClassNameCat(name, propertyDef->id->string, 0x1);
2337 MangleClassName(name);
2338 ListAdd(list, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))));
2339 decl = MkDeclaration(specifiers, list);
2341 external = MkExternalDeclaration(decl);
2342 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2343 external->symbol = propertyDef->symbol;
2344 propertyDef->symbol->externalPtr = external;
2345 if(inCompiler && prop && prop->symbol)
2346 ((struct Symbol *)prop->symbol)->externalPtr = external;
2351 else if(def->type == 10 && def->propertyDef)
2353 struct PropertyDef * propertyDef = def->propertyDef;
2354 struct ClassDef * after = def;
2355 struct ClassDef * newDef;
2360 yylloc = propertyDef->loc;
2361 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace))
2362 CheckPublicDataType(propertyDef->symbol->type, 1, "classwide property");
2363 else if(!symbol->isStatic)
2364 CheckPublicDataType(propertyDef->symbol->type, 2, "classwide property");
2367 struct ClassFunction * func;
2368 struct Declarator * decl;
2370 struct __ecereNameSpace__ecere__sys__OldList * params;
2372 if(propertyDef->getStmt && propertyDef->id)
2374 struct Declarator * declId;
2376 sprintf(name, "class::__ecereClassProp_");
2377 FullClassNameCat(name, symbol->string, 0x0);
2378 strcat(name, "_Get_");
2379 strcat(name, propertyDef->id->string);
2380 MangleClassName(name);
2382 declId = MkDeclaratorIdentifier(MkIdentifier(name));
2384 decl = MkDeclaratorFunction(declId, params);
2385 func = MkClassFunction(MkListOne(MkSpecifierName("uint64")), (((void *)0)), decl, (((void *)0)));
2387 ProcessClassFunctionBody(func, propertyDef->getStmt);
2388 func->declarator->symbol = propertyDef->symbol;
2389 propertyDef->symbol->externalGet = (struct External *)func;
2390 func->dontMangle = 0x1;
2391 newDef = MkClassDefFunction(func);
2392 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2394 decl = MkDeclaratorFunction(propertyDef->declarator, (((void *)0)));
2395 func->type = ProcessType(propertyDef->specifiers, decl);
2396 decl->declarator = (((void *)0));
2397 FreeDeclarator(decl);
2398 if(func->type->returnType->kind == 8 && func->type->returnType->_class && func->type->returnType->_class->registered && func->type->returnType->_class->registered->type == 1)
2399 func->type->returnType->byReference = 0x1;
2401 propertyDef->getStmt = (((void *)0));
2403 func->body = (((void *)0));
2405 if(propertyDef->setStmt && propertyDef->id)
2407 struct Context * prevCurContext;
2408 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
2409 struct Statement * body = propertyDef->setStmt;
2410 struct Declarator * ptrDecl;
2412 strcpy(name, "class::__ecereClassProp_");
2413 FullClassNameCat(name, symbol->string, 0x0);
2414 strcat(name, "_Set_");
2415 strcat(name, propertyDef->id->string);
2416 MangleClassName(name);
2418 prevCurContext = curContext;
2419 curContext = body->compound.context;
2420 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorIdentifier(MkIdentifier("_value"))));
2421 decl = MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(name)), params);
2422 if(!body->compound.declarations)
2423 body->compound.declarations = MkList();
2424 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)
2425 ptrDecl = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value"))));
2427 ptrDecl = PlugDeclarator(propertyDef->declarator, MkDeclaratorIdentifier(MkIdentifier("value")));
2428 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"))))))));
2429 curContext = prevCurContext;
2431 struct Symbol * sym = ptrDecl->symbol;
2434 FreeType(sym->type);
2435 sym->type = ProcessType(propertyDef->specifiers, propertyDef->declarator);
2437 ListAdd(specifiers, MkSpecifier(VOID));
2438 func = MkClassFunction(specifiers, (((void *)0)), decl, (((void *)0)));
2439 ProcessClassFunctionBody(func, propertyDef->setStmt);
2440 func->dontMangle = 0x1;
2441 func->declarator->symbol = propertyDef->symbol;
2442 propertyDef->symbol->externalSet = (struct External *)func;
2443 newDef = MkClassDefFunction(func);
2444 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(definitions, after, newDef);
2447 propertyDef->setStmt = (((void *)0));
2449 func->body = (((void *)0));
2454 else if(def->type == 0 && def->function->declarator)
2456 struct ClassFunction * func = def->function;
2458 func->_class = regClass;
2459 if(!func->dontMangle)
2461 struct Declarator * funcDecl = GetFuncDecl(func->declarator);
2462 struct Identifier * id = GetDeclId(funcDecl);
2463 struct __ecereNameSpace__ecere__com__Method * method;
2465 if(!funcDecl->function.parameters || !(*funcDecl->function.parameters).first)
2467 if(!funcDecl->function.parameters)
2468 funcDecl->function.parameters = MkList();
2469 ListAdd(funcDecl->function.parameters, MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
2471 method = __ecereNameSpace__ecere__com__eClass_FindMethod(regClass, id->string, privateModule);
2472 FreeSpecifier(id->_class);
2473 id->_class = (((void *)0));
2474 if(inCompiler && method)
2476 char * newId = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (strlen(id->string) + strlen("__ecereMethod___ecereNameSpace__") + strlen(symbol->string) + 2));
2479 ProcessMethodType(method);
2481 if(!NameSpaceContained(regClass->nameSpace, &((struct __ecereNameSpace__ecere__com__Module *)(((char *)regClass->module + structSize_Instance)))->privateNameSpace) && method->memberAccess == 1)
2482 CheckPublicDataType(method->dataType, 1, "class method");
2483 strcpy(newId, "__ecereMethod_");
2484 FullClassNameCat(newId, symbol->string, 0x0);
2486 strcat(newId, id->string);
2487 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
2489 if(method->type != 1)
2493 (__ecereNameSpace__ecere__com__eSystem_Delete(((struct Symbol *)method->symbol)->string), ((struct Symbol *)method->symbol)->string = 0);
2494 ((struct Symbol *)method->symbol)->string = __ecereNameSpace__ecere__sys__CopyString(newId);
2502 if(initDeclarators != (((void *)0)))
2503 FreeList(initDeclarators, FreeInitDeclarator);
2506 void PreProcessClassDefinitions()
2508 struct External * external, * next;
2510 curExternal = (((void *)0));
2513 for(external = (*ast).first; external; external = next)
2515 next = external->next;
2516 curExternal = external;
2517 if(external->type == 2)
2519 struct ClassDefinition * _class = external->_class;
2521 if(_class->definitions)
2523 ProcessClass(0, _class->definitions, _class->symbol, _class->baseSpecs, (((void *)0)), &_class->loc, ast, external->prev, (((void *)0)), (((void *)0)));
2526 else if(external->type == 1)
2528 struct Declaration * declaration = external->declaration;
2530 if(declaration->type == 1)
2532 if(declaration->specifiers)
2534 struct Specifier * specifier;
2536 for(specifier = (*declaration->specifiers).first; specifier; specifier = specifier->next)
2538 if((specifier->type == 2 || specifier->type == 3 || specifier->type == 4) && specifier->id && specifier->id->string && (declaration->declMode || specifier->baseSpecs || (specifier->type == 2 && specifier->definitions)))
2540 struct Symbol * symbol = FindClass(specifier->id->string);
2544 struct __ecereNameSpace__ecere__sys__OldList * initDeclarators = (((void *)0));
2545 struct ExtDecl * extDecl = specifier->extDeclStruct;
2547 specifier->extDeclStruct = (((void *)0));
2550 initDeclarators = declaration->declarators;
2551 declaration->declarators = (((void *)0));
2553 ProcessClass((specifier->type == 4) ? 6 : 0, specifier->definitions, symbol, specifier->baseSpecs, specifier->list, &specifier->loc, ast, external->prev, initDeclarators, extDecl);
2559 else if(inCompiler && declaration->type == 3)
2561 yylloc = declaration->loc;
2562 if(declaration->declMode == 1)
2563 CheckPublicExpression(declaration->exp, 1);
2564 else if(declaration->declMode != 3)
2565 CheckPublicExpression(declaration->exp, 2);
2568 else if(external->type == 3)
2571 else if(inCompiler && external->type == 0)
2573 yylloc = external->function->loc;
2574 if(!external->function->type)
2575 external->function->type = ProcessType(external->function->specifiers, external->function->declarator);
2576 if(external->function->declMode == 1)
2577 CheckPublicDataType(external->function->type, 1, "function");
2578 else if(external->function->declMode != 3)
2579 CheckPublicDataType(external->function->type, 2, "function");
2585 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
2587 struct __ecereNameSpace__ecere__com__GlobalFunction;
2589 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);
2591 void __ecereRegisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)
2593 struct __ecereNameSpace__ecere__com__Class * class;
2595 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MangleClassName", "void MangleClassName(char * className)", MangleClassName, module, 1);
2596 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FullClassNameCat", "void FullClassNameCat(char * output, char * className, bool includeTemplateParams)", FullClassNameCat, module, 1);
2597 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PreProcessClassDefinitions", "void PreProcessClassDefinitions(void)", PreProcessClassDefinitions, module, 1);
2600 void __ecereUnregisterModule_pass0(struct __ecereNameSpace__ecere__com__Instance * module)