2 typedef long long int64;
3 typedef unsigned long long uint64;
7 #elif defined(__TINYC__)
9 #define __builtin_va_list va_list
10 #define __builtin_va_start va_start
11 #define __builtin_va_end va_end
13 #define strcasecmp stricmp
14 #define strncasecmp strnicmp
15 #define __declspec(x) __attribute__((x))
19 typedef long long int64;
20 typedef unsigned long long uint64;
22 typedef __int64 int64;
23 typedef unsigned __int64 uint64;
26 #define __ENDIAN_PAD(x) (8 - (x))
28 #define __ENDIAN_PAD(x) 0
32 typedef unsigned long long int uintptr_t;
33 typedef long long int intptr_t;
35 typedef unsigned int uintptr_t;
41 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
43 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
45 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
49 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
51 struct __ecereNameSpace__ecere__sys__BTNode;
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
55 struct __ecereNameSpace__ecere__sys__BinaryTree
57 struct __ecereNameSpace__ecere__sys__BTNode * root;
59 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
60 void (* FreeKey)(void * key);
61 } __attribute__ ((gcc_struct));
63 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
65 struct __ecereNameSpace__ecere__sys__OldList
72 } __attribute__ ((gcc_struct));
74 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
76 struct __ecereNameSpace__ecere__com__Method
79 struct __ecereNameSpace__ecere__com__Method * parent;
80 struct __ecereNameSpace__ecere__com__Method * left;
81 struct __ecereNameSpace__ecere__com__Method * right;
86 struct __ecereNameSpace__ecere__com__Class * _class;
88 char * dataTypeString;
89 struct Type * dataType;
91 } __attribute__ ((gcc_struct));
93 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
95 struct __ecereNameSpace__ecere__com__Property
97 struct __ecereNameSpace__ecere__com__Property * prev;
98 struct __ecereNameSpace__ecere__com__Property * next;
100 unsigned int isProperty;
103 struct __ecereNameSpace__ecere__com__Class * _class;
104 char * dataTypeString;
105 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
106 struct Type * dataType;
109 unsigned int (* IsSet)();
113 unsigned int conversion;
114 unsigned int watcherOffset;
116 unsigned int compiled;
117 unsigned int selfWatchable;
118 unsigned int isWatchable;
119 } __attribute__ ((gcc_struct));
121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
128 unsigned int included;
129 } __attribute__ ((gcc_struct));
131 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
135 struct CodePosition start;
136 struct CodePosition end;
137 } __attribute__ ((gcc_struct));
139 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
152 struct Attrib * attr;
153 } __attribute__ ((gcc_struct));
154 } __attribute__ ((gcc_struct));
156 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
158 struct ClassDefinition
160 struct ClassDefinition * prev;
161 struct ClassDefinition * next;
163 struct Specifier * _class;
164 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
165 struct __ecereNameSpace__ecere__sys__OldList * definitions;
166 struct Symbol * symbol;
167 struct Location blockStart;
168 struct Location nameLoc;
171 unsigned int deleteWatchable;
172 } __attribute__ ((gcc_struct));
174 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
178 struct Context * parent;
179 struct __ecereNameSpace__ecere__sys__BinaryTree types;
180 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
181 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
182 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
185 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
186 struct ClassDefinition * classDef;
187 unsigned int templateTypesOnly;
188 unsigned int hasNameSpace;
189 } __attribute__ ((gcc_struct));
191 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
195 struct Instantiation * prev;
196 struct Instantiation * next;
198 struct Specifier * _class;
199 struct Expression * exp;
200 struct __ecereNameSpace__ecere__sys__OldList * members;
201 struct Symbol * symbol;
202 unsigned int fullSet;
203 unsigned int isConstant;
204 unsigned char * data;
205 struct Location nameLoc;
206 struct Location insideLoc;
208 } __attribute__ ((gcc_struct));
210 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
214 struct Declaration * prev;
215 struct Declaration * next;
222 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
223 struct __ecereNameSpace__ecere__sys__OldList * declarators;
224 } __attribute__ ((gcc_struct));
225 struct Instantiation * inst;
228 struct Identifier * id;
229 struct Expression * exp;
230 } __attribute__ ((gcc_struct));
231 } __attribute__ ((gcc_struct));
232 struct Specifier * extStorage;
233 struct Symbol * symbol;
235 } __attribute__ ((gcc_struct));
237 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
241 struct Statement * prev;
242 struct Statement * next;
247 struct __ecereNameSpace__ecere__sys__OldList * expressions;
250 struct Identifier * id;
251 struct Statement * stmt;
252 } __attribute__ ((gcc_struct)) labeled;
255 struct Expression * exp;
256 struct Statement * stmt;
257 } __attribute__ ((gcc_struct)) caseStmt;
260 struct __ecereNameSpace__ecere__sys__OldList * declarations;
261 struct __ecereNameSpace__ecere__sys__OldList * statements;
262 struct Context * context;
263 unsigned int isSwitch;
264 } __attribute__ ((gcc_struct)) compound;
267 struct __ecereNameSpace__ecere__sys__OldList * exp;
268 struct Statement * stmt;
269 struct Statement * elseStmt;
270 } __attribute__ ((gcc_struct)) ifStmt;
273 struct __ecereNameSpace__ecere__sys__OldList * exp;
274 struct Statement * stmt;
275 } __attribute__ ((gcc_struct)) switchStmt;
278 struct __ecereNameSpace__ecere__sys__OldList * exp;
279 struct Statement * stmt;
280 } __attribute__ ((gcc_struct)) whileStmt;
283 struct __ecereNameSpace__ecere__sys__OldList * exp;
284 struct Statement * stmt;
285 } __attribute__ ((gcc_struct)) doWhile;
288 struct Statement * init;
289 struct Statement * check;
290 struct __ecereNameSpace__ecere__sys__OldList * increment;
291 struct Statement * stmt;
292 } __attribute__ ((gcc_struct)) forStmt;
295 struct Identifier * id;
296 } __attribute__ ((gcc_struct)) gotoStmt;
299 struct Specifier * spec;
301 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
302 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
303 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
304 } __attribute__ ((gcc_struct)) asmStmt;
307 struct Expression * watcher;
308 struct Expression * object;
309 struct __ecereNameSpace__ecere__sys__OldList * watches;
310 } __attribute__ ((gcc_struct)) _watch;
313 struct Identifier * id;
314 struct __ecereNameSpace__ecere__sys__OldList * exp;
315 struct __ecereNameSpace__ecere__sys__OldList * filter;
316 struct Statement * stmt;
317 } __attribute__ ((gcc_struct)) forEachStmt;
318 struct Declaration * decl;
319 } __attribute__ ((gcc_struct));
320 } __attribute__ ((gcc_struct));
322 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
326 struct TypeName * prev;
327 struct TypeName * next;
329 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
330 struct Declarator * declarator;
332 struct Expression * bitCount;
333 } __attribute__ ((gcc_struct));
335 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
339 struct Initializer * prev;
340 struct Initializer * next;
345 struct Expression * exp;
346 struct __ecereNameSpace__ecere__sys__OldList * list;
347 } __attribute__ ((gcc_struct));
348 unsigned int isConstant;
349 } __attribute__ ((gcc_struct));
351 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
353 struct __ecereNameSpace__ecere__com__DataValue
368 } __attribute__ ((gcc_struct));
369 } __attribute__ ((gcc_struct));
371 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
375 struct Expression * prev;
376 struct Expression * next;
384 struct Identifier * identifier;
385 } __attribute__ ((gcc_struct));
386 struct Statement * compound;
387 struct Instantiation * instance;
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;
470 unsigned int address;
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 } __attribute__ ((gcc_struct));
483 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
485 struct TemplateDatatype
487 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
488 struct Declarator * decl;
489 } __attribute__ ((gcc_struct));
491 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
493 struct TemplateArgument;
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
497 struct TemplateParameter
499 struct TemplateParameter * prev;
500 struct TemplateParameter * next;
503 struct Identifier * identifier;
506 struct TemplateDatatype * dataType;
508 } __attribute__ ((gcc_struct));
509 struct TemplateArgument * defaultArgument;
510 char * dataTypeString;
511 struct Type * baseType;
512 } __attribute__ ((gcc_struct));
514 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
518 struct Specifier * prev;
519 struct Specifier * next;
527 struct ExtDecl * extDecl;
529 struct Symbol * symbol;
530 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
531 } __attribute__ ((gcc_struct));
534 struct Identifier * id;
535 struct __ecereNameSpace__ecere__sys__OldList * list;
536 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
537 struct __ecereNameSpace__ecere__sys__OldList * definitions;
538 unsigned int addNameSpace;
539 struct Context * ctx;
540 struct ExtDecl * extDeclStruct;
541 } __attribute__ ((gcc_struct));
542 struct Expression * expression;
543 struct Specifier * _class;
544 struct TemplateParameter * templateParameter;
545 } __attribute__ ((gcc_struct));
546 } __attribute__ ((gcc_struct));
548 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
552 struct Identifier * prev;
553 struct Identifier * next;
555 struct Symbol * classSym;
556 struct Specifier * _class;
558 struct Identifier * badID;
559 } __attribute__ ((gcc_struct));
561 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
569 struct Declarator * prev;
570 struct Declarator * next;
573 struct Symbol * symbol;
574 struct Declarator * declarator;
577 struct Identifier * identifier;
580 struct Expression * exp;
581 struct Expression * posExp;
582 struct Attrib * attrib;
583 } __attribute__ ((gcc_struct)) structDecl;
586 struct Expression * exp;
587 struct Specifier * enumClass;
588 } __attribute__ ((gcc_struct)) array;
591 struct __ecereNameSpace__ecere__sys__OldList * parameters;
592 } __attribute__ ((gcc_struct)) function;
595 struct Pointer * pointer;
596 } __attribute__ ((gcc_struct)) pointer;
599 struct ExtDecl * extended;
600 } __attribute__ ((gcc_struct)) extended;
601 } __attribute__ ((gcc_struct));
602 } __attribute__ ((gcc_struct));
604 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
606 struct FunctionDefinition
608 struct FunctionDefinition * prev;
609 struct FunctionDefinition * next;
611 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
612 struct Declarator * declarator;
613 struct __ecereNameSpace__ecere__sys__OldList * declarations;
614 struct Statement * body;
615 struct __ecereNameSpace__ecere__com__Class * _class;
616 struct __ecereNameSpace__ecere__sys__OldList attached;
619 struct Symbol * propSet;
621 unsigned int propertyNoThis;
622 } __attribute__ ((gcc_struct));
624 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
632 struct External * prev;
633 struct External * next;
636 struct Symbol * symbol;
639 struct FunctionDefinition * function;
640 struct ClassDefinition * _class;
641 struct Declaration * declaration;
643 struct Identifier * id;
644 struct DBTableDef * table;
645 } __attribute__ ((gcc_struct));
647 } __attribute__ ((gcc_struct));
649 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
653 struct ModuleImport * prev;
654 struct ModuleImport * next;
656 struct __ecereNameSpace__ecere__sys__OldList classes;
657 struct __ecereNameSpace__ecere__sys__OldList functions;
660 } __attribute__ ((gcc_struct));
662 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
666 struct ClassImport * prev;
667 struct ClassImport * next;
669 struct __ecereNameSpace__ecere__sys__OldList methods;
670 struct __ecereNameSpace__ecere__sys__OldList properties;
672 unsigned int isRemote;
673 } __attribute__ ((gcc_struct));
675 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
680 struct Symbol * parent;
681 struct Symbol * left;
682 struct Symbol * right;
687 struct __ecereNameSpace__ecere__com__Method * method;
688 struct __ecereNameSpace__ecere__com__Property * _property;
689 struct __ecereNameSpace__ecere__com__Class * registered;
690 } __attribute__ ((gcc_struct));
697 struct External * pointerExternal;
698 struct External * structExternal;
699 } __attribute__ ((gcc_struct));
702 struct External * externalGet;
703 struct External * externalSet;
704 struct External * externalPtr;
705 struct External * externalIsSet;
706 } __attribute__ ((gcc_struct));
709 struct External * methodExternal;
710 struct External * methodCodeExternal;
711 } __attribute__ ((gcc_struct));
712 } __attribute__ ((gcc_struct));
713 unsigned int imported;
714 unsigned int declaredStructSym;
715 struct __ecereNameSpace__ecere__com__Class * _class;
716 unsigned int declaredStruct;
717 unsigned int needConstructor;
718 unsigned int needDestructor;
719 char * constructorName;
722 char * destructorName;
723 struct ModuleImport * module;
724 struct ClassImport * _import;
725 struct Location nameLoc;
726 unsigned int isParam;
727 unsigned int isRemote;
728 unsigned int isStruct;
729 unsigned int fireWatchersDone;
731 unsigned int classData;
732 unsigned int isStatic;
734 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
735 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
736 struct Context * ctx;
738 struct Expression * propCategory;
739 } __attribute__ ((gcc_struct));
741 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
750 struct Symbol * _class;
753 struct __ecereNameSpace__ecere__sys__OldList members;
755 } __attribute__ ((gcc_struct));
758 struct Type * returnType;
759 struct __ecereNameSpace__ecere__sys__OldList params;
760 struct Symbol * thisClass;
761 unsigned int staticMethod;
762 struct TemplateParameter * thisClassTemplate;
763 } __attribute__ ((gcc_struct));
766 struct __ecereNameSpace__ecere__com__Method * method;
767 struct __ecereNameSpace__ecere__com__Class * methodClass;
768 struct __ecereNameSpace__ecere__com__Class * usedClass;
769 } __attribute__ ((gcc_struct));
772 struct Type * arrayType;
774 struct Expression * arraySizeExp;
775 unsigned int freeExp;
776 struct Symbol * enumClass;
777 } __attribute__ ((gcc_struct));
779 struct TemplateParameter * templateParameter;
780 } __attribute__ ((gcc_struct));
781 unsigned int isSigned;
783 unsigned int constant;
790 unsigned int byReference;
791 unsigned int extraParam;
793 unsigned int directClassAccess;
794 unsigned int computing;
795 unsigned int dllExport;
797 unsigned int keepCast;
798 unsigned int passAsTemplate;
800 } __attribute__ ((gcc_struct));
802 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
804 struct __ecereNameSpace__ecere__com__Class
806 struct __ecereNameSpace__ecere__com__Class * prev;
807 struct __ecereNameSpace__ecere__com__Class * next;
813 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
814 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
817 struct __ecereNameSpace__ecere__com__Class * base;
818 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
819 struct __ecereNameSpace__ecere__sys__BinaryTree members;
820 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
821 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
822 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
823 struct __ecereNameSpace__ecere__sys__OldList derivatives;
827 struct __ecereNameSpace__ecere__com__Instance * module;
828 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
829 char * dataTypeString;
830 struct Type * dataType;
832 int defaultAlignment;
833 void (* Initialize)();
835 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
836 char * designerClass;
837 unsigned int noExpansion;
838 char * defaultProperty;
839 unsigned int comRedefinition;
841 unsigned int isRemote;
842 unsigned int internalDecl;
844 unsigned int computeSize;
846 int destructionWatchOffset;
848 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
849 int inheritanceAccess;
852 struct __ecereNameSpace__ecere__sys__OldList conversions;
853 struct __ecereNameSpace__ecere__sys__OldList templateParams;
854 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
855 struct __ecereNameSpace__ecere__com__Class * templateClass;
856 struct __ecereNameSpace__ecere__sys__OldList templatized;
858 } __attribute__ ((gcc_struct));
860 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
862 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
864 struct __ecereNameSpace__ecere__com__Instance
867 struct __ecereNameSpace__ecere__com__Class * _class;
869 } __attribute__ ((gcc_struct));
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
873 struct __ecereNameSpace__ecere__com__DataMember
875 struct __ecereNameSpace__ecere__com__DataMember * prev;
876 struct __ecereNameSpace__ecere__com__DataMember * next;
878 unsigned int isProperty;
881 struct __ecereNameSpace__ecere__com__Class * _class;
882 char * dataTypeString;
883 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
884 struct Type * dataType;
888 struct __ecereNameSpace__ecere__sys__OldList members;
889 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
892 } __attribute__ ((gcc_struct));
894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
896 struct __ecereNameSpace__ecere__com__SerialBuffer
898 unsigned char * _buffer;
902 } __attribute__ ((gcc_struct));
904 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
906 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
912 char * dataTypeString;
913 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
914 } __attribute__ ((gcc_struct));
915 struct __ecereNameSpace__ecere__com__DataValue expression;
921 struct __ecereNameSpace__ecere__com__DataMember * member;
922 struct __ecereNameSpace__ecere__com__Property * prop;
923 struct __ecereNameSpace__ecere__com__Method * method;
924 } __attribute__ ((gcc_struct));
925 } __attribute__ ((gcc_struct));
926 } __attribute__ ((gcc_struct));
927 } __attribute__ ((gcc_struct));
929 typedef unsigned int size_t;
931 void exit(int status);
933 void * calloc(size_t nmemb, size_t size);
935 void free(void * ptr);
937 void * malloc(size_t size);
939 void * realloc(void * ptr, size_t size);
941 long int strtol(const char * nptr, char ** endptr, int base);
943 long long int strtoll(const char * nptr, char ** endptr, int base);
945 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
949 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
952 typedef union YYSTYPE
957 struct Identifier * id;
958 struct Expression * exp;
959 struct Specifier * specifier;
960 struct __ecereNameSpace__ecere__sys__OldList * list;
961 struct Enumerator * enumerator;
962 struct Declarator * declarator;
963 struct Pointer * pointer;
964 struct Initializer * initializer;
965 struct InitDeclarator * initDeclarator;
966 struct TypeName * typeName;
967 struct Declaration * declaration;
968 struct Statement * stmt;
969 struct FunctionDefinition * function;
970 struct External * external;
971 struct Context * context;
972 struct AsmField * asmField;
973 struct Attrib * attrib;
974 struct ExtDecl * extDecl;
975 struct Attribute * attribute;
976 struct Instantiation * instance;
977 struct MembersInit * membersInit;
978 struct MemberInit * memberInit;
979 struct ClassFunction * classFunction;
980 struct ClassDefinition * _class;
981 struct ClassDef * classDef;
982 struct PropertyDef * prop;
984 struct Symbol * symbol;
985 struct PropertyWatch * propertyWatch;
986 struct TemplateParameter * templateParameter;
987 struct TemplateArgument * templateArgument;
988 struct TemplateDatatype * templateDatatype;
989 struct DBTableEntry * dbtableEntry;
990 struct DBIndexItem * dbindexItem;
991 struct DBTableDef * dbtableDef;
992 } __attribute__ ((gcc_struct)) YYSTYPE;
994 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
998 struct Enumerator * prev;
999 struct Enumerator * next;
1000 struct Location loc;
1001 struct Identifier * id;
1002 struct Expression * exp;
1003 } __attribute__ ((gcc_struct));
1005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1007 struct InitDeclarator
1009 struct InitDeclarator * prev;
1010 struct InitDeclarator * next;
1011 struct Location loc;
1012 struct Declarator * declarator;
1013 struct Initializer * initializer;
1014 } __attribute__ ((gcc_struct));
1016 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1020 struct AsmField * prev;
1021 struct AsmField * next;
1022 struct Location loc;
1024 struct Expression * expression;
1025 } __attribute__ ((gcc_struct));
1027 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1033 struct ClassFunction
1035 struct ClassFunction * prev;
1036 struct ClassFunction * next;
1037 struct Location loc;
1038 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1039 struct Declarator * declarator;
1040 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1041 struct Statement * body;
1042 struct __ecereNameSpace__ecere__com__Class * _class;
1043 struct __ecereNameSpace__ecere__sys__OldList attached;
1046 struct Symbol * propSet;
1047 unsigned int isVirtual;
1048 unsigned int isConstructor;
1049 unsigned int isDestructor;
1050 unsigned int dontMangle;
1053 } __attribute__ ((gcc_struct));
1055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1059 struct MembersInit * prev;
1060 struct MembersInit * next;
1061 struct Location loc;
1065 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1066 struct ClassFunction * function;
1067 } __attribute__ ((gcc_struct));
1068 } __attribute__ ((gcc_struct));
1070 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1074 struct MemberInit * prev;
1075 struct MemberInit * next;
1076 struct Location loc;
1077 struct Location realLoc;
1078 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1079 struct Initializer * initializer;
1081 unsigned int variable;
1082 unsigned int takeOutExp;
1083 } __attribute__ ((gcc_struct));
1085 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1089 struct PropertyDef * prev;
1090 struct PropertyDef * next;
1091 struct Location loc;
1092 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1093 struct Declarator * declarator;
1094 struct Identifier * id;
1095 struct Statement * getStmt;
1096 struct Statement * setStmt;
1097 struct Statement * issetStmt;
1098 struct Symbol * symbol;
1099 unsigned int conversion;
1100 unsigned int isWatchable;
1101 struct Expression * category;
1102 } __attribute__ ((gcc_struct));
1104 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1106 struct PropertyWatch
1108 struct PropertyWatch * prev;
1109 struct PropertyWatch * next;
1110 struct Location loc;
1111 struct Statement * compound;
1112 struct __ecereNameSpace__ecere__sys__OldList * properties;
1113 unsigned int deleteWatch;
1114 } __attribute__ ((gcc_struct));
1116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1120 struct ClassDef * prev;
1121 struct ClassDef * next;
1122 struct Location loc;
1126 struct Declaration * decl;
1127 struct ClassFunction * function;
1128 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1129 struct PropertyDef * propertyDef;
1130 struct PropertyWatch * propertyWatch;
1132 struct Identifier * defaultProperty;
1135 struct Identifier * id;
1136 struct Initializer * initializer;
1137 } __attribute__ ((gcc_struct));
1138 } __attribute__ ((gcc_struct));
1141 } __attribute__ ((gcc_struct));
1143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1145 struct DBTableEntry;
1147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1151 extern YYSTYPE yylval;
1153 extern struct Location yylloc;
1155 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1157 extern int returnCode;
1159 extern struct Expression * parsedExpression;
1161 extern unsigned int yydebug;
1163 void SetYydebug(unsigned int b)
1168 extern unsigned int echoOn;
1170 void resetScanner();
1174 int expression_yyparse();
1176 static struct Statement * curCompound;
1178 struct External * curExternal, * afterExternal;
1180 static struct Type * curSwitchType;
1182 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1184 struct __ecereNameSpace__ecere__com__Class * thisClass;
1186 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1191 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1196 static char * thisNameSpace;
1198 struct __ecereNameSpace__ecere__com__Class * containerClass;
1200 unsigned int thisClassParams = 0x1;
1202 unsigned int internalValueCounter;
1204 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1206 struct __ecereNameSpace__ecere__sys__TempFile
1208 char __ecere_padding[24];
1209 } __attribute__ ((gcc_struct));
1211 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1213 extern int strlen(const char * );
1215 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1217 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1219 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1221 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1223 void PrintExpression(struct Expression * exp, char * string)
1226 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1230 OutputExpression(exp, f);
1231 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1232 count = strlen(string);
1233 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1234 string[count] = '\0';
1235 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1239 extern int isspace(int c);
1241 long long _strtoi64(char * string, char ** endString, int base)
1243 long long value = 0;
1248 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1260 if(ch == (char)0 && string[c + 1] == 'x')
1273 for(; (ch = string[c]); c++)
1277 else if(ch >= '1' && ch <= '9')
1279 else if(ch >= 'a' && ch <= 'z')
1281 else if(ch >= 'A' && ch <= 'Z')
1286 *endString = string + c;
1297 *endString = string + c;
1301 return sign * value;
1304 uint64 _strtoui64(char * string, char ** endString, int base)
1311 for(c = 0; (ch = string[c]) && isspace(ch); c++)
1323 if(ch == (char)0 && string[c + 1] == 'x')
1336 for(; (ch = string[c]); c++)
1340 else if(ch >= '1' && ch <= '9')
1342 else if(ch >= 'a' && ch <= 'z')
1344 else if(ch >= 'A' && ch <= 'Z')
1349 *endString = string + c;
1360 *endString = string + c;
1364 return sign * value;
1367 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1369 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1371 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1373 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1375 if(!param->baseType)
1377 if(param->dataTypeString)
1378 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1380 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1382 return param->baseType;
1384 return (((void *)0));
1387 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1389 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1391 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1395 if(type1->kind == type2->kind)
1404 if(type1->passAsTemplate && !type2->passAsTemplate)
1406 return type1->isSigned != type2->isSigned;
1408 return type1->_class != type2->_class;
1410 return NeedCast(type1->type, type2->type);
1418 extern int strcmp(const char * , const char * );
1420 extern struct Context * curContext;
1422 extern struct Context * topContext;
1424 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1426 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);
1428 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1430 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);
1432 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);
1434 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1436 struct __ecereNameSpace__ecere__com__ClassProperty
1439 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1440 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1441 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1443 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1444 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1445 char * dataTypeString;
1446 struct Type * dataType;
1447 unsigned int constant;
1448 } __attribute__ ((gcc_struct));
1450 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1452 extern struct Expression * QMkExpId(char * id);
1454 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1456 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1458 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1459 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1464 char * dataTypeString;
1466 } __attribute__ ((gcc_struct));
1467 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1469 char __ecere_padding[4];
1470 } __attribute__ ((gcc_struct));
1472 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1474 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1476 extern void FreeIdentifier(struct Identifier * id);
1478 void ProcessExpressionType(struct Expression * exp);
1480 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1482 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1484 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1486 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1488 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1490 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1492 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1494 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1496 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1498 if(exp->type == 0 && exp->identifier)
1500 struct Identifier * id = exp->identifier;
1501 struct Context * ctx;
1502 struct Symbol * symbol = (((void *)0));
1504 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1506 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1508 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1513 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1515 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1516 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1517 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1518 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1522 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1524 if(!prop && !method)
1525 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1526 if(!prop && !method && !member)
1528 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1530 if(prop || method || member || classProp)
1533 exp->member.member = id;
1534 exp->member.memberType = 0;
1535 exp->member.exp = QMkExpId("this");
1536 exp->addedThis = 0x1;
1538 else if(_class && _class->templateParams.first)
1540 struct __ecereNameSpace__ecere__com__Class * sClass;
1542 for(sClass = _class; sClass; sClass = sClass->base)
1544 if(sClass->templateParams.first)
1546 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1548 for(param = sClass->templateParams.first; param; param = param->next)
1550 if(param->type == 2 && !strcmp(param->name, id->string))
1552 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1556 struct Declarator * decl;
1557 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1559 FreeIdentifier(exp->member.member);
1560 ProcessExpressionType(argExp);
1561 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1562 exp->expType = ProcessType(specs, decl);
1564 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1575 extern int sprintf(char * , char * , ...);
1577 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1579 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1581 char * PrintInt(long long result)
1585 if(result > (((long long)0x7fffffffffffffffLL)))
1586 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1588 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1589 return __ecereNameSpace__ecere__sys__CopyString(temp);
1592 char * PrintUInt(uint64 result)
1596 if(result > (0xffffffff))
1597 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1598 else if(result > (((int)0x7fffffff)))
1599 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1601 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1602 return __ecereNameSpace__ecere__sys__CopyString(temp);
1605 char * PrintInt64(long long result)
1609 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1610 return __ecereNameSpace__ecere__sys__CopyString(temp);
1613 char * PrintUInt64(uint64 result)
1617 if(result > (((long long)0x7fffffffffffffffLL)))
1618 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1620 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1621 return __ecereNameSpace__ecere__sys__CopyString(temp);
1624 char * PrintHexUInt(uint64 result)
1628 if(result > (0xffffffff))
1629 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1631 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1632 return __ecereNameSpace__ecere__sys__CopyString(temp);
1635 char * PrintHexUInt64(uint64 result)
1639 if(result > (0xffffffff))
1640 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1642 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1643 return __ecereNameSpace__ecere__sys__CopyString(temp);
1646 char * PrintShort(short result)
1650 sprintf(temp, "%d", (unsigned short)result);
1651 return __ecereNameSpace__ecere__sys__CopyString(temp);
1654 char * PrintUShort(unsigned short result)
1658 if(result > (unsigned short)32767)
1659 sprintf(temp, "0x%X", (int)result);
1661 sprintf(temp, "%d", result);
1662 return __ecereNameSpace__ecere__sys__CopyString(temp);
1665 extern int isprint(int c);
1667 char * PrintChar(char result)
1671 if(result > (char)0 && isprint(result))
1672 sprintf(temp, "'%c'", result);
1673 else if(result < (char)0)
1674 sprintf(temp, "%d", result);
1676 sprintf(temp, "0x%X", (unsigned char)result);
1677 return __ecereNameSpace__ecere__sys__CopyString(temp);
1680 char * PrintUChar(unsigned char result)
1684 sprintf(temp, "0x%X", result);
1685 return __ecereNameSpace__ecere__sys__CopyString(temp);
1688 char * PrintFloat(float result)
1692 sprintf(temp, "%.16ff", result);
1693 return __ecereNameSpace__ecere__sys__CopyString(temp);
1696 char * PrintDouble(double result)
1700 sprintf(temp, "%.16f", result);
1701 return __ecereNameSpace__ecere__sys__CopyString(temp);
1704 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1708 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1709 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1710 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1711 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1712 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1713 unsigned int (* Neg)(struct Expression *, struct Operand *);
1714 unsigned int (* Inc)(struct Expression *, struct Operand *);
1715 unsigned int (* Dec)(struct Expression *, struct Operand *);
1716 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1717 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1718 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1719 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1720 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1721 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1722 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1723 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1724 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1725 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1726 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1727 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1728 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1729 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1730 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1731 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1732 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1733 unsigned int (* Not)(struct Expression *, struct Operand *);
1734 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1735 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1736 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1737 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1738 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1739 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1740 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1741 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1742 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1743 } __attribute__ ((gcc_struct));
1745 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1751 unsigned int ptrSize;
1767 } __attribute__ ((gcc_struct));
1769 } __attribute__ ((gcc_struct));
1771 struct Operand GetOperand(struct Expression * exp);
1773 unsigned int GetInt(struct Expression * exp, int * value2)
1775 struct Operand op2 = GetOperand(exp);
1777 if(op2.kind == 3 && op2.type->isSigned)
1779 else if(op2.kind == 3)
1780 *value2 = (int)op2.ui;
1781 if(op2.kind == 4 && op2.type->isSigned)
1782 *value2 = (int)op2.i64;
1783 else if(op2.kind == 4)
1784 *value2 = (int)op2.ui64;
1785 else if(op2.kind == 22 && op2.type->isSigned)
1786 *value2 = (int)op2.iptr;
1787 else if(op2.kind == 22)
1788 *value2 = (int)op2.uiptr;
1789 else if(op2.kind == 2 && op2.type->isSigned)
1790 *value2 = (int)op2.s;
1791 else if(op2.kind == 2)
1792 *value2 = (int)op2.us;
1793 else if(op2.kind == 1 && op2.type->isSigned)
1794 *value2 = (int)op2.c;
1795 else if(op2.kind == 1)
1796 *value2 = (int)op2.uc;
1797 else if(op2.kind == 6)
1798 *value2 = (int)op2.f;
1799 else if(op2.kind == 7)
1800 *value2 = (int)op2.d;
1801 else if(op2.kind == 13)
1802 *value2 = (int)op2.ui;
1808 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1810 struct Operand op2 = GetOperand(exp);
1812 if(op2.kind == 3 && op2.type->isSigned)
1813 *value2 = (unsigned int)op2.i;
1814 else if(op2.kind == 3)
1816 if(op2.kind == 4 && op2.type->isSigned)
1817 *value2 = (unsigned int)op2.i64;
1818 else if(op2.kind == 4)
1819 *value2 = (unsigned int)op2.ui64;
1820 else if(op2.kind == 22 && op2.type->isSigned)
1821 *value2 = (unsigned int)op2.iptr;
1822 else if(op2.kind == 22)
1823 *value2 = (unsigned int)op2.uiptr;
1824 else if(op2.kind == 2 && op2.type->isSigned)
1825 *value2 = (unsigned int)op2.s;
1826 else if(op2.kind == 2)
1827 *value2 = (unsigned int)op2.us;
1828 else if(op2.kind == 1 && op2.type->isSigned)
1829 *value2 = (unsigned int)op2.c;
1830 else if(op2.kind == 1)
1831 *value2 = (unsigned int)op2.uc;
1832 else if(op2.kind == 6)
1833 *value2 = (unsigned int)op2.f;
1834 else if(op2.kind == 7)
1835 *value2 = (unsigned int)op2.d;
1836 else if(op2.kind == 13)
1843 unsigned int GetInt64(struct Expression * exp, long long * value2)
1845 struct Operand op2 = GetOperand(exp);
1847 if(op2.kind == 3 && op2.type->isSigned)
1848 *value2 = (long long)op2.i;
1849 else if(op2.kind == 3)
1850 *value2 = (long long)op2.ui;
1851 if(op2.kind == 4 && op2.type->isSigned)
1853 else if(op2.kind == 4)
1854 *value2 = (long long)op2.ui64;
1855 else if(op2.kind == 22 && op2.type->isSigned)
1856 *value2 = (long long)op2.iptr;
1857 else if(op2.kind == 22)
1858 *value2 = (long long)op2.uiptr;
1859 else if(op2.kind == 2 && op2.type->isSigned)
1860 *value2 = (long long)op2.s;
1861 else if(op2.kind == 2)
1862 *value2 = (long long)op2.us;
1863 else if(op2.kind == 1 && op2.type->isSigned)
1864 *value2 = (long long)op2.c;
1865 else if(op2.kind == 1)
1866 *value2 = (long long)op2.uc;
1867 else if(op2.kind == 6)
1868 *value2 = (long long)op2.f;
1869 else if(op2.kind == 7)
1870 *value2 = (long long)op2.d;
1871 else if(op2.kind == 13)
1872 *value2 = (long long)op2.ui;
1878 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1880 struct Operand op2 = GetOperand(exp);
1882 if(op2.kind == 3 && op2.type->isSigned)
1883 *value2 = (uint64)op2.i;
1884 else if(op2.kind == 3)
1885 *value2 = (uint64)op2.ui;
1886 if(op2.kind == 4 && op2.type->isSigned)
1887 *value2 = (uint64)op2.i64;
1888 else if(op2.kind == 4)
1890 else if(op2.kind == 22 && op2.type->isSigned)
1891 *value2 = (uint64)op2.iptr;
1892 else if(op2.kind == 22)
1893 *value2 = (uint64)op2.uiptr;
1894 else if(op2.kind == 2 && op2.type->isSigned)
1895 *value2 = (uint64)op2.s;
1896 else if(op2.kind == 2)
1897 *value2 = (uint64)op2.us;
1898 else if(op2.kind == 1 && op2.type->isSigned)
1899 *value2 = (uint64)op2.c;
1900 else if(op2.kind == 1)
1901 *value2 = (uint64)op2.uc;
1902 else if(op2.kind == 6)
1903 *value2 = (uint64)op2.f;
1904 else if(op2.kind == 7)
1905 *value2 = (uint64)op2.d;
1906 else if(op2.kind == 13)
1907 *value2 = (uint64)op2.ui;
1913 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1915 struct Operand op2 = GetOperand(exp);
1917 if(op2.kind == 3 && op2.type->isSigned)
1918 *value2 = (intptr_t)op2.i;
1919 else if(op2.kind == 3)
1920 *value2 = (intptr_t)op2.ui;
1921 if(op2.kind == 4 && op2.type->isSigned)
1922 *value2 = (intptr_t)op2.i64;
1923 else if(op2.kind == 4)
1924 *value2 = (intptr_t)op2.ui64;
1925 else if(op2.kind == 22 && op2.type->isSigned)
1927 else if(op2.kind == 22)
1928 *value2 = (intptr_t)op2.uiptr;
1929 else if(op2.kind == 2 && op2.type->isSigned)
1930 *value2 = (intptr_t)op2.s;
1931 else if(op2.kind == 2)
1932 *value2 = (intptr_t)op2.us;
1933 else if(op2.kind == 1 && op2.type->isSigned)
1934 *value2 = (intptr_t)op2.c;
1935 else if(op2.kind == 1)
1936 *value2 = (intptr_t)op2.uc;
1937 else if(op2.kind == 6)
1938 *value2 = (intptr_t)op2.f;
1939 else if(op2.kind == 7)
1940 *value2 = (intptr_t)op2.d;
1941 else if(op2.kind == 13)
1942 *value2 = (intptr_t)op2.ui;
1948 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1950 struct Operand op2 = GetOperand(exp);
1952 if(op2.kind == 3 && op2.type->isSigned)
1953 *value2 = (uintptr_t)op2.i;
1954 else if(op2.kind == 3)
1955 *value2 = (uintptr_t)op2.ui;
1956 if(op2.kind == 4 && op2.type->isSigned)
1957 *value2 = (uintptr_t)op2.i64;
1958 else if(op2.kind == 4)
1959 *value2 = (uintptr_t)op2.ui64;
1960 else if(op2.kind == 22 && op2.type->isSigned)
1961 *value2 = (uintptr_t)op2.iptr;
1962 else if(op2.kind == 22)
1963 *value2 = op2.uiptr;
1964 else if(op2.kind == 2 && op2.type->isSigned)
1965 *value2 = (uintptr_t)op2.s;
1966 else if(op2.kind == 2)
1967 *value2 = (uintptr_t)op2.us;
1968 else if(op2.kind == 1 && op2.type->isSigned)
1969 *value2 = (uintptr_t)op2.c;
1970 else if(op2.kind == 1)
1971 *value2 = (uintptr_t)op2.uc;
1972 else if(op2.kind == 6)
1973 *value2 = (uintptr_t)op2.f;
1974 else if(op2.kind == 7)
1975 *value2 = (uintptr_t)op2.d;
1976 else if(op2.kind == 13)
1977 *value2 = (uintptr_t)op2.ui;
1983 unsigned int GetShort(struct Expression * exp, short * value2)
1985 struct Operand op2 = GetOperand(exp);
1987 if(op2.kind == 3 && op2.type->isSigned)
1988 *value2 = (short)op2.i;
1989 else if(op2.kind == 3)
1990 *value2 = (short)op2.ui;
1991 if(op2.kind == 4 && op2.type->isSigned)
1992 *value2 = (short)op2.i64;
1993 else if(op2.kind == 4)
1994 *value2 = (short)op2.ui64;
1995 else if(op2.kind == 22 && op2.type->isSigned)
1996 *value2 = (short)op2.iptr;
1997 else if(op2.kind == 22)
1998 *value2 = (short)op2.uiptr;
1999 else if(op2.kind == 2 && op2.type->isSigned)
2001 else if(op2.kind == 2)
2002 *value2 = (short)op2.us;
2003 else if(op2.kind == 1 && op2.type->isSigned)
2004 *value2 = (short)op2.c;
2005 else if(op2.kind == 1)
2006 *value2 = (short)op2.uc;
2007 else if(op2.kind == 6)
2008 *value2 = (short)op2.f;
2009 else if(op2.kind == 7)
2010 *value2 = (short)op2.d;
2011 else if(op2.kind == 13)
2012 *value2 = (short)op2.ui;
2018 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2020 struct Operand op2 = GetOperand(exp);
2022 if(op2.kind == 3 && op2.type->isSigned)
2023 *value2 = (unsigned short)op2.i;
2024 else if(op2.kind == 3)
2025 *value2 = (unsigned short)op2.ui;
2026 if(op2.kind == 4 && op2.type->isSigned)
2027 *value2 = (unsigned short)op2.i64;
2028 else if(op2.kind == 4)
2029 *value2 = (unsigned short)op2.ui64;
2030 else if(op2.kind == 22 && op2.type->isSigned)
2031 *value2 = (unsigned short)op2.iptr;
2032 else if(op2.kind == 22)
2033 *value2 = (unsigned short)op2.uiptr;
2034 else if(op2.kind == 2 && op2.type->isSigned)
2035 *value2 = (unsigned short)op2.s;
2036 else if(op2.kind == 2)
2038 else if(op2.kind == 1 && op2.type->isSigned)
2039 *value2 = (unsigned short)op2.c;
2040 else if(op2.kind == 1)
2041 *value2 = (unsigned short)op2.uc;
2042 else if(op2.kind == 6)
2043 *value2 = (unsigned short)op2.f;
2044 else if(op2.kind == 7)
2045 *value2 = (unsigned short)op2.d;
2046 else if(op2.kind == 13)
2047 *value2 = (unsigned short)op2.ui;
2053 unsigned int GetChar(struct Expression * exp, char * value2)
2055 struct Operand op2 = GetOperand(exp);
2057 if(op2.kind == 3 && op2.type->isSigned)
2058 *value2 = (char)op2.i;
2059 else if(op2.kind == 3)
2060 *value2 = (char)op2.ui;
2061 if(op2.kind == 4 && op2.type->isSigned)
2062 *value2 = (char)op2.i64;
2063 else if(op2.kind == 4)
2064 *value2 = (char)op2.ui64;
2065 else if(op2.kind == 22 && op2.type->isSigned)
2066 *value2 = (char)op2.iptr;
2067 else if(op2.kind == 22)
2068 *value2 = (char)op2.uiptr;
2069 else if(op2.kind == 2 && op2.type->isSigned)
2070 *value2 = (char)op2.s;
2071 else if(op2.kind == 2)
2072 *value2 = (char)op2.us;
2073 else if(op2.kind == 1 && op2.type->isSigned)
2075 else if(op2.kind == 1)
2076 *value2 = (char)op2.uc;
2077 else if(op2.kind == 6)
2078 *value2 = (char)op2.f;
2079 else if(op2.kind == 7)
2080 *value2 = (char)op2.d;
2081 else if(op2.kind == 13)
2082 *value2 = (char)op2.ui;
2088 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2090 struct Operand op2 = GetOperand(exp);
2092 if(op2.kind == 3 && op2.type->isSigned)
2093 *value2 = (unsigned char)op2.i;
2094 else if(op2.kind == 3)
2095 *value2 = (unsigned char)op2.ui;
2096 if(op2.kind == 4 && op2.type->isSigned)
2097 *value2 = (unsigned char)op2.i64;
2098 else if(op2.kind == 4)
2099 *value2 = (unsigned char)op2.ui64;
2100 else if(op2.kind == 22 && op2.type->isSigned)
2101 *value2 = (unsigned char)op2.iptr;
2102 else if(op2.kind == 22)
2103 *value2 = (unsigned char)op2.uiptr;
2104 else if(op2.kind == 2 && op2.type->isSigned)
2105 *value2 = (unsigned char)op2.s;
2106 else if(op2.kind == 2)
2107 *value2 = (unsigned char)op2.us;
2108 else if(op2.kind == 1 && op2.type->isSigned)
2109 *value2 = (unsigned char)op2.c;
2110 else if(op2.kind == 1)
2112 else if(op2.kind == 6)
2113 *value2 = (unsigned char)op2.f;
2114 else if(op2.kind == 7)
2115 *value2 = (unsigned char)op2.d;
2116 else if(op2.kind == 13)
2117 *value2 = (unsigned char)op2.ui;
2123 unsigned int GetFloat(struct Expression * exp, float * value2)
2125 struct Operand op2 = GetOperand(exp);
2127 if(op2.kind == 3 && op2.type->isSigned)
2128 *value2 = (float)(float)op2.i;
2129 else if(op2.kind == 3)
2130 *value2 = (float)(float)op2.ui;
2131 if(op2.kind == 4 && op2.type->isSigned)
2132 *value2 = (float)(float)op2.i64;
2133 else if(op2.kind == 4)
2134 *value2 = (float)(float)op2.ui64;
2135 else if(op2.kind == 22 && op2.type->isSigned)
2136 *value2 = (float)op2.iptr;
2137 else if(op2.kind == 22)
2138 *value2 = (float)op2.uiptr;
2139 else if(op2.kind == 2 && op2.type->isSigned)
2140 *value2 = (float)(float)op2.s;
2141 else if(op2.kind == 2)
2142 *value2 = (float)(float)op2.us;
2143 else if(op2.kind == 1 && op2.type->isSigned)
2144 *value2 = (float)(float)op2.c;
2145 else if(op2.kind == 1)
2146 *value2 = (float)(float)op2.uc;
2147 else if(op2.kind == 6)
2148 *value2 = (float)op2.f;
2149 else if(op2.kind == 7)
2150 *value2 = (float)op2.d;
2151 else if(op2.kind == 13)
2152 *value2 = (float)(float)op2.ui;
2158 unsigned int GetDouble(struct Expression * exp, double * value2)
2160 struct Operand op2 = GetOperand(exp);
2162 if(op2.kind == 3 && op2.type->isSigned)
2163 *value2 = (double)(double)op2.i;
2164 else if(op2.kind == 3)
2165 *value2 = (double)(double)op2.ui;
2166 if(op2.kind == 4 && op2.type->isSigned)
2167 *value2 = (double)(double)op2.i64;
2168 else if(op2.kind == 4)
2169 *value2 = (double)(double)op2.ui64;
2170 else if(op2.kind == 22 && op2.type->isSigned)
2171 *value2 = (double)op2.iptr;
2172 else if(op2.kind == 22)
2173 *value2 = (double)op2.uiptr;
2174 else if(op2.kind == 2 && op2.type->isSigned)
2175 *value2 = (double)(double)op2.s;
2176 else if(op2.kind == 2)
2177 *value2 = (double)(double)op2.us;
2178 else if(op2.kind == 1 && op2.type->isSigned)
2179 *value2 = (double)(double)op2.c;
2180 else if(op2.kind == 1)
2181 *value2 = (double)(double)op2.uc;
2182 else if(op2.kind == 6)
2183 *value2 = (double)op2.f;
2184 else if(op2.kind == 7)
2185 *value2 = (double)op2.d;
2186 else if(op2.kind == 13)
2187 *value2 = (double)(double)op2.ui;
2193 void ComputeExpression(struct Expression * exp);
2195 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2197 int ComputeTypeSize(struct Type * type);
2199 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2201 struct __ecereNameSpace__ecere__com__BitMember
2203 struct __ecereNameSpace__ecere__com__BitMember * prev;
2204 struct __ecereNameSpace__ecere__com__BitMember * next;
2206 unsigned int isProperty;
2209 struct __ecereNameSpace__ecere__com__Class * _class;
2210 char * dataTypeString;
2211 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2212 struct Type * dataType;
2217 } __attribute__ ((gcc_struct));
2219 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2221 struct __ecereNameSpace__ecere__sys__OldLink
2223 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2224 struct __ecereNameSpace__ecere__sys__OldLink * next;
2226 } __attribute__ ((gcc_struct));
2228 void FinishTemplatesContext(struct Context * context);
2230 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2232 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2233 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2235 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || _class->structSize == _class->offset) && _class->computeSize))
2238 int unionMemberOffset = 0;
2241 if(!member && _class->destructionWatchOffset)
2242 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2244 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2246 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2248 if(!dataMember->isProperty)
2250 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2252 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2258 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2260 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2262 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2264 if(!isMember && _class->type == 2 && dataMember->dataType)
2266 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2270 ComputeTypeSize(dataMember->dataType);
2271 if(bitMember->pos == -1)
2272 bitMember->pos = _class->memberOffset;
2273 if(!bitMember->size)
2274 bitMember->size = dataMember->dataType->size * 8;
2275 _class->memberOffset = bitMember->pos + bitMember->size;
2276 for(d = 0; d < bitMember->size; d++)
2282 bitMember->mask = mask << bitMember->pos;
2284 else if(dataMember->type == 0 && dataMember->dataType)
2289 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2290 ComputeTypeSize(dataMember->dataType);
2291 if(dataMember->dataType->bitFieldCount)
2293 bitFields += dataMember->dataType->bitFieldCount;
2300 int size = (bitFields + 7) / 8;
2304 int __simpleStruct0;
2308 int __simpleStruct0;
2310 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2311 if(member->memberOffset % alignment)
2312 member->memberOffset += alignment - (member->memberOffset % alignment);
2314 dataMember->offset = member->memberOffset;
2315 if(member->type == 1)
2316 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2319 member->memberOffset += size;
2326 int __simpleStruct0;
2328 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2329 if(_class->memberOffset % alignment)
2330 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2332 dataMember->offset = _class->memberOffset;
2333 _class->memberOffset += size;
2337 size = dataMember->dataType->size;
2338 alignment = dataMember->dataType->alignment;
2342 int __simpleStruct0;
2346 int __simpleStruct0;
2348 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2349 if(member->memberOffset % alignment)
2350 member->memberOffset += alignment - (member->memberOffset % alignment);
2352 dataMember->offset = member->memberOffset;
2353 if(member->type == 1)
2354 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2357 member->memberOffset += size;
2364 int __simpleStruct0;
2366 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2367 if(_class->memberOffset % alignment)
2368 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2370 dataMember->offset = _class->memberOffset;
2371 _class->memberOffset += size;
2376 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2379 int __simpleStruct2;
2380 int __simpleStruct0, __simpleStruct1;
2382 member->structAlignment = (__simpleStruct0 = member->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2383 dataMember->offset = member->memberOffset;
2384 if(member->type == 1)
2385 unionMemberOffset = (__simpleStruct2 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct2) ? unionMemberOffset : __simpleStruct2);
2387 member->memberOffset += dataMember->memberOffset;
2391 int __simpleStruct0, __simpleStruct1;
2393 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, __simpleStruct1 = dataMember->structAlignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2394 dataMember->offset = _class->memberOffset;
2395 _class->memberOffset += dataMember->memberOffset;
2403 int size = (bitFields + 7) / 8;
2407 int __simpleStruct0;
2411 int __simpleStruct0;
2413 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2414 if(member->memberOffset % alignment)
2415 member->memberOffset += alignment - (member->memberOffset % alignment);
2417 if(member->type == 1)
2418 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2421 member->memberOffset += size;
2428 int __simpleStruct0;
2430 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2431 if(_class->memberOffset % alignment)
2432 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2434 _class->memberOffset += size;
2439 if(member && member->type == 1)
2441 member->memberOffset = unionMemberOffset;
2445 if(_class->type != 2)
2447 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset;
2450 struct __ecereNameSpace__ecere__com__Property * prop;
2452 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2454 if(prop->isProperty && prop->isWatchable)
2456 prop->watcherOffset = _class->structSize;
2457 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2462 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2464 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2466 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2468 if(deriv->computeSize)
2470 deriv->offset = _class->structSize;
2471 deriv->memberOffset = 0;
2472 deriv->structSize = deriv->offset;
2473 ComputeClassMembers(deriv, 0x0);
2481 FinishTemplatesContext(context);
2484 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2486 struct __ecereNameSpace__ecere__com__NameSpace
2489 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2490 struct __ecereNameSpace__ecere__com__NameSpace * left;
2491 struct __ecereNameSpace__ecere__com__NameSpace * right;
2493 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2494 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2495 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2496 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2497 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2498 } __attribute__ ((gcc_struct));
2500 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2502 struct __ecereNameSpace__ecere__com__Module
2504 struct __ecereNameSpace__ecere__com__Instance * application;
2505 struct __ecereNameSpace__ecere__sys__OldList classes;
2506 struct __ecereNameSpace__ecere__sys__OldList defines;
2507 struct __ecereNameSpace__ecere__sys__OldList functions;
2508 struct __ecereNameSpace__ecere__sys__OldList modules;
2509 struct __ecereNameSpace__ecere__com__Instance * prev;
2510 struct __ecereNameSpace__ecere__com__Instance * next;
2516 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2517 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2518 } __attribute__ ((gcc_struct));
2520 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2522 struct __ecereNameSpace__ecere__com__Class * _class;
2523 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2525 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->modules.first; subModule; subModule = subModule->next)
2526 ComputeModuleClasses(subModule->data);
2527 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
2528 ComputeClassMembers(_class, 0x0);
2531 extern int targetBits;
2533 extern unsigned int inCompiler;
2535 extern void Compiler_Error(char * format, ...);
2537 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2539 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2541 int ComputeTypeSize(struct Type * type)
2543 unsigned int size = type ? type->size : 0;
2545 if(!size && type && !type->computing)
2547 type->computing = 0x1;
2551 type->alignment = size = sizeof(char);
2554 type->alignment = size = sizeof(int);
2557 type->alignment = size = sizeof(long long);
2560 type->alignment = size = targetBits / 8;
2563 type->alignment = size = sizeof(long);
2566 type->alignment = size = sizeof(short);
2569 type->alignment = size = sizeof(float);
2572 type->alignment = size = sizeof(double);
2576 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2578 if(_class && _class->type == 1)
2580 ComputeClassMembers(_class, 0x0);
2581 type->alignment = _class->structAlignment;
2582 size = _class->structSize;
2583 if(type->alignment && size % type->alignment)
2584 size += type->alignment - (size % type->alignment);
2586 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2588 if(!_class->dataType)
2589 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2590 size = type->alignment = ComputeTypeSize(_class->dataType);
2593 size = type->alignment = targetBits / 8;
2598 size = type->alignment = targetBits / 8;
2601 if(type->arraySizeExp)
2603 ProcessExpressionType(type->arraySizeExp);
2604 ComputeExpression(type->arraySizeExp);
2605 if(!type->arraySizeExp->isConstant || (type->arraySizeExp->expType->kind != 3 && type->arraySizeExp->expType->kind != 15 && (type->arraySizeExp->expType->kind != 8 || !type->arraySizeExp->expType->_class->registered || type->arraySizeExp->expType->_class->registered->type != 4)))
2607 struct Location oldLoc = yylloc;
2608 char expression[10240];
2610 expression[0] = '\0';
2611 type->arraySizeExp->expType = (((void *)0));
2612 yylloc = type->arraySizeExp->loc;
2614 PrintExpression(type->arraySizeExp, expression);
2615 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2618 GetInt(type->arraySizeExp, &type->arraySize);
2620 else if(type->enumClass)
2622 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2624 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2627 type->arraySize = 0;
2631 type->arraySize = 0;
2633 size = ComputeTypeSize(type->type) * type->arraySize;
2634 type->alignment = type->type->alignment;
2638 struct Type * member;
2640 for(member = type->members.first; member; member = member->next)
2642 int __simpleStruct0, __simpleStruct1;
2643 unsigned int addSize = ComputeTypeSize(member);
2645 member->offset = size;
2646 if(member->alignment && size % member->alignment)
2647 member->offset += member->alignment - (size % member->alignment);
2648 size = member->offset;
2649 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2652 if(type->alignment && size % type->alignment)
2653 size += type->alignment - (size % type->alignment);
2658 struct Type * member;
2660 for(member = type->members.first; member; member = member->next)
2662 int __simpleStruct0, __simpleStruct1;
2663 unsigned int addSize = ComputeTypeSize(member);
2665 member->offset = size;
2666 if(member->alignment && size % member->alignment)
2667 member->offset += member->alignment - (size % member->alignment);
2668 size = member->offset;
2669 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2670 size = ((size > addSize) ? size : addSize);
2672 if(type->alignment && size % type->alignment)
2673 size += type->alignment - (size % type->alignment);
2678 struct TemplateParameter * param = type->templateParameter;
2679 struct Type * baseType = ProcessTemplateParameterType(param);
2682 size = ComputeTypeSize(baseType);
2684 size = sizeof(uint64);
2697 size = targetBits / 8;
2702 type->computing = 0x0;
2707 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2709 extern struct Identifier * MkIdentifier(char * string);
2711 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2713 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2715 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2717 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2719 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2721 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2723 extern void FreeType(struct Type * type);
2725 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2727 extern struct Specifier * MkSpecifier(int specifier);
2729 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2731 extern struct Expression * MkExpConstant(char * string);
2733 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)
2735 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2736 unsigned int totalSize = 0;
2737 unsigned int maxSize = 0;
2738 int alignment, size;
2739 struct __ecereNameSpace__ecere__com__DataMember * member;
2740 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2742 if(!isMember && _class->base)
2744 maxSize = _class->structSize;
2746 if(_class->type == 1 || _class->type == 5)
2747 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass);
2749 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2752 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2754 if(!member->isProperty)
2756 switch(member->type)
2760 if(member->dataTypeString)
2762 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2763 struct Declarator * decl;
2765 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2766 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2767 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2768 if(!member->dataType)
2769 member->dataType = ProcessType(specs, decl);
2770 ReplaceThisClassSpecifiers(specs, topClass);
2772 struct Type * type = ProcessType(specs, decl);
2774 DeclareType(member->dataType, 0x0, 0x0);
2777 ComputeTypeSize(member->dataType);
2778 size = member->dataType->size;
2779 alignment = member->dataType->alignment;
2782 if(totalSize % alignment)
2783 totalSize += alignment - (totalSize % alignment);
2792 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2795 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass);
2796 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2797 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2798 alignment = member->structAlignment;
2801 if(totalSize % alignment)
2802 totalSize += alignment - (totalSize % alignment);
2812 unsigned int __simpleStruct0;
2814 if(topMember && topMember->type == 1)
2815 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2817 *retSize += totalSize;
2819 else if(totalSize < maxSize && _class->type != 1000)
2821 char sizeString[50];
2823 sprintf(sizeString, "%d", maxSize - totalSize);
2824 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2827 FinishTemplatesContext(context);
2828 return topMember ? topMember->memberID : _class->memberID;
2831 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2833 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2834 unsigned int totalSize = 0;
2835 struct __ecereNameSpace__ecere__com__DataMember * member;
2836 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2838 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2839 DeclareMembers(_class->base, 0x0);
2840 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2842 if(!member->isProperty)
2844 switch(member->type)
2848 if(!member->dataType && member->dataTypeString)
2849 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2850 if(member->dataType)
2851 DeclareType(member->dataType, 0x0, 0x0);
2857 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2864 FinishTemplatesContext(context);
2865 return topMember ? topMember->memberID : _class->memberID;
2868 extern struct Symbol * FindClass(char * name);
2870 extern char * strchr(char * , int);
2872 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2874 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2876 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2878 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2880 extern char * strcpy(char * , const char * );
2882 extern void MangleClassName(char * className);
2884 extern void DeclareClass(struct Symbol * classSym, char * className);
2886 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2888 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2890 void DeclareStruct(char * name, unsigned int skipNoHead)
2892 struct External * external = (((void *)0));
2893 struct Symbol * classSym = FindClass(name);
2895 if(!inCompiler || !classSym)
2896 return (((void *)0));
2897 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2898 return (((void *)0));
2899 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2901 struct Declaration * decl;
2902 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2903 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2904 char structName[1024];
2906 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2907 classSym->declaring++;
2908 if(strchr(classSym->string, '<'))
2910 if(classSym->registered->templateClass)
2912 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2913 classSym->declaring--;
2915 return (((void *)0));
2917 DeclareMembers(classSym->registered, 0x0);
2918 structName[0] = (char)0;
2919 FullClassNameCat(structName, name, 0x0);
2922 classSym->declaredStructSym = 0x1;
2923 declarations = MkList();
2924 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered);
2925 if(!(*declarations).count)
2927 FreeList(declarations, (((void *)0)));
2928 declarations = (((void *)0));
2931 if(skipNoHead || declarations)
2933 if(external && external->declaration)
2935 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2936 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2938 if(classSym->structExternal)
2939 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2940 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2941 classSym->id = curExternal->symbol->idCode;
2942 classSym->idCode = curExternal->symbol->idCode;
2948 external = MkExternalDeclaration((((void *)0)));
2949 specifiers = MkList();
2950 declarators = MkList();
2951 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2952 external->declaration = decl = MkDeclaration(specifiers, declarators);
2953 if(decl->symbol && !decl->symbol->pointerExternal)
2954 decl->symbol->pointerExternal = external;
2955 if(classSym->registered && classSym->registered->type == 1)
2957 char className[1024];
2959 strcpy(className, "__ecereClass_");
2960 FullClassNameCat(className, classSym->string, 0x1);
2961 MangleClassName(className);
2962 DeclareClass(classSym, className);
2963 external->symbol = classSym;
2964 classSym->pointerExternal = external;
2965 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2966 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
2970 char className[1024];
2972 strcpy(className, "__ecereClass_");
2973 FullClassNameCat(className, classSym->string, 0x1);
2974 MangleClassName(className);
2975 classSym->structExternal = external;
2976 DeclareClass(classSym, className);
2977 external->symbol = classSym;
2979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
2982 classSym->declaring--;
2984 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2986 classSym->declaring++;
2988 if(classSym->registered)
2989 DeclareMembers(classSym->registered, 0x0);
2991 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
2993 if(classSym->structExternal)
2994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2995 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2996 classSym->id = curExternal->symbol->idCode;
2997 classSym->idCode = curExternal->symbol->idCode;
2999 classSym->declaring--;
3003 extern char * strcat(char * , const char * );
3005 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3007 extern struct ModuleImport * mainModule;
3009 extern struct Specifier * MkSpecifierName(char * name);
3011 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3013 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3015 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3017 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3019 extern void FreeDeclarator(struct Declarator * decl);
3021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3023 struct PropertyImport
3025 struct PropertyImport * prev;
3026 struct PropertyImport * next;
3028 unsigned int isVirtual;
3029 unsigned int hasSet;
3030 unsigned int hasGet;
3031 } __attribute__ ((gcc_struct));
3033 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3035 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3037 void * __ecereTemp1;
3038 struct Symbol * symbol = prop->symbol;
3039 char propName[1024];
3041 strcpy(setName, "__ecereProp_");
3042 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3043 strcat(setName, "_Set_");
3044 FullClassNameCat(setName, prop->name, 0x1);
3045 strcpy(getName, "__ecereProp_");
3046 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3047 strcat(getName, "_Get_");
3048 FullClassNameCat(getName, prop->name, 0x1);
3049 strcpy(propName, "__ecereProp_");
3050 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3051 strcat(propName, "_");
3052 FullClassNameCat(propName, prop->name, 0x1);
3053 MangleClassName(getName);
3054 MangleClassName(setName);
3055 MangleClassName(propName);
3056 if(prop->_class->type == 1)
3057 DeclareStruct(prop->_class->fullName, 0x0);
3058 if(!symbol || curExternal->symbol->idCode < symbol->id)
3060 unsigned int imported = 0x0;
3061 unsigned int dllImport = 0x0;
3063 if(!symbol || symbol->_import)
3067 struct Symbol * classSym;
3069 if(!prop->_class->symbol)
3070 prop->_class->symbol = FindClass(prop->_class->fullName);
3071 classSym = prop->_class->symbol;
3072 if(classSym && !classSym->_import)
3074 struct ModuleImport * module;
3076 if(prop->_class->module)
3077 module = FindModule(prop->_class->module);
3079 module = mainModule;
3080 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
3081 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3083 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3084 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
3086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3089 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + 12)))->importType != 1)
3094 struct Context * context = SetupTemplatesContext(prop->_class);
3096 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3097 FinishTemplatesContext(context);
3101 if(!symbol->externalGet || symbol->externalGet->type == 0)
3103 struct Declaration * decl;
3104 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3105 struct Declarator * d;
3106 struct __ecereNameSpace__ecere__sys__OldList * params;
3107 struct Specifier * spec;
3108 struct External * external;
3109 struct Declarator * typeDecl;
3110 unsigned int simple = 0x0;
3112 specifiers = MkList();
3113 declarators = MkList();
3115 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3116 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3118 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3120 struct Context * context = SetupTemplatesContext(prop->_class);
3122 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3123 FinishTemplatesContext(context);
3125 for(spec = (*specifiers).first; spec; spec = spec->next)
3129 if((!typeDecl || typeDecl->type == 1))
3131 struct Symbol * classSym = spec->symbol;
3133 symbol->_class = classSym->registered;
3134 if(classSym->registered && classSym->registered->type == 1)
3136 DeclareStruct(spec->name, 0x0);
3143 d = PlugDeclarator(typeDecl, d);
3146 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3147 specifiers = MkList();
3149 d = MkDeclaratorFunction(d, params);
3151 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3152 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3155 ListAdd(specifiers, MkSpecifier(VOID));
3156 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3157 decl = MkDeclaration(specifiers, declarators);
3158 external = MkExternalDeclaration(decl);
3159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3160 external->symbol = symbol;
3161 symbol->externalGet = external;
3162 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3164 FreeDeclarator(typeDecl);
3168 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3173 if(!symbol->externalSet || symbol->externalSet->type == 0)
3175 struct Declaration * decl;
3176 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3177 struct Declarator * d;
3178 struct __ecereNameSpace__ecere__sys__OldList * params;
3179 struct Specifier * spec;
3180 struct External * external;
3181 struct Declarator * typeDecl;
3183 declarators = MkList();
3185 if(!prop->conversion || prop->_class->type == 1)
3187 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3189 specifiers = MkList();
3191 struct Context * context = SetupTemplatesContext(prop->_class);
3193 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3194 FinishTemplatesContext(context);
3196 ListAdd(params, MkTypeName(specifiers, d));
3197 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3199 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3200 d = MkDeclaratorFunction(d, params);
3201 for(spec = (*specifiers).first; spec; spec = spec->next)
3205 if((!typeDecl || typeDecl->type == 1))
3207 struct Symbol * classSym = spec->symbol;
3209 symbol->_class = classSym->registered;
3210 if(classSym->registered && classSym->registered->type == 1)
3211 DeclareStruct(spec->name, 0x0);
3215 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3216 specifiers = MkList();
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3219 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3221 if(!prop->conversion || prop->_class->type == 1)
3222 ListAdd(specifiers, MkSpecifier(VOID));
3224 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3225 decl = MkDeclaration(specifiers, declarators);
3226 external = MkExternalDeclaration(decl);
3227 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3228 external->symbol = symbol;
3229 symbol->externalSet = external;
3230 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3237 if(!symbol->externalPtr)
3239 struct Declaration * decl;
3240 struct External * external;
3241 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3247 ListAdd(specifiers, MkSpecifierName("Property"));
3249 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3251 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3254 strcpy(propName, "__ecerePropM_");
3255 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3256 strcat(propName, "_");
3257 FullClassNameCat(propName, prop->name, 0x1);
3258 MangleClassName(propName);
3259 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3261 decl = MkDeclaration(specifiers, list);
3263 external = MkExternalDeclaration(decl);
3264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3265 external->symbol = symbol;
3266 symbol->externalPtr = external;
3270 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3272 symbol->id = curExternal->symbol->idCode;
3276 struct Type * Dereference(struct Type * source)
3278 void * __ecereTemp1;
3279 struct Type * type = (((void *)0));
3283 if(source->kind == 13 || source->kind == 12)
3285 type = source->type;
3286 source->type->refCount++;
3288 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3290 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3292 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3298 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3303 static struct Type * Reference(struct Type * source)
3305 void * __ecereTemp1;
3306 struct Type * type = (((void *)0));
3310 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3316 extern void __ecereNameSpace__ecere__com__eClass_FindNextMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
3318 extern void * memcpy(void * , const void * , unsigned int size);
3320 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3322 extern void FreeExpression(struct Expression * exp);
3324 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3326 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration);
3328 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3330 extern struct Type * MkClassType(char * name);
3332 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);
3334 void ProcessMemberInitData(struct MemberInit * member, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
3336 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3337 unsigned int found = 0x0;
3338 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3339 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3340 unsigned int freeType = 0x0;
3342 yylloc = member->loc;
3347 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3351 dataMember = *curMember;
3357 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3358 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3359 int _subMemberStackPos = 0;
3362 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3365 dataMember = thisMember;
3366 if(curMember && thisMember->memberAccess == 1)
3368 *curMember = thisMember;
3369 *curClass = thisMember->_class;
3370 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3371 *subMemberStackPos = _subMemberStackPos;
3377 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3378 if(method && method->type == 1)
3381 method = (((void *)0));
3386 struct Type * type = (((void *)0));
3390 if(!dataMember->dataType && dataMember->dataTypeString)
3392 struct Context * context = SetupTemplatesContext(_class);
3394 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3395 FinishTemplatesContext(context);
3397 type = dataMember->dataType;
3401 if(!method->dataType)
3402 ProcessMethodType(method);
3403 type = method->dataType;
3405 if(ident && ident->next)
3407 for(ident = ident->next; ident && type; ident = ident->next)
3411 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3413 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3415 type = dataMember->dataType;
3417 else if(type->kind == 9 || type->kind == 10)
3419 struct Type * memberType;
3421 for(memberType = type->members.first; memberType; memberType = memberType->next)
3423 if(!strcmp(memberType->name, ident->string))
3432 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3435 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3436 struct __ecereNameSpace__ecere__com__Class * sClass;
3438 for(sClass = _class; sClass; sClass = sClass->base)
3441 if(sClass->templateClass)
3442 sClass = sClass->templateClass;
3443 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3445 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3447 for(sClass = sClass->base; sClass; sClass = sClass->base)
3449 if(sClass->templateClass)
3450 sClass = sClass->templateClass;
3451 id += sClass->templateParams.count;
3462 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3464 if(arg.dataTypeString)
3466 type = ProcessTypeString(arg.dataTypeString, 0x0);
3468 if(type && _class->templateClass)
3469 type->passAsTemplate = 0x1;
3476 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3478 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3479 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3483 char templateString[1024];
3484 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3486 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3487 for(cClass = expClass; cClass; cClass = cClass->base)
3491 if(cClass->templateClass)
3492 cClass = cClass->templateClass;
3493 for(param = cClass->templateParams.first; param; param = param->next)
3496 struct __ecereNameSpace__ecere__com__Class * sClass;
3497 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3499 for(sClass = cClass->base; sClass; sClass = sClass->base)
3501 if(sClass->templateClass)
3502 sClass = sClass->templateClass;
3503 id += sClass->templateParams.count;
3505 arg = expClass->templateArgs[id];
3506 for(sClass = _class; sClass; sClass = sClass->base)
3508 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3510 struct __ecereNameSpace__ecere__com__Class * nextClass;
3512 if(sClass->templateClass)
3513 sClass = sClass->templateClass;
3514 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3516 if(nextClass->templateClass)
3517 nextClass = nextClass->templateClass;
3518 p += nextClass->templateParams.count;
3520 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3522 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3524 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3526 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3527 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3541 char expString[1024];
3542 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3543 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3544 struct Expression * exp;
3545 char * string = PrintHexUInt64(arg.expression.ui64);
3547 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3548 ProcessExpressionType(exp);
3549 ComputeExpression(exp);
3550 expString[0] = '\0';
3551 PrintExpression(exp, expString);
3552 strcat(argument, expString);
3553 FreeExpression(exp);
3558 strcat(argument, arg.member->name);
3563 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3564 strcat(argument, arg.dataTypeString);
3571 strcat(templateString, ", ");
3572 if(lastParam != p - 1)
3574 strcat(templateString, param->name);
3575 strcat(templateString, " = ");
3577 strcat(templateString, argument);
3586 int len = strlen(templateString);
3588 if(templateString[len - 1] == '<')
3592 if(templateString[len - 1] == '>')
3593 templateString[len++] = ' ';
3594 templateString[len++] = '>';
3596 templateString[len++] = '\0';
3599 struct Context * context = SetupTemplatesContext(_class);
3603 type = ProcessTypeString(templateString, 0x0);
3605 FinishTemplatesContext(context);
3608 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3610 ProcessExpressionType(member->initializer->exp);
3611 if(!member->initializer->exp->expType)
3615 char expString[10240];
3617 expString[0] = '\0';
3618 PrintExpression(member->initializer->exp, expString);
3619 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3620 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3623 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3625 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3628 else if(member->initializer)
3630 ProcessInitializer(member->initializer, type);
3637 if(_class && _class->type == 3)
3639 if(member->initializer)
3641 struct Type * type = MkClassType(_class->fullName);
3643 ProcessInitializer(member->initializer, type);
3649 if(member->initializer)
3651 ProcessInitializer(member->initializer, (((void *)0)));
3657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3663 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3667 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3672 extern struct Identifier * GetDeclId(struct Declarator * decl);
3674 extern struct External * ProcessClassFunction(struct __ecereNameSpace__ecere__com__Class * owningClass, struct ClassFunction * func, struct __ecereNameSpace__ecere__sys__OldList * defs, struct External * after, unsigned int makeStatic);
3676 extern void FreeSpecifier(struct Specifier * spec);
3678 static void ProcessFunction(struct FunctionDefinition * function);
3680 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3682 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3684 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3686 extern void FreeClassFunction(struct ClassFunction * func);
3688 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3690 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3692 void ProcessInstantiationType(struct Instantiation * inst)
3697 struct MembersInit * members;
3698 struct Symbol * classSym;
3699 struct __ecereNameSpace__ecere__com__Class * _class;
3701 classSym = inst->_class->symbol;
3702 _class = classSym ? classSym->registered : (((void *)0));
3703 if(!_class || _class->type != 5)
3704 DeclareStruct(inst->_class->name, 0x0);
3705 afterExternal = afterExternal ? afterExternal : curExternal;
3707 ProcessExpressionType(inst->exp);
3708 inst->isConstant = 0x1;
3711 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3712 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3713 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3714 int subMemberStackPos = 0;
3716 for(members = (*inst->members).first; members; members = members->next)
3718 switch(members->type)
3723 static unsigned int instMethodID = 0;
3724 struct External * external = curExternal;
3725 struct Context * context = curContext;
3726 struct Declarator * declarator = members->function->declarator;
3727 struct Identifier * nameID = GetDeclId(declarator);
3728 char * unmangled = nameID ? nameID->string : (((void *)0));
3729 struct Expression * exp;
3730 struct External * createdExternal = (((void *)0));
3736 strcpy(name, "__ecereInstMeth_");
3737 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3739 strcat(name, nameID->string);
3741 sprintf(number, "_%08d", instMethodID++);
3742 strcat(name, number);
3743 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3747 struct Symbol * symbol = declarator->symbol;
3748 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3750 if(method && method->type == 1)
3752 symbol->method = method;
3753 ProcessMethodType(method);
3754 if(!symbol->type->thisClass)
3756 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3758 if(!currentClass->symbol)
3759 currentClass->symbol = FindClass(currentClass->fullName);
3760 symbol->type->thisClass = currentClass->symbol;
3765 _class->symbol = FindClass(_class->fullName);
3766 symbol->type->thisClass = _class->symbol;
3769 DeclareType(symbol->type, 0x1, 0x1);
3773 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3776 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3779 FreeSpecifier(nameID->_class);
3780 nameID->_class = (((void *)0));
3784 struct Type * type = declarator->symbol->type;
3785 struct External * oldExternal = curExternal;
3787 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3789 struct External * externalDecl;
3791 externalDecl = MkExternalDeclaration((((void *)0)));
3792 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3793 if(createdExternal->function)
3795 ProcessFunction(createdExternal->function);
3797 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3799 externalDecl->declaration = decl;
3800 if(decl->symbol && !decl->symbol->pointerExternal)
3801 decl->symbol->pointerExternal = externalDecl;
3802 declarator->symbol->pointerExternal = externalDecl;
3809 curExternal = declarator->symbol->pointerExternal;
3810 ProcessFunction((struct FunctionDefinition *)members->function);
3812 curExternal = external;
3813 curContext = context;
3816 FreeClassFunction(members->function);
3817 exp = QMkExpId(name);
3819 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3820 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3826 if(members->dataMembers && classSym)
3828 struct MemberInit * member;
3829 struct Location oldyyloc = yylloc;
3831 for(member = (*members->dataMembers).first; member; member = member->next)
3833 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3834 if(member->initializer && !member->initializer->isConstant)
3835 inst->isConstant = 0x0;
3847 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3851 if(type->kind == 11)
3853 struct Type * param;
3857 for(param = type->params.first; param; param = param->next)
3858 DeclareType(param, declarePointers, 0x1);
3860 DeclareType(type->returnType, declarePointers, 0x1);
3862 else if(type->kind == 13 && declarePointers)
3863 DeclareType(type->type, declarePointers, 0x0);
3864 else if(type->kind == 8)
3866 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3867 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3869 else if(type->kind == 9 || type->kind == 10)
3871 struct Type * member;
3873 for(member = type->members.first; member; member = member->next)
3874 DeclareType(member, 0x0, 0x0);
3876 else if(type->kind == 12)
3877 DeclareType(type->arrayType, declarePointers, 0x0);
3881 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3883 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3885 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3887 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3888 struct __ecereNameSpace__ecere__com__Class * sClass;
3890 for(sClass = _class; sClass; sClass = sClass->base)
3893 if(sClass->templateClass)
3894 sClass = sClass->templateClass;
3895 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3897 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3899 for(sClass = sClass->base; sClass; sClass = sClass->base)
3901 if(sClass->templateClass)
3902 sClass = sClass->templateClass;
3903 id += sClass->templateParams.count;
3914 arg = &_class->templateArgs[id];
3915 if(arg && param->type == 0)
3916 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3921 extern struct Context * PushContext(void);
3923 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3925 struct TemplatedType
3928 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3929 struct __ecereNameSpace__ecere__sys__BTNode * left;
3930 struct __ecereNameSpace__ecere__sys__BTNode * right;
3932 struct TemplateParameter * param;
3933 } __attribute__ ((gcc_struct));
3935 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3937 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3939 void * __ecereTemp1;
3940 struct Context * context = PushContext();
3942 context->templateTypesOnly = 0x1;
3943 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3945 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3947 for(; param; param = param->next)
3949 if(param->type == 0 && param->identifier)
3951 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3953 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3959 struct __ecereNameSpace__ecere__com__Class * sClass;
3961 for(sClass = _class; sClass; sClass = sClass->base)
3963 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
3965 for(p = sClass->templateParams.first; p; p = p->next)
3969 struct TemplateParameter * param = p->param;
3970 struct TemplatedType * type;
3974 p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
3976 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
3977 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
3985 extern void PopContext(struct Context * ctx);
3987 extern void FreeContext(struct Context * context);
3989 void FinishTemplatesContext(struct Context * context)
3991 PopContext(context);
3992 FreeContext(context);
3993 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
3996 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
3998 if(!method->dataType)
4000 struct Context * context = SetupTemplatesContext(method->_class);
4002 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4003 FinishTemplatesContext(context);
4004 if(method->type != 1 && method->dataType)
4006 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4008 if(!method->_class->symbol)
4009 method->_class->symbol = FindClass(method->_class->fullName);
4010 method->dataType->thisClass = method->_class->symbol;
4016 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4020 struct Context * context = SetupTemplatesContext(prop->_class);
4022 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4023 FinishTemplatesContext(context);
4027 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4029 extern void FreeTypeName(struct TypeName * typeName);
4031 static void ProcessDeclarator(struct Declarator * decl);
4033 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4039 struct MethodImport * prev;
4040 struct MethodImport * next;
4042 unsigned int isVirtual;
4043 } __attribute__ ((gcc_struct));
4045 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4047 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4049 void * __ecereTemp1;
4050 struct Symbol * symbol = method->symbol;
4052 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4054 unsigned int imported = 0x0;
4055 unsigned int dllImport = 0x0;
4057 if(!method->dataType)
4058 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4059 if(!symbol || symbol->_import || method->type == 1)
4061 if(!symbol || method->type == 1)
4063 struct Symbol * classSym;
4065 if(!method->_class->symbol)
4066 method->_class->symbol = FindClass(method->_class->fullName);
4067 classSym = method->_class->symbol;
4068 if(!classSym->_import)
4070 struct ModuleImport * module;
4072 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->name)
4073 module = FindModule(method->_class->module);
4075 module = mainModule;
4076 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
4077 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4081 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4083 if(!symbol->_import)
4085 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
4086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4090 symbol->type = method->dataType;
4092 symbol->type->refCount++;
4095 if(!method->dataType->dllExport)
4098 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + 12)))->importType != 1)
4102 if(method->type != 1 && method->dataType)
4103 DeclareType(method->dataType, 0x1, 0x1);
4104 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4106 struct Declaration * decl;
4107 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4108 struct Declarator * d;
4109 struct Declarator * funcDecl;
4110 struct External * external;
4112 specifiers = MkList();
4113 declarators = MkList();
4115 ListAdd(specifiers, MkSpecifier(EXTERN));
4116 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4117 ListAdd(specifiers, MkSpecifier(STATIC));
4118 if(method->type == 1)
4120 ListAdd(specifiers, MkSpecifier(INT));
4121 d = MkDeclaratorIdentifier(MkIdentifier(name));
4125 d = MkDeclaratorIdentifier(MkIdentifier(name));
4127 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4129 struct Context * context = SetupTemplatesContext(method->_class);
4131 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4132 FinishTemplatesContext(context);
4134 funcDecl = GetFuncDecl(d);
4137 struct Specifier * spec, * next;
4139 for(spec = (*specifiers).first; spec; spec = next)
4144 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4145 FreeSpecifier(spec);
4149 if(method->dataType && !method->dataType->staticMethod)
4151 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4153 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4154 struct TypeName * thisParam = MkTypeName(MkListOne(MkSpecifierName(method->dataType->thisClass ? method->dataType->thisClass->string : method->_class->fullName)), (_class && _class->type == 1000) ? MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("this"))) : MkDeclaratorIdentifier(MkIdentifier("this")));
4155 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4156 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4158 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4160 struct TypeName * param = (*funcDecl->function.parameters).first;
4162 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4163 FreeTypeName(param);
4165 if(!funcDecl->function.parameters)
4166 funcDecl->function.parameters = MkList();
4167 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4171 ProcessDeclarator(d);
4172 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4173 decl = MkDeclaration(specifiers, declarators);
4174 ReplaceThisClassSpecifiers(specifiers, method->_class);
4175 if(symbol->pointerExternal)
4177 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4180 *functionSymbol = *symbol;
4181 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4182 if(functionSymbol->type)
4183 functionSymbol->type->refCount++;
4185 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4186 symbol->pointerExternal->symbol = functionSymbol;
4188 external = MkExternalDeclaration(decl);
4190 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4191 external->symbol = symbol;
4192 symbol->pointerExternal = external;
4196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4198 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4202 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4204 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4206 unsigned int first = 0x1;
4208 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4210 char className[1024];
4212 strcpy(className, _class->fullName);
4213 for(param = _class->templateParams.first; param; param = param->next)
4217 strcat(className, "<");
4219 strcat(className, ", ");
4220 if(lastParam + 1 != p)
4222 strcat(className, param->name);
4223 strcat(className, " = ");
4225 strcat(className, param->name);
4233 int len = strlen(className);
4235 if(className[len - 1] == '>')
4236 className[len++] = ' ';
4237 className[len++] = '>';
4238 className[len++] = '\0';
4240 return __ecereNameSpace__ecere__sys__CopyString(className);
4243 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4246 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4248 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4250 unsigned int first = 0x1;
4252 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4254 char className[1024];
4256 strcpy(className, _class->fullName);
4257 for(param = _class->templateParams.first; param; param = param->next)
4261 strcat(className, "<");
4263 strcat(className, ", ");
4264 if(lastParam + 1 != p)
4266 strcat(className, param->name);
4267 strcat(className, " = ");
4269 strcat(className, param->name);
4277 int len = strlen(className);
4279 if(className[len - 1] == '>')
4280 className[len++] = ' ';
4281 className[len++] = '>';
4282 className[len++] = '\0';
4284 return MkClassType(className);
4288 return MkClassType(_class->fullName);
4292 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4294 if(specs != (((void *)0)) && _class)
4296 struct Specifier * spec;
4298 for(spec = specs->first; spec; spec = spec->next)
4300 if(spec->type == 0 && spec->specifier == THISCLASS)
4303 spec->name = ReplaceThisClass(_class);
4304 spec->symbol = FindClass(spec->name);
4310 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4312 struct __ecereNameSpace__ecere__com__GlobalFunction
4314 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4315 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4318 struct __ecereNameSpace__ecere__com__Instance * module;
4319 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4320 char * dataTypeString;
4321 struct Type * dataType;
4323 } __attribute__ ((gcc_struct));
4325 extern struct Context * globalContext;
4327 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4329 struct FunctionImport
4331 struct FunctionImport * prev;
4332 struct FunctionImport * next;
4334 } __attribute__ ((gcc_struct));
4336 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4338 void * __ecereTemp1;
4339 struct Symbol * symbol = function->symbol;
4341 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4343 unsigned int imported = 0x0;
4344 unsigned int dllImport = 0x0;
4346 if(!function->dataType)
4348 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4349 if(!function->dataType->thisClass)
4350 function->dataType->staticMethod = 0x1;
4356 struct ModuleImport * module = FindModule(function->module);
4358 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4361 if(!function->dataType->dllExport)
4363 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
4364 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4368 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4369 if(!symbol->type->thisClass)
4370 symbol->type->staticMethod = 0x1;
4373 imported = symbol->_import ? 0x1 : 0x0;
4374 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1)
4377 DeclareType(function->dataType, 0x1, 0x1);
4380 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4382 struct Declaration * decl;
4383 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4384 struct Declarator * d;
4385 struct Declarator * funcDecl;
4386 struct External * external;
4388 specifiers = MkList();
4389 declarators = MkList();
4390 ListAdd(specifiers, MkSpecifier(EXTERN));
4391 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4393 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4394 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4395 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType == 1)
4397 struct Specifier * spec;
4399 for(spec = (*specifiers).first; spec; spec = spec->next)
4400 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4402 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4403 FreeSpecifier(spec);
4407 funcDecl = GetFuncDecl(d);
4408 if(funcDecl && !funcDecl->function.parameters)
4410 funcDecl->function.parameters = MkList();
4411 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4413 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4415 struct Context * oldCtx = curContext;
4417 curContext = globalContext;
4418 decl = MkDeclaration(specifiers, declarators);
4419 curContext = oldCtx;
4421 if(symbol->pointerExternal)
4423 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4426 *functionSymbol = *symbol;
4427 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4428 if(functionSymbol->type)
4429 functionSymbol->type->refCount++;
4431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4432 symbol->pointerExternal->symbol = functionSymbol;
4434 external = MkExternalDeclaration(decl);
4436 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4437 external->symbol = symbol;
4438 symbol->pointerExternal = external;
4442 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4445 symbol->id = curExternal->symbol->idCode;
4448 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1) ? 0x1 : 0x0;
4451 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4456 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4457 struct __ecereNameSpace__ecere__sys__BTNode * left;
4458 struct __ecereNameSpace__ecere__sys__BTNode * right;
4460 struct __ecereNameSpace__ecere__com__Instance * module;
4461 char * dataTypeString;
4462 struct Type * dataType;
4465 } __attribute__ ((gcc_struct));
4467 void DeclareGlobalData(struct GlobalData * data)
4469 struct Symbol * symbol = data->symbol;
4471 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4476 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4479 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4480 DeclareType(data->dataType, 0x1, 0x1);
4483 if(!symbol->pointerExternal)
4485 struct Declaration * decl;
4486 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4487 struct Declarator * d;
4488 struct External * external;
4490 specifiers = MkList();
4491 declarators = MkList();
4492 ListAdd(specifiers, MkSpecifier(EXTERN));
4493 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4494 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4495 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4496 decl = MkDeclaration(specifiers, declarators);
4497 external = MkExternalDeclaration(decl);
4499 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4500 external->symbol = symbol;
4501 symbol->pointerExternal = external;
4505 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4508 symbol->id = curExternal->symbol->idCode;
4515 struct Conversion * prev, * next;
4516 struct __ecereNameSpace__ecere__com__Property * convert;
4518 struct Type * resultType;
4519 } __attribute__ ((gcc_struct));
4521 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4523 extern void Compiler_Warning(char * format, ...);
4525 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4527 unsigned int MatchTypes(struct Type * source, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, struct __ecereNameSpace__ecere__com__Class * owningClassSource, struct __ecereNameSpace__ecere__com__Class * owningClassDest, unsigned int doConversion, unsigned int enumBaseType, unsigned int acceptReversedParams, unsigned int isConversionExploration)
4531 if(source->kind == 20 && dest->kind != 20)
4533 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4538 if(dest->kind == 20 && source->kind != 20)
4540 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4545 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4549 if(source->classObjectType == 3 && dest->classObjectType != 2)
4553 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4555 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4558 if(dest->kind == 14 && source->kind != 0)
4560 if(dest->kind == 13 && dest->type->kind == 0 && ((source->kind == 8 && (!source->_class || !source->_class->registered || source->_class->registered->type == 1 || source->_class->registered->type == 0 || source->_class->registered->type == 5 || source->_class->registered->type == 1000)) || source->kind == 19 || source->kind == 13 || source->kind == 12 || source->kind == 11 || source->kind == 21))
4562 if(!isConversionExploration && source->kind == 13 && source->type->kind == 0 && ((dest->kind == 8 && (!dest->_class || !dest->_class->registered || dest->_class->registered->type == 1 || dest->_class->registered->type == 0 || dest->_class->registered->type == 5 || dest->_class->registered->type == 1000)) || dest->kind == 19 || dest->kind == 13 || dest->kind == 12 || dest->kind == 11 || dest->kind == 21))
4564 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4566 if(source->_class->registered && source->_class->registered->type == 3)
4568 if(conversions != (((void *)0)))
4570 if(source->_class->registered == dest->_class->registered)
4575 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4577 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4579 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4581 if(sourceBase == destBase)
4585 else if(source->_class && dest->_class && (dest->classObjectType == source->classObjectType || !dest->classObjectType) && (enumBaseType || (!source->_class->registered || source->_class->registered->type != 4) || (!dest->_class->registered || dest->_class->registered->type != 4)) && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, dest->_class->registered))
4589 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4591 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4598 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4602 if(source->kind == 8)
4604 struct __ecereNameSpace__ecere__com__Class * _class;
4606 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4608 struct __ecereNameSpace__ecere__com__Property * convert;
4610 for(convert = _class->conversions.first; convert; convert = convert->next)
4612 if(convert->memberAccess == 1 || _class->module == privateModule)
4614 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4616 if(!convert->dataType)
4617 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4618 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4620 if(!conversions && !convert->Get)
4622 else if(conversions != (((void *)0)))
4624 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4628 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4630 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4641 struct __ecereNameSpace__ecere__com__Class * _class;
4643 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4645 struct __ecereNameSpace__ecere__com__Property * convert;
4647 for(convert = _class->conversions.first; convert; convert = convert->next)
4649 if(convert->memberAccess == 1 || _class->module == privateModule)
4651 if(!convert->dataType)
4652 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4653 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4655 if(!conversions && !convert->Set)
4657 else if(conversions != (((void *)0)))
4659 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (source->kind != 8 || source->_class->registered != _class->base))
4663 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4665 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4673 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4675 if(!dest->_class->registered->dataType)
4676 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4677 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4679 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4686 if(source->kind == 8)
4688 struct __ecereNameSpace__ecere__com__Class * _class;
4690 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4692 struct __ecereNameSpace__ecere__com__Property * convert;
4694 for(convert = _class->conversions.first; convert; convert = convert->next)
4696 if(convert->memberAccess == 1 || _class->module == privateModule)
4698 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4700 if(!convert->dataType)
4701 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4702 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4704 if(!conversions && !convert->Get)
4706 else if(conversions != (((void *)0)))
4708 if(_class->type == 3 && convert->dataType->kind == 8 && convert->dataType->_class && convert->dataType->_class->registered && _class->base == convert->dataType->_class->registered->base && (dest->kind != 8 || dest->_class->registered != _class->base))
4712 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4714 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4722 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4724 if(!source->_class->registered->dataType)
4725 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4726 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4733 if(source->kind == 8 || source->kind == 19)
4735 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4737 else if(dest->kind == 7 && source->kind == 6)
4739 else if(dest->kind == 2 && source->kind == 1)
4741 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1))
4743 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4745 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3))
4747 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22))
4749 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22))
4751 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && ((source->kind == 11 || (source->kind == 13 && source->type->kind == 11) || source->kind == 16)))
4753 struct Type * paramSource, * paramDest;
4755 if(dest->kind == 16)
4756 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4757 if(source->kind == 16)
4758 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4759 if(dest->kind == 13 && dest->type->kind == 11)
4761 if(source->kind == 13 && source->type->kind == 11)
4762 source = source->type;
4763 if(dest->kind == 16)
4764 dest = dest->method->dataType;
4765 if(source->kind == 16)
4766 source = source->method->dataType;
4767 paramSource = source->params.first;
4768 if(paramSource && paramSource->kind == 0)
4769 paramSource = (((void *)0));
4770 paramDest = dest->params.first;
4771 if(paramDest && paramDest->kind == 0)
4772 paramDest = (((void *)0));
4773 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4775 if(!paramDest || (!(paramDest->kind == 13 && paramDest->type && paramDest->type->kind == 0) && (paramDest->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, paramDest->_class->registered))))
4777 if(paramDest && paramDest->kind == 8)
4778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4780 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4783 paramDest = paramDest->next;
4785 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4787 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4791 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4793 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4799 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4802 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4804 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4808 paramSource = paramSource->next;
4814 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4816 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4822 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4824 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4830 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4832 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4835 for(; paramDest; paramDest = paramDest->next)
4839 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4843 struct Type * paramDestType = paramDest;
4844 struct Type * paramSourceType = paramSource;
4845 struct Type * type = paramDestType;
4847 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4850 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4851 struct __ecereNameSpace__ecere__com__Class * sClass;
4853 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4856 if(sClass->templateClass)
4857 sClass = sClass->templateClass;
4858 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4860 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4862 for(sClass = sClass->base; sClass; sClass = sClass->base)
4864 if(sClass->templateClass)
4865 sClass = sClass->templateClass;
4866 id += sClass->templateParams.count;
4877 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4879 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4882 if(!MatchTypes(paramDestType, paramSourceType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0) && (!acceptReversedParams || !MatchTypes(paramSourceType, paramDestType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0)))
4887 PrintType(paramDest, type, 0x0, 0x1);
4888 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4889 if(paramDestType != paramDest)
4890 FreeType(paramDestType);
4893 if(paramDestType != paramDest)
4894 FreeType(paramDestType);
4896 paramSource = paramSource->next;
4900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4905 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4909 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4911 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4918 static void FreeConvert(struct Conversion * convert)
4920 if(convert->resultType)
4921 FreeType(convert->resultType);
4924 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4926 struct __ecereNameSpace__ecere__com__BTNamedLink
4929 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4930 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4931 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4934 } __attribute__ ((gcc_struct));
4936 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4938 struct __ecereNameSpace__ecere__com__EnumClassData
4940 struct __ecereNameSpace__ecere__sys__OldList values;
4942 } __attribute__ ((gcc_struct));
4944 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4946 struct __ecereNameSpace__ecere__sys__NamedLink
4948 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4949 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4952 } __attribute__ ((gcc_struct));
4954 extern void FreeExpContents(struct Expression * exp);
4956 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
4958 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
4960 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
4962 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
4964 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
4966 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
4968 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
4970 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
4972 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
4974 if(_class->type == 4)
4976 struct __ecereNameSpace__ecere__sys__OldList converts =
4980 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
4984 _class->symbol = FindClass(_class->fullName);
4985 type->_class = _class->symbol;
4986 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
4988 struct __ecereNameSpace__ecere__sys__NamedLink * value;
4989 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
4993 struct __ecereNameSpace__ecere__com__Class * baseClass;
4995 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
4997 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
4999 for(value = e->values.first; value; value = value->next)
5001 if(!strcmp(value->name, string))
5006 FreeExpContents(sourceExp);
5007 FreeType(sourceExp->expType);
5008 sourceExp->isConstant = 0x1;
5009 sourceExp->expType = MkClassType(baseClass->fullName);
5013 sourceExp->type = 2;
5014 if(!strcmp(baseClass->dataTypeString, "int"))
5015 sprintf(constant, "%d", value->data);
5017 sprintf(constant, "0x%X", value->data);
5018 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5020 while(converts.first)
5022 struct Conversion * convert = converts.first;
5024 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5025 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5027 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5035 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5038 for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); nameSpace != (((void *)0)); nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
5039 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5044 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5046 struct __ecereNameSpace__ecere__com__SubModule
5048 struct __ecereNameSpace__ecere__com__SubModule * prev;
5049 struct __ecereNameSpace__ecere__com__SubModule * next;
5050 struct __ecereNameSpace__ecere__com__Instance * module;
5052 } __attribute__ ((gcc_struct));
5054 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5056 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5058 if(searchFor == searchIn)
5060 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->modules.first; subModule; subModule = subModule->next)
5062 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + 12)))->application)
5064 if(ModuleVisibility(subModule->module, searchFor))
5071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5073 struct __ecereNameSpace__ecere__com__Application
5078 unsigned int isGUIApp;
5079 struct __ecereNameSpace__ecere__sys__OldList allModules;
5080 char * parsedCommand;
5081 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5082 } __attribute__ ((gcc_struct));
5084 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5086 struct __ecereNameSpace__ecere__com__Instance * module;
5088 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->systemNameSpace, sourceExp, dest, string, conversions))
5090 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->privateNameSpace, sourceExp, dest, string, conversions))
5092 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5094 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
5096 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace, sourceExp, dest, string, conversions))
5102 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5104 void ReadString(char * output, char * string);
5106 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5108 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5110 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5112 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5114 void * __ecereTemp1;
5115 struct Type * source = sourceExp->expType;
5116 struct Type * realDest = dest;
5118 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5120 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5122 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5124 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5126 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5128 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5130 if(sourceBase == destBase)
5136 struct __ecereNameSpace__ecere__sys__OldList * specs;
5137 unsigned int flag = 0x0;
5138 long long value = (((int)0x7fffffff));
5142 if(sourceExp->type == 2)
5144 if(source->isSigned)
5145 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5147 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5149 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5151 if(source->isSigned)
5152 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5154 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5156 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5159 source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
5163 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5165 if(_class && _class->type == 3)
5167 if(source->kind != 8)
5169 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5170 struct Type * tempDest, * tempSource;
5172 for(; _class->base->type != 1000; _class = _class->base)
5175 tempDest = tempType;
5178 _class->symbol = FindClass(_class->fullName);
5179 tempType->_class = _class->symbol;
5180 tempType->truth = dest->truth;
5181 if(tempType->_class)
5182 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5183 FreeType(sourceExp->expType);
5184 sourceExp->expType = dest;
5187 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5190 if(_class && _class->type == 2 && source->kind != 8)
5192 if(!dest->_class->registered->dataType)
5193 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5194 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5197 FreeType(sourceExp->expType);
5198 source = sourceExp->expType = MkClassType(dest->_class->string);
5202 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5204 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5205 struct Declarator * decl;
5208 ReadString(string, sourceExp->string);
5209 decl = SpecDeclFromString(string, specs, (((void *)0)));
5210 FreeExpContents(sourceExp);
5211 FreeType(sourceExp->expType);
5212 sourceExp->type = 26;
5213 sourceExp->_classExp.specifiers = specs;
5214 sourceExp->_classExp.decl = decl;
5215 sourceExp->expType = dest;
5222 else if(source->kind == 8)
5224 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5226 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5230 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5231 struct Type * tempDest, * tempSource;
5233 if(!source->_class->registered->dataType)
5234 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5235 for(; _class->base->type != 1000; _class = _class->base)
5238 tempSource = tempType;
5240 tempType->_class = FindClass(_class->fullName);
5241 tempType->truth = source->truth;
5242 tempType->classObjectType = source->classObjectType;
5243 if(tempType->_class)
5244 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5245 if(conversions->last)
5247 ((struct Conversion *)conversions->last)->resultType = dest;
5250 FreeType(sourceExp->expType);
5251 sourceExp->expType = MkClassType(_class->fullName);
5252 sourceExp->expType->truth = source->truth;
5253 sourceExp->expType->classObjectType = source->classObjectType;
5254 if(!sourceExp->destType)
5256 FreeType(sourceExp->destType);
5257 sourceExp->destType = sourceExp->expType;
5258 if(sourceExp->expType)
5259 sourceExp->expType->refCount++;
5261 if(!_class->dataType)
5262 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5264 dest = MkClassType(source->_class->string);
5265 dest->truth = source->truth;
5266 dest->classObjectType = source->classObjectType;
5268 source = _class->dataType;
5270 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5276 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5285 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5287 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5289 if(_class->type == 0 || _class->type == 5)
5291 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5293 *newExp = *sourceExp;
5294 if(sourceExp->destType)
5295 sourceExp->destType->refCount++;
5296 if(sourceExp->expType)
5297 sourceExp->expType->refCount++;
5298 sourceExp->type = 11;
5299 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5300 sourceExp->cast.exp = newExp;
5301 FreeType(sourceExp->expType);
5302 sourceExp->expType = (((void *)0));
5303 ProcessExpressionType(sourceExp);
5306 FreeType(sourceExp->expType);
5307 sourceExp->expType = dest;
5314 if(!_class->dataType)
5315 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5317 dest = _class->dataType;
5320 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5322 specs = MkListOne(MkSpecifier(DOUBLE));
5324 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5326 specs = MkListOne(MkSpecifier(FLOAT));
5328 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5332 ListAdd(specs, MkSpecifier(UNSIGNED));
5333 ListAdd(specs, MkSpecifier(INT64));
5335 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5339 ListAdd(specs, MkSpecifier(UNSIGNED));
5340 ListAdd(specs, MkSpecifier(INT));
5342 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5346 ListAdd(specs, MkSpecifier(UNSIGNED));
5347 ListAdd(specs, MkSpecifier(SHORT));
5349 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5353 ListAdd(specs, MkSpecifier(UNSIGNED));
5354 ListAdd(specs, MkSpecifier(CHAR));
5363 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 1))
5365 specs = MkListOne(MkSpecifier(DOUBLE));
5367 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5369 specs = MkListOne(MkSpecifier(FLOAT));
5371 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5375 ListAdd(specs, MkSpecifier(UNSIGNED));
5376 ListAdd(specs, MkSpecifier(CHAR));
5378 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5382 ListAdd(specs, MkSpecifier(UNSIGNED));
5383 ListAdd(specs, MkSpecifier(SHORT));
5385 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5389 ListAdd(specs, MkSpecifier(UNSIGNED));
5390 ListAdd(specs, MkSpecifier(INT));
5392 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5396 ListAdd(specs, MkSpecifier(UNSIGNED));
5397 ListAdd(specs, MkSpecifier(INT64));
5399 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5401 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5411 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5413 *newExp = *sourceExp;
5414 newExp->prev = (((void *)0));
5415 newExp->next = (((void *)0));
5416 if(sourceExp->destType)
5417 sourceExp->destType->refCount++;
5418 if(sourceExp->expType)
5419 sourceExp->expType->refCount++;
5420 sourceExp->type = 11;
5421 if(realDest->kind == 8)
5423 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5424 FreeList(specs, FreeSpecifier);
5427 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5428 if(newExp->type == 4)
5430 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5433 sourceExp->cast.exp = newExp;
5434 FreeType(sourceExp->expType);
5435 sourceExp->expType = (((void *)0));
5436 ProcessExpressionType(sourceExp);
5439 FreeList(specs, FreeSpecifier);
5446 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5447 sourceExp = (*sourceExp->list).last;
5448 if(sourceExp->type == 0)
5450 struct Identifier * id = sourceExp->identifier;
5454 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5456 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5457 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5461 for(; _class && _class->type == 4; _class = _class->base)
5463 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5464 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5466 for(value = e->values.first; value; value = value->next)
5468 if(!strcmp(value->name, id->string))
5473 FreeExpContents(sourceExp);
5474 FreeType(sourceExp->expType);
5475 sourceExp->isConstant = 0x1;
5476 sourceExp->expType = MkClassType(_class->fullName);
5480 sourceExp->type = 2;
5481 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5482 sprintf(constant, "%d", value->data);
5484 sprintf(constant, "0x%X", value->data);
5485 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5493 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5500 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5502 int value2 = op2->i;
5505 exp->string = PrintInt(op1->i + value2);
5508 exp->expType = op1->type;
5510 op1->type->refCount++;
5515 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5517 unsigned int value2 = op2->ui;
5520 exp->string = PrintUInt(op1->ui + value2);
5523 exp->expType = op1->type;
5525 op1->type->refCount++;
5530 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5532 short value2 = op2->s;
5535 exp->string = PrintShort(op1->s + value2);
5538 exp->expType = op1->type;
5540 op1->type->refCount++;
5545 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5547 unsigned short value2 = op2->us;
5550 exp->string = PrintUShort(op1->us + value2);
5553 exp->expType = op1->type;
5555 op1->type->refCount++;
5560 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5562 char value2 = op2->c;
5565 exp->string = PrintChar(op1->c + value2);
5568 exp->expType = op1->type;
5570 op1->type->refCount++;
5575 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5577 unsigned char value2 = op2->uc;
5580 exp->string = PrintUChar(op1->uc + value2);
5583 exp->expType = op1->type;
5585 op1->type->refCount++;
5590 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5592 float value2 = op2->f;
5595 exp->string = PrintFloat(op1->f + value2);
5598 exp->expType = op1->type;
5600 op1->type->refCount++;
5605 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5607 double value2 = op2->d;
5610 exp->string = PrintDouble(op1->d + value2);
5613 exp->expType = op1->type;
5615 op1->type->refCount++;
5620 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5622 int value2 = op2->i;
5625 exp->string = PrintInt(op1->i - value2);
5628 exp->expType = op1->type;
5630 op1->type->refCount++;
5635 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5637 unsigned int value2 = op2->ui;
5640 exp->string = PrintUInt(op1->ui - value2);
5643 exp->expType = op1->type;
5645 op1->type->refCount++;
5650 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5652 short value2 = op2->s;
5655 exp->string = PrintShort(op1->s - value2);
5658 exp->expType = op1->type;
5660 op1->type->refCount++;
5665 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5667 unsigned short value2 = op2->us;
5670 exp->string = PrintUShort(op1->us - value2);
5673 exp->expType = op1->type;
5675 op1->type->refCount++;
5680 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5682 char value2 = op2->c;
5685 exp->string = PrintChar(op1->c - value2);
5688 exp->expType = op1->type;
5690 op1->type->refCount++;
5695 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5697 unsigned char value2 = op2->uc;
5700 exp->string = PrintUChar(op1->uc - value2);
5703 exp->expType = op1->type;
5705 op1->type->refCount++;
5710 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5712 float value2 = op2->f;
5715 exp->string = PrintFloat(op1->f - value2);
5718 exp->expType = op1->type;
5720 op1->type->refCount++;
5725 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5727 double value2 = op2->d;
5730 exp->string = PrintDouble(op1->d - value2);
5733 exp->expType = op1->type;
5735 op1->type->refCount++;
5740 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5742 int value2 = op2->i;
5745 exp->string = PrintInt(op1->i * value2);
5748 exp->expType = op1->type;
5750 op1->type->refCount++;
5755 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5757 unsigned int value2 = op2->ui;
5760 exp->string = PrintUInt(op1->ui * value2);
5763 exp->expType = op1->type;
5765 op1->type->refCount++;
5770 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5772 short value2 = op2->s;
5775 exp->string = PrintShort(op1->s * value2);
5778 exp->expType = op1->type;
5780 op1->type->refCount++;
5785 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5787 unsigned short value2 = op2->us;
5790 exp->string = PrintUShort(op1->us * value2);
5793 exp->expType = op1->type;
5795 op1->type->refCount++;
5800 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5802 char value2 = op2->c;
5805 exp->string = PrintChar(op1->c * value2);
5808 exp->expType = op1->type;
5810 op1->type->refCount++;
5815 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5817 unsigned char value2 = op2->uc;
5820 exp->string = PrintUChar(op1->uc * value2);
5823 exp->expType = op1->type;
5825 op1->type->refCount++;
5830 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5832 float value2 = op2->f;
5835 exp->string = PrintFloat(op1->f * value2);
5838 exp->expType = op1->type;
5840 op1->type->refCount++;
5845 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5847 double value2 = op2->d;
5850 exp->string = PrintDouble(op1->d * value2);
5853 exp->expType = op1->type;
5855 op1->type->refCount++;
5860 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5862 int value2 = op2->i;
5865 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5868 exp->expType = op1->type;
5870 op1->type->refCount++;
5875 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5877 unsigned int value2 = op2->ui;
5880 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5883 exp->expType = op1->type;
5885 op1->type->refCount++;
5890 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5892 short value2 = op2->s;
5895 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5898 exp->expType = op1->type;
5900 op1->type->refCount++;
5905 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5907 unsigned short value2 = op2->us;
5910 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5913 exp->expType = op1->type;
5915 op1->type->refCount++;
5920 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5922 char value2 = op2->c;
5925 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5928 exp->expType = op1->type;
5930 op1->type->refCount++;
5935 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5937 unsigned char value2 = op2->uc;
5940 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5943 exp->expType = op1->type;
5945 op1->type->refCount++;
5950 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5952 float value2 = op2->f;
5955 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
5958 exp->expType = op1->type;
5960 op1->type->refCount++;
5965 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5967 double value2 = op2->d;
5970 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
5973 exp->expType = op1->type;
5975 op1->type->refCount++;
5980 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5982 int value2 = op2->i;
5985 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
5988 exp->expType = op1->type;
5990 op1->type->refCount++;
5995 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 unsigned int value2 = op2->ui;
6000 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6003 exp->expType = op1->type;
6005 op1->type->refCount++;
6010 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 short value2 = op2->s;
6015 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6018 exp->expType = op1->type;
6020 op1->type->refCount++;
6025 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 unsigned short value2 = op2->us;
6030 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6033 exp->expType = op1->type;
6035 op1->type->refCount++;
6040 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 char value2 = op2->c;
6045 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6048 exp->expType = op1->type;
6050 op1->type->refCount++;
6055 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6057 unsigned char value2 = op2->uc;
6060 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6063 exp->expType = op1->type;
6065 op1->type->refCount++;
6070 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6073 exp->string = PrintInt(-op1->i);
6076 exp->expType = op1->type;
6078 op1->type->refCount++;
6083 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6086 exp->string = PrintUInt(-op1->ui);
6089 exp->expType = op1->type;
6091 op1->type->refCount++;
6096 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6099 exp->string = PrintShort(-op1->s);
6102 exp->expType = op1->type;
6104 op1->type->refCount++;
6109 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6112 exp->string = PrintUShort(-op1->us);
6115 exp->expType = op1->type;
6117 op1->type->refCount++;
6122 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6125 exp->string = PrintChar(-op1->c);
6128 exp->expType = op1->type;
6130 op1->type->refCount++;
6135 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6138 exp->string = PrintUChar(-op1->uc);
6141 exp->expType = op1->type;
6143 op1->type->refCount++;
6148 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6151 exp->string = PrintFloat(-op1->f);
6154 exp->expType = op1->type;
6156 op1->type->refCount++;
6161 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6164 exp->string = PrintDouble(-op1->d);
6167 exp->expType = op1->type;
6169 op1->type->refCount++;
6174 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6177 exp->string = PrintInt(++op1->i);
6180 exp->expType = op1->type;
6182 op1->type->refCount++;
6187 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6190 exp->string = PrintUInt(++op1->ui);
6193 exp->expType = op1->type;
6195 op1->type->refCount++;
6200 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6203 exp->string = PrintShort(++op1->s);
6206 exp->expType = op1->type;
6208 op1->type->refCount++;
6213 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6216 exp->string = PrintUShort(++op1->us);
6219 exp->expType = op1->type;
6221 op1->type->refCount++;
6226 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6229 exp->string = PrintChar(++op1->c);
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6242 exp->string = PrintUChar(++op1->uc);
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6255 exp->string = PrintFloat(++op1->f);
6258 exp->expType = op1->type;
6260 op1->type->refCount++;
6265 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6268 exp->string = PrintDouble(++op1->d);
6271 exp->expType = op1->type;
6273 op1->type->refCount++;
6278 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6281 exp->string = PrintInt(--op1->i);
6284 exp->expType = op1->type;
6286 op1->type->refCount++;
6291 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6294 exp->string = PrintUInt(--op1->ui);
6297 exp->expType = op1->type;
6299 op1->type->refCount++;
6304 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6307 exp->string = PrintShort(--op1->s);
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6320 exp->string = PrintUShort(--op1->us);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6333 exp->string = PrintChar(--op1->c);
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6346 exp->string = PrintUChar(--op1->uc);
6349 exp->expType = op1->type;
6351 op1->type->refCount++;
6356 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6359 exp->string = PrintFloat(--op1->f);
6362 exp->expType = op1->type;
6364 op1->type->refCount++;
6369 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6372 exp->string = PrintDouble(--op1->d);
6375 exp->expType = op1->type;
6377 op1->type->refCount++;
6382 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6384 int value2 = op2->i;
6387 exp->string = PrintInt(op1->i = value2);
6390 exp->expType = op1->type;
6392 op1->type->refCount++;
6397 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6399 unsigned int value2 = op2->ui;
6402 exp->string = PrintUInt(op1->ui = value2);
6405 exp->expType = op1->type;
6407 op1->type->refCount++;
6412 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6414 short value2 = op2->s;
6417 exp->string = PrintShort(op1->s = value2);
6420 exp->expType = op1->type;
6422 op1->type->refCount++;
6427 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6429 unsigned short value2 = op2->us;
6432 exp->string = PrintUShort(op1->us = value2);
6435 exp->expType = op1->type;
6437 op1->type->refCount++;
6442 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6444 char value2 = op2->c;
6447 exp->string = PrintChar(op1->c = value2);
6450 exp->expType = op1->type;
6452 op1->type->refCount++;
6457 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6459 unsigned char value2 = op2->uc;
6462 exp->string = PrintUChar(op1->uc = value2);
6465 exp->expType = op1->type;
6467 op1->type->refCount++;
6472 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6474 float value2 = op2->f;
6477 exp->string = PrintFloat(op1->f = value2);
6480 exp->expType = op1->type;
6482 op1->type->refCount++;
6487 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6489 double value2 = op2->d;
6492 exp->string = PrintDouble(op1->d = value2);
6495 exp->expType = op1->type;
6497 op1->type->refCount++;
6502 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6504 int value2 = op2->i;
6507 exp->string = PrintInt(op1->i += value2);
6510 exp->expType = op1->type;
6512 op1->type->refCount++;
6517 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6519 unsigned int value2 = op2->ui;
6522 exp->string = PrintUInt(op1->ui += value2);
6525 exp->expType = op1->type;
6527 op1->type->refCount++;
6532 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6534 short value2 = op2->s;
6537 exp->string = PrintShort(op1->s += value2);
6540 exp->expType = op1->type;
6542 op1->type->refCount++;
6547 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6549 unsigned short value2 = op2->us;
6552 exp->string = PrintUShort(op1->us += value2);
6555 exp->expType = op1->type;
6557 op1->type->refCount++;
6562 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6564 char value2 = op2->c;
6567 exp->string = PrintChar(op1->c += value2);
6570 exp->expType = op1->type;
6572 op1->type->refCount++;
6577 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6579 unsigned char value2 = op2->uc;
6582 exp->string = PrintUChar(op1->uc += value2);
6585 exp->expType = op1->type;
6587 op1->type->refCount++;
6592 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6594 float value2 = op2->f;
6597 exp->string = PrintFloat(op1->f += value2);
6600 exp->expType = op1->type;
6602 op1->type->refCount++;
6607 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6609 double value2 = op2->d;
6612 exp->string = PrintDouble(op1->d += value2);
6615 exp->expType = op1->type;
6617 op1->type->refCount++;
6622 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6624 int value2 = op2->i;
6627 exp->string = PrintInt(op1->i -= value2);
6630 exp->expType = op1->type;
6632 op1->type->refCount++;
6637 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6639 unsigned int value2 = op2->ui;
6642 exp->string = PrintUInt(op1->ui -= value2);
6645 exp->expType = op1->type;
6647 op1->type->refCount++;
6652 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6654 short value2 = op2->s;
6657 exp->string = PrintShort(op1->s -= value2);
6660 exp->expType = op1->type;
6662 op1->type->refCount++;
6667 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6669 unsigned short value2 = op2->us;
6672 exp->string = PrintUShort(op1->us -= value2);
6675 exp->expType = op1->type;
6677 op1->type->refCount++;
6682 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6684 char value2 = op2->c;
6687 exp->string = PrintChar(op1->c -= value2);
6690 exp->expType = op1->type;
6692 op1->type->refCount++;
6697 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6699 unsigned char value2 = op2->uc;
6702 exp->string = PrintUChar(op1->uc -= value2);
6705 exp->expType = op1->type;
6707 op1->type->refCount++;
6712 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6714 float value2 = op2->f;
6717 exp->string = PrintFloat(op1->f -= value2);
6720 exp->expType = op1->type;
6722 op1->type->refCount++;
6727 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6729 double value2 = op2->d;
6732 exp->string = PrintDouble(op1->d -= value2);
6735 exp->expType = op1->type;
6737 op1->type->refCount++;
6742 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6744 int value2 = op2->i;
6747 exp->string = PrintInt(op1->i *= value2);
6750 exp->expType = op1->type;
6752 op1->type->refCount++;
6757 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6759 unsigned int value2 = op2->ui;
6762 exp->string = PrintUInt(op1->ui *= value2);
6765 exp->expType = op1->type;
6767 op1->type->refCount++;
6772 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6774 short value2 = op2->s;
6777 exp->string = PrintShort(op1->s *= value2);
6780 exp->expType = op1->type;
6782 op1->type->refCount++;
6787 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6789 unsigned short value2 = op2->us;
6792 exp->string = PrintUShort(op1->us *= value2);
6795 exp->expType = op1->type;
6797 op1->type->refCount++;
6802 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6804 char value2 = op2->c;
6807 exp->string = PrintChar(op1->c *= value2);
6810 exp->expType = op1->type;
6812 op1->type->refCount++;
6817 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6819 unsigned char value2 = op2->uc;
6822 exp->string = PrintUChar(op1->uc *= value2);
6825 exp->expType = op1->type;
6827 op1->type->refCount++;
6832 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6834 float value2 = op2->f;
6837 exp->string = PrintFloat(op1->f *= value2);
6840 exp->expType = op1->type;
6842 op1->type->refCount++;
6847 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6849 double value2 = op2->d;
6852 exp->string = PrintDouble(op1->d *= value2);
6855 exp->expType = op1->type;
6857 op1->type->refCount++;
6862 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6864 int value2 = op2->i;
6867 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6870 exp->expType = op1->type;
6872 op1->type->refCount++;
6877 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6879 unsigned int value2 = op2->ui;
6882 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6885 exp->expType = op1->type;
6887 op1->type->refCount++;
6892 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6894 short value2 = op2->s;
6897 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6900 exp->expType = op1->type;
6902 op1->type->refCount++;
6907 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6909 unsigned short value2 = op2->us;
6912 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6915 exp->expType = op1->type;
6917 op1->type->refCount++;
6922 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6924 char value2 = op2->c;
6927 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6930 exp->expType = op1->type;
6932 op1->type->refCount++;
6937 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6939 unsigned char value2 = op2->uc;
6942 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6945 exp->expType = op1->type;
6947 op1->type->refCount++;
6952 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6954 float value2 = op2->f;
6957 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
6960 exp->expType = op1->type;
6962 op1->type->refCount++;
6967 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6969 double value2 = op2->d;
6972 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
6975 exp->expType = op1->type;
6977 op1->type->refCount++;
6982 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6984 int value2 = op2->i;
6987 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
6990 exp->expType = op1->type;
6992 op1->type->refCount++;
6997 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6999 unsigned int value2 = op2->ui;
7002 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7005 exp->expType = op1->type;
7007 op1->type->refCount++;
7012 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7014 short value2 = op2->s;
7017 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7020 exp->expType = op1->type;
7022 op1->type->refCount++;
7027 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7029 unsigned short value2 = op2->us;
7032 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7035 exp->expType = op1->type;
7037 op1->type->refCount++;
7042 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7044 char value2 = op2->c;
7047 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7050 exp->expType = op1->type;
7052 op1->type->refCount++;
7057 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7059 unsigned char value2 = op2->uc;
7062 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7065 exp->expType = op1->type;
7067 op1->type->refCount++;
7072 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7074 int value2 = op2->i;
7077 exp->string = PrintInt(op1->i & value2);
7080 exp->expType = op1->type;
7082 op1->type->refCount++;
7087 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7089 unsigned int value2 = op2->ui;
7092 exp->string = PrintUInt(op1->ui & value2);
7095 exp->expType = op1->type;
7097 op1->type->refCount++;
7102 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7104 short value2 = op2->s;
7107 exp->string = PrintShort(op1->s & value2);
7110 exp->expType = op1->type;
7112 op1->type->refCount++;
7117 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7119 unsigned short value2 = op2->us;
7122 exp->string = PrintUShort(op1->us & value2);
7125 exp->expType = op1->type;
7127 op1->type->refCount++;
7132 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7134 char value2 = op2->c;
7137 exp->string = PrintChar(op1->c & value2);
7140 exp->expType = op1->type;
7142 op1->type->refCount++;
7147 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7149 unsigned char value2 = op2->uc;
7152 exp->string = PrintUChar(op1->uc & value2);
7155 exp->expType = op1->type;
7157 op1->type->refCount++;
7162 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7164 int value2 = op2->i;
7167 exp->string = PrintInt(op1->i | value2);
7170 exp->expType = op1->type;
7172 op1->type->refCount++;
7177 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7179 unsigned int value2 = op2->ui;
7182 exp->string = PrintUInt(op1->ui | value2);
7185 exp->expType = op1->type;
7187 op1->type->refCount++;
7192 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7194 short value2 = op2->s;
7197 exp->string = PrintShort(op1->s | value2);
7200 exp->expType = op1->type;
7202 op1->type->refCount++;
7207 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7209 unsigned short value2 = op2->us;
7212 exp->string = PrintUShort(op1->us | value2);
7215 exp->expType = op1->type;
7217 op1->type->refCount++;
7222 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7224 char value2 = op2->c;
7227 exp->string = PrintChar(op1->c | value2);
7230 exp->expType = op1->type;
7232 op1->type->refCount++;
7237 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7239 unsigned char value2 = op2->uc;
7242 exp->string = PrintUChar(op1->uc | value2);
7245 exp->expType = op1->type;
7247 op1->type->refCount++;
7252 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7254 int value2 = op2->i;
7257 exp->string = PrintInt(op1->i ^ value2);
7260 exp->expType = op1->type;
7262 op1->type->refCount++;
7267 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7269 unsigned int value2 = op2->ui;
7272 exp->string = PrintUInt(op1->ui ^ value2);
7275 exp->expType = op1->type;
7277 op1->type->refCount++;
7282 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7284 short value2 = op2->s;
7287 exp->string = PrintShort(op1->s ^ value2);
7290 exp->expType = op1->type;
7292 op1->type->refCount++;
7297 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7299 unsigned short value2 = op2->us;
7302 exp->string = PrintUShort(op1->us ^ value2);
7305 exp->expType = op1->type;
7307 op1->type->refCount++;
7312 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7314 char value2 = op2->c;
7317 exp->string = PrintChar(op1->c ^ value2);
7320 exp->expType = op1->type;
7322 op1->type->refCount++;
7327 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7329 unsigned char value2 = op2->uc;
7332 exp->string = PrintUChar(op1->uc ^ value2);
7335 exp->expType = op1->type;
7337 op1->type->refCount++;
7342 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7344 int value2 = op2->i;
7347 exp->string = PrintInt(op1->i << value2);
7350 exp->expType = op1->type;
7352 op1->type->refCount++;
7357 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7359 unsigned int value2 = op2->ui;
7362 exp->string = PrintUInt(op1->ui << value2);
7365 exp->expType = op1->type;
7367 op1->type->refCount++;
7372 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7374 short value2 = op2->s;
7377 exp->string = PrintShort(op1->s << value2);
7380 exp->expType = op1->type;
7382 op1->type->refCount++;
7387 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7389 unsigned short value2 = op2->us;
7392 exp->string = PrintUShort(op1->us << value2);
7395 exp->expType = op1->type;
7397 op1->type->refCount++;
7402 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7404 char value2 = op2->c;
7407 exp->string = PrintChar(op1->c << value2);
7410 exp->expType = op1->type;
7412 op1->type->refCount++;
7417 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7419 unsigned char value2 = op2->uc;
7422 exp->string = PrintUChar(op1->uc << value2);
7425 exp->expType = op1->type;
7427 op1->type->refCount++;
7432 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7434 int value2 = op2->i;
7437 exp->string = PrintInt(op1->i >> value2);
7440 exp->expType = op1->type;
7442 op1->type->refCount++;
7447 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7449 unsigned int value2 = op2->ui;
7452 exp->string = PrintUInt(op1->ui >> value2);
7455 exp->expType = op1->type;
7457 op1->type->refCount++;
7462 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7464 short value2 = op2->s;
7467 exp->string = PrintShort(op1->s >> value2);
7470 exp->expType = op1->type;
7472 op1->type->refCount++;
7477 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7479 unsigned short value2 = op2->us;
7482 exp->string = PrintUShort(op1->us >> value2);
7485 exp->expType = op1->type;
7487 op1->type->refCount++;
7492 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7494 char value2 = op2->c;
7497 exp->string = PrintChar(op1->c >> value2);
7500 exp->expType = op1->type;
7502 op1->type->refCount++;
7507 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7509 unsigned char value2 = op2->uc;
7512 exp->string = PrintUChar(op1->uc >> value2);
7515 exp->expType = op1->type;
7517 op1->type->refCount++;
7522 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7525 exp->string = PrintInt(~op1->i);
7528 exp->expType = op1->type;
7530 op1->type->refCount++;
7535 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7538 exp->string = PrintUInt(~op1->ui);
7541 exp->expType = op1->type;
7543 op1->type->refCount++;
7548 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7551 exp->string = PrintShort(~op1->s);
7554 exp->expType = op1->type;
7556 op1->type->refCount++;
7561 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7564 exp->string = PrintUShort(~op1->us);
7567 exp->expType = op1->type;
7569 op1->type->refCount++;
7574 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7577 exp->string = PrintChar(~op1->c);
7580 exp->expType = op1->type;
7582 op1->type->refCount++;
7587 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7590 exp->string = PrintUChar(~op1->uc);
7593 exp->expType = op1->type;
7595 op1->type->refCount++;
7600 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7602 int value2 = op2->i;
7605 exp->string = PrintInt(op1->i &= value2);
7608 exp->expType = op1->type;
7610 op1->type->refCount++;
7615 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7617 unsigned int value2 = op2->ui;
7620 exp->string = PrintUInt(op1->ui &= value2);
7623 exp->expType = op1->type;
7625 op1->type->refCount++;
7630 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7632 short value2 = op2->s;
7635 exp->string = PrintShort(op1->s &= value2);
7638 exp->expType = op1->type;
7640 op1->type->refCount++;
7645 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7647 unsigned short value2 = op2->us;
7650 exp->string = PrintUShort(op1->us &= value2);
7653 exp->expType = op1->type;
7655 op1->type->refCount++;
7660 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7662 char value2 = op2->c;
7665 exp->string = PrintChar(op1->c &= value2);
7668 exp->expType = op1->type;
7670 op1->type->refCount++;
7675 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7677 unsigned char value2 = op2->uc;
7680 exp->string = PrintUChar(op1->uc &= value2);
7683 exp->expType = op1->type;
7685 op1->type->refCount++;
7690 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7692 int value2 = op2->i;
7695 exp->string = PrintInt(op1->i |= value2);
7698 exp->expType = op1->type;
7700 op1->type->refCount++;
7705 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7707 unsigned int value2 = op2->ui;
7710 exp->string = PrintUInt(op1->ui |= value2);
7713 exp->expType = op1->type;
7715 op1->type->refCount++;
7720 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7722 short value2 = op2->s;
7725 exp->string = PrintShort(op1->s |= value2);
7728 exp->expType = op1->type;
7730 op1->type->refCount++;
7735 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7737 unsigned short value2 = op2->us;
7740 exp->string = PrintUShort(op1->us |= value2);
7743 exp->expType = op1->type;
7745 op1->type->refCount++;
7750 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7752 char value2 = op2->c;
7755 exp->string = PrintChar(op1->c |= value2);
7758 exp->expType = op1->type;
7760 op1->type->refCount++;
7765 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7767 unsigned char value2 = op2->uc;
7770 exp->string = PrintUChar(op1->uc |= value2);
7773 exp->expType = op1->type;
7775 op1->type->refCount++;
7780 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7782 int value2 = op2->i;
7785 exp->string = PrintInt(op1->i ^= value2);
7788 exp->expType = op1->type;
7790 op1->type->refCount++;
7795 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7797 unsigned int value2 = op2->ui;
7800 exp->string = PrintUInt(op1->ui ^= value2);
7803 exp->expType = op1->type;
7805 op1->type->refCount++;
7810 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7812 short value2 = op2->s;
7815 exp->string = PrintShort(op1->s ^= value2);
7818 exp->expType = op1->type;
7820 op1->type->refCount++;
7825 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7827 unsigned short value2 = op2->us;
7830 exp->string = PrintUShort(op1->us ^= value2);
7833 exp->expType = op1->type;
7835 op1->type->refCount++;
7840 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7842 char value2 = op2->c;
7845 exp->string = PrintChar(op1->c ^= value2);
7848 exp->expType = op1->type;
7850 op1->type->refCount++;
7855 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7857 unsigned char value2 = op2->uc;
7860 exp->string = PrintUChar(op1->uc ^= value2);
7863 exp->expType = op1->type;
7865 op1->type->refCount++;
7870 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7872 int value2 = op2->i;
7875 exp->string = PrintInt(op1->i <<= value2);
7878 exp->expType = op1->type;
7880 op1->type->refCount++;
7885 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7887 unsigned int value2 = op2->ui;
7890 exp->string = PrintUInt(op1->ui <<= value2);
7893 exp->expType = op1->type;
7895 op1->type->refCount++;
7900 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7902 short value2 = op2->s;
7905 exp->string = PrintShort(op1->s <<= value2);
7908 exp->expType = op1->type;
7910 op1->type->refCount++;
7915 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7917 unsigned short value2 = op2->us;
7920 exp->string = PrintUShort(op1->us <<= value2);
7923 exp->expType = op1->type;
7925 op1->type->refCount++;
7930 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7932 char value2 = op2->c;
7935 exp->string = PrintChar(op1->c <<= value2);
7938 exp->expType = op1->type;
7940 op1->type->refCount++;
7945 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7947 unsigned char value2 = op2->uc;
7950 exp->string = PrintUChar(op1->uc <<= value2);
7953 exp->expType = op1->type;
7955 op1->type->refCount++;
7960 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7962 int value2 = op2->i;
7965 exp->string = PrintInt(op1->i >>= value2);
7968 exp->expType = op1->type;
7970 op1->type->refCount++;
7975 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7977 unsigned int value2 = op2->ui;
7980 exp->string = PrintUInt(op1->ui >>= value2);
7983 exp->expType = op1->type;
7985 op1->type->refCount++;
7990 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7992 short value2 = op2->s;
7995 exp->string = PrintShort(op1->s >>= value2);
7998 exp->expType = op1->type;
8000 op1->type->refCount++;
8005 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8007 unsigned short value2 = op2->us;
8010 exp->string = PrintUShort(op1->us >>= value2);
8013 exp->expType = op1->type;
8015 op1->type->refCount++;
8020 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8022 char value2 = op2->c;
8025 exp->string = PrintChar(op1->c >>= value2);
8028 exp->expType = op1->type;
8030 op1->type->refCount++;
8035 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8037 unsigned char value2 = op2->uc;
8040 exp->string = PrintUChar(op1->uc >>= value2);
8043 exp->expType = op1->type;
8045 op1->type->refCount++;
8050 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8053 exp->string = PrintInt(!op1->i);
8056 exp->expType = op1->type;
8058 op1->type->refCount++;
8063 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8066 exp->string = PrintUInt(!op1->ui);
8069 exp->expType = op1->type;
8071 op1->type->refCount++;
8076 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8079 exp->string = PrintShort(!op1->s);
8082 exp->expType = op1->type;
8084 op1->type->refCount++;
8089 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8092 exp->string = PrintUShort(!op1->us);
8095 exp->expType = op1->type;
8097 op1->type->refCount++;
8102 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8105 exp->string = PrintChar(!op1->c);
8108 exp->expType = op1->type;
8110 op1->type->refCount++;
8115 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8118 exp->string = PrintUChar(!op1->uc);
8121 exp->expType = op1->type;
8123 op1->type->refCount++;
8128 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8130 int value2 = op2->i;
8133 exp->string = PrintInt(op1->i == value2);
8136 exp->expType = op1->type;
8138 op1->type->refCount++;
8143 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8145 unsigned int value2 = op2->ui;
8148 exp->string = PrintUInt(op1->ui == value2);
8151 exp->expType = op1->type;
8153 op1->type->refCount++;
8158 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8160 short value2 = op2->s;
8163 exp->string = PrintShort(op1->s == value2);
8166 exp->expType = op1->type;
8168 op1->type->refCount++;
8173 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 unsigned short value2 = op2->us;
8178 exp->string = PrintUShort(op1->us == value2);
8181 exp->expType = op1->type;
8183 op1->type->refCount++;
8188 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 char value2 = op2->c;
8193 exp->string = PrintChar(op1->c == value2);
8196 exp->expType = op1->type;
8198 op1->type->refCount++;
8203 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 unsigned char value2 = op2->uc;
8208 exp->string = PrintUChar(op1->uc == value2);
8211 exp->expType = op1->type;
8213 op1->type->refCount++;
8218 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8220 float value2 = op2->f;
8223 exp->string = PrintFloat(op1->f == value2);
8226 exp->expType = op1->type;
8228 op1->type->refCount++;
8233 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8235 double value2 = op2->d;
8238 exp->string = PrintDouble(op1->d == value2);
8241 exp->expType = op1->type;
8243 op1->type->refCount++;
8248 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8250 int value2 = op2->i;
8253 exp->string = PrintInt(op1->i != value2);
8256 exp->expType = op1->type;
8258 op1->type->refCount++;
8263 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8265 unsigned int value2 = op2->ui;
8268 exp->string = PrintUInt(op1->ui != value2);
8271 exp->expType = op1->type;
8273 op1->type->refCount++;
8278 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8280 short value2 = op2->s;
8283 exp->string = PrintShort(op1->s != value2);
8286 exp->expType = op1->type;
8288 op1->type->refCount++;
8293 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8295 unsigned short value2 = op2->us;
8298 exp->string = PrintUShort(op1->us != value2);
8301 exp->expType = op1->type;
8303 op1->type->refCount++;
8308 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8310 char value2 = op2->c;
8313 exp->string = PrintChar(op1->c != value2);
8316 exp->expType = op1->type;
8318 op1->type->refCount++;
8323 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 unsigned char value2 = op2->uc;
8328 exp->string = PrintUChar(op1->uc != value2);
8331 exp->expType = op1->type;
8333 op1->type->refCount++;
8338 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 float value2 = op2->f;
8343 exp->string = PrintFloat(op1->f != value2);
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 double value2 = op2->d;
8358 exp->string = PrintDouble(op1->d != value2);
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 int value2 = op2->i;
8373 exp->string = PrintInt(op1->i && value2);
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 unsigned int value2 = op2->ui;
8388 exp->string = PrintUInt(op1->ui && value2);
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 short value2 = op2->s;
8403 exp->string = PrintShort(op1->s && value2);
8406 exp->expType = op1->type;
8408 op1->type->refCount++;
8413 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 unsigned short value2 = op2->us;
8418 exp->string = PrintUShort(op1->us && value2);
8421 exp->expType = op1->type;
8423 op1->type->refCount++;
8428 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 char value2 = op2->c;
8433 exp->string = PrintChar(op1->c && value2);
8436 exp->expType = op1->type;
8438 op1->type->refCount++;
8443 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 unsigned char value2 = op2->uc;
8448 exp->string = PrintUChar(op1->uc && value2);
8451 exp->expType = op1->type;
8453 op1->type->refCount++;
8458 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 float value2 = op2->f;
8463 exp->string = PrintFloat(op1->f && value2);
8466 exp->expType = op1->type;
8468 op1->type->refCount++;
8473 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 double value2 = op2->d;
8478 exp->string = PrintDouble(op1->d && value2);
8481 exp->expType = op1->type;
8483 op1->type->refCount++;
8488 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 int value2 = op2->i;
8493 exp->string = PrintInt(op1->i || value2);
8496 exp->expType = op1->type;
8498 op1->type->refCount++;
8503 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 unsigned int value2 = op2->ui;
8508 exp->string = PrintUInt(op1->ui || value2);
8511 exp->expType = op1->type;
8513 op1->type->refCount++;
8518 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 short value2 = op2->s;
8523 exp->string = PrintShort(op1->s || value2);
8526 exp->expType = op1->type;
8528 op1->type->refCount++;
8533 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 unsigned short value2 = op2->us;
8538 exp->string = PrintUShort(op1->us || value2);
8541 exp->expType = op1->type;
8543 op1->type->refCount++;
8548 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 char value2 = op2->c;
8553 exp->string = PrintChar(op1->c || value2);
8556 exp->expType = op1->type;
8558 op1->type->refCount++;
8563 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 unsigned char value2 = op2->uc;
8568 exp->string = PrintUChar(op1->uc || value2);
8571 exp->expType = op1->type;
8573 op1->type->refCount++;
8578 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 float value2 = op2->f;
8583 exp->string = PrintFloat(op1->f || value2);
8586 exp->expType = op1->type;
8588 op1->type->refCount++;
8593 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 double value2 = op2->d;
8598 exp->string = PrintDouble(op1->d || value2);
8601 exp->expType = op1->type;
8603 op1->type->refCount++;
8608 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 int value2 = op2->i;
8613 exp->string = PrintInt(op1->i > value2);
8616 exp->expType = op1->type;
8618 op1->type->refCount++;
8623 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 unsigned int value2 = op2->ui;
8628 exp->string = PrintUInt(op1->ui > value2);
8631 exp->expType = op1->type;
8633 op1->type->refCount++;
8638 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 short value2 = op2->s;
8643 exp->string = PrintShort(op1->s > value2);
8646 exp->expType = op1->type;
8648 op1->type->refCount++;
8653 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 unsigned short value2 = op2->us;
8658 exp->string = PrintUShort(op1->us > value2);
8661 exp->expType = op1->type;
8663 op1->type->refCount++;
8668 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 char value2 = op2->c;
8673 exp->string = PrintChar(op1->c > value2);
8676 exp->expType = op1->type;
8678 op1->type->refCount++;
8683 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 unsigned char value2 = op2->uc;
8688 exp->string = PrintUChar(op1->uc > value2);
8691 exp->expType = op1->type;
8693 op1->type->refCount++;
8698 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 float value2 = op2->f;
8703 exp->string = PrintFloat(op1->f > value2);
8706 exp->expType = op1->type;
8708 op1->type->refCount++;
8713 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 double value2 = op2->d;
8718 exp->string = PrintDouble(op1->d > value2);
8721 exp->expType = op1->type;
8723 op1->type->refCount++;
8728 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 int value2 = op2->i;
8733 exp->string = PrintInt(op1->i < value2);
8736 exp->expType = op1->type;
8738 op1->type->refCount++;
8743 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 unsigned int value2 = op2->ui;
8748 exp->string = PrintUInt(op1->ui < value2);
8751 exp->expType = op1->type;
8753 op1->type->refCount++;
8758 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 short value2 = op2->s;
8763 exp->string = PrintShort(op1->s < value2);
8766 exp->expType = op1->type;
8768 op1->type->refCount++;
8773 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 unsigned short value2 = op2->us;
8778 exp->string = PrintUShort(op1->us < value2);
8781 exp->expType = op1->type;
8783 op1->type->refCount++;
8788 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 char value2 = op2->c;
8793 exp->string = PrintChar(op1->c < value2);
8796 exp->expType = op1->type;
8798 op1->type->refCount++;
8803 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 unsigned char value2 = op2->uc;
8808 exp->string = PrintUChar(op1->uc < value2);
8811 exp->expType = op1->type;
8813 op1->type->refCount++;
8818 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 float value2 = op2->f;
8823 exp->string = PrintFloat(op1->f < value2);
8826 exp->expType = op1->type;
8828 op1->type->refCount++;
8833 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 double value2 = op2->d;
8838 exp->string = PrintDouble(op1->d < value2);
8841 exp->expType = op1->type;
8843 op1->type->refCount++;
8848 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 int value2 = op2->i;
8853 exp->string = PrintInt(op1->i >= value2);
8856 exp->expType = op1->type;
8858 op1->type->refCount++;
8863 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 unsigned int value2 = op2->ui;
8868 exp->string = PrintUInt(op1->ui >= value2);
8871 exp->expType = op1->type;
8873 op1->type->refCount++;
8878 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 short value2 = op2->s;
8883 exp->string = PrintShort(op1->s >= value2);
8886 exp->expType = op1->type;
8888 op1->type->refCount++;
8893 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 unsigned short value2 = op2->us;
8898 exp->string = PrintUShort(op1->us >= value2);
8901 exp->expType = op1->type;
8903 op1->type->refCount++;
8908 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 char value2 = op2->c;
8913 exp->string = PrintChar(op1->c >= value2);
8916 exp->expType = op1->type;
8918 op1->type->refCount++;
8923 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8925 unsigned char value2 = op2->uc;
8928 exp->string = PrintUChar(op1->uc >= value2);
8931 exp->expType = op1->type;
8933 op1->type->refCount++;
8938 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8940 float value2 = op2->f;
8943 exp->string = PrintFloat(op1->f >= value2);
8946 exp->expType = op1->type;
8948 op1->type->refCount++;
8953 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8955 double value2 = op2->d;
8958 exp->string = PrintDouble(op1->d >= value2);
8961 exp->expType = op1->type;
8963 op1->type->refCount++;
8968 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8970 int value2 = op2->i;
8973 exp->string = PrintInt(op1->i <= value2);
8976 exp->expType = op1->type;
8978 op1->type->refCount++;
8983 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8985 unsigned int value2 = op2->ui;
8988 exp->string = PrintUInt(op1->ui <= value2);
8991 exp->expType = op1->type;
8993 op1->type->refCount++;
8998 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9000 short value2 = op2->s;
9003 exp->string = PrintShort(op1->s <= value2);
9006 exp->expType = op1->type;
9008 op1->type->refCount++;
9013 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9015 unsigned short value2 = op2->us;
9018 exp->string = PrintUShort(op1->us <= value2);
9021 exp->expType = op1->type;
9023 op1->type->refCount++;
9028 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9030 char value2 = op2->c;
9033 exp->string = PrintChar(op1->c <= value2);
9036 exp->expType = op1->type;
9038 op1->type->refCount++;
9043 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9045 unsigned char value2 = op2->uc;
9048 exp->string = PrintUChar(op1->uc <= value2);
9051 exp->expType = op1->type;
9053 op1->type->refCount++;
9058 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9060 float value2 = op2->f;
9063 exp->string = PrintFloat(op1->f <= value2);
9066 exp->expType = op1->type;
9068 op1->type->refCount++;
9073 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9075 double value2 = op2->d;
9078 exp->string = PrintDouble(op1->d <= value2);
9081 exp->expType = op1->type;
9083 op1->type->refCount++;
9088 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9091 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9094 exp->expType = op1->type;
9096 op1->type->refCount++;
9101 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9104 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9107 exp->expType = op1->type;
9109 op1->type->refCount++;
9114 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9117 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9120 exp->expType = op1->type;
9122 op1->type->refCount++;
9127 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9130 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9133 exp->expType = op1->type;
9135 op1->type->refCount++;
9140 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9143 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9146 exp->expType = op1->type;
9148 op1->type->refCount++;
9153 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9156 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9159 exp->expType = op1->type;
9161 op1->type->refCount++;
9166 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9169 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9172 exp->expType = op1->type;
9174 op1->type->refCount++;
9179 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9182 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9185 exp->expType = op1->type;
9187 op1->type->refCount++;
9192 struct OpTable intOps =
9194 IntAdd, IntSub, IntMul, IntDiv, IntMod, IntNeg, IntInc, IntDec, IntAsign, IntAddAsign, IntSubAsign, IntMulAsign, IntDivAsign, IntModAsign, IntBitAnd, IntBitOr, IntBitXor, IntLShift, IntRShift, IntBitNot, IntAndAsign, IntOrAsign, IntXorAsign, IntLShiftAsign, IntRShiftAsign, IntNot, IntEqu, IntNqu, IntAnd, IntOr, IntGrt, IntSma, IntGrtEqu, IntSmaEqu, IntCond
9197 struct OpTable uintOps =
9199 UIntAdd, UIntSub, UIntMul, UIntDiv, UIntMod, UIntNeg, UIntInc, UIntDec, UIntAsign, UIntAddAsign, UIntSubAsign, UIntMulAsign, UIntDivAsign, UIntModAsign, UIntBitAnd, UIntBitOr, UIntBitXor, UIntLShift, UIntRShift, UIntBitNot, UIntAndAsign, UIntOrAsign, UIntXorAsign, UIntLShiftAsign, UIntRShiftAsign, UIntNot, UIntEqu, UIntNqu, UIntAnd, UIntOr, UIntGrt, UIntSma, UIntGrtEqu, UIntSmaEqu, UIntCond
9202 struct OpTable shortOps =
9204 ShortAdd, ShortSub, ShortMul, ShortDiv, ShortMod, ShortNeg, ShortInc, ShortDec, ShortAsign, ShortAddAsign, ShortSubAsign, ShortMulAsign, ShortDivAsign, ShortModAsign, ShortBitAnd, ShortBitOr, ShortBitXor, ShortLShift, ShortRShift, ShortBitNot, ShortAndAsign, ShortOrAsign, ShortXorAsign, ShortLShiftAsign, ShortRShiftAsign, ShortNot, ShortEqu, ShortNqu, ShortAnd, ShortOr, ShortGrt, ShortSma, ShortGrtEqu, ShortSmaEqu, ShortCond
9207 struct OpTable ushortOps =
9209 UShortAdd, UShortSub, UShortMul, UShortDiv, UShortMod, UShortNeg, UShortInc, UShortDec, UShortAsign, UShortAddAsign, UShortSubAsign, UShortMulAsign, UShortDivAsign, UShortModAsign, UShortBitAnd, UShortBitOr, UShortBitXor, UShortLShift, UShortRShift, UShortBitNot, UShortAndAsign, UShortOrAsign, UShortXorAsign, UShortLShiftAsign, UShortRShiftAsign, UShortNot, UShortEqu, UShortNqu, UShortAnd, UShortOr, UShortGrt, UShortSma, UShortGrtEqu, UShortSmaEqu, UShortCond
9212 struct OpTable floatOps =
9214 FloatAdd, FloatSub, FloatMul, FloatDiv, (((void *)0)), FloatNeg, FloatInc, FloatDec, FloatAsign, FloatAddAsign, FloatSubAsign, FloatMulAsign, FloatDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), FloatEqu, FloatNqu, FloatAnd, FloatOr, FloatGrt, FloatSma, FloatGrtEqu, FloatSmaEqu
9217 struct OpTable doubleOps =
9219 DoubleAdd, DoubleSub, DoubleMul, DoubleDiv, (((void *)0)), DoubleNeg, DoubleInc, DoubleDec, DoubleAsign, DoubleAddAsign, DoubleSubAsign, DoubleMulAsign, DoubleDivAsign, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)), DoubleEqu, DoubleNqu, DoubleAnd, DoubleOr, DoubleGrt, DoubleSma, DoubleGrtEqu, DoubleSmaEqu
9222 struct OpTable charOps =
9224 CharAdd, CharSub, CharMul, CharDiv, CharMod, CharNeg, CharInc, CharDec, CharAsign, CharAddAsign, CharSubAsign, CharMulAsign, CharDivAsign, CharModAsign, CharBitAnd, CharBitOr, CharBitXor, CharLShift, CharRShift, CharBitNot, CharAndAsign, CharOrAsign, CharXorAsign, CharLShiftAsign, CharRShiftAsign, CharNot, CharEqu, CharNqu, CharAnd, CharOr, CharGrt, CharSma, CharGrtEqu, CharSmaEqu, CharCond
9227 struct OpTable ucharOps =
9229 UCharAdd, UCharSub, UCharMul, UCharDiv, UCharMod, UCharNeg, UCharInc, UCharDec, UCharAsign, UCharAddAsign, UCharSubAsign, UCharMulAsign, UCharDivAsign, UCharModAsign, UCharBitAnd, UCharBitOr, UCharBitXor, UCharLShift, UCharRShift, UCharBitNot, UCharAndAsign, UCharOrAsign, UCharXorAsign, UCharLShiftAsign, UCharRShiftAsign, UCharNot, UCharEqu, UCharNqu, UCharAnd, UCharOr, UCharGrt, UCharSma, UCharGrtEqu, UCharSmaEqu, UCharCond
9232 void ReadString(char * output, char * string)
9234 int len = strlen(string);
9236 unsigned int quoted = 0x0, escaped = 0x0;
9238 for(c = 0; c < len; c++)
9240 char ch = string[c];
9296 extern double strtod(char * , char * * );
9298 struct Operand GetOperand(struct Expression * exp)
9304 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9307 struct Type * type = exp->expType;
9311 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9313 if(!type->_class->registered->dataType)
9314 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9315 type = type->_class->registered->dataType;
9317 op.kind = type->kind;
9318 op.type = exp->expType;
9319 if(exp->isConstant && exp->type == 2)
9325 if(exp->constant[0] == '\'')
9326 op.c = exp->constant[1];
9327 else if(type->isSigned)
9329 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9334 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9342 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9347 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9355 op.i = strtol(exp->constant, (((void *)0)), 0);
9360 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9368 op.i64 = _strtoi64(exp->constant, (((void *)0)), 0);
9373 op.ui64 = _strtoui64(exp->constant, (((void *)0)), 0);
9381 op.iptr = (intptr_t)_strtoi64(exp->constant, (((void *)0)), 0);
9386 op.uiptr = (uintptr_t)_strtoui64(exp->constant, (((void *)0)), 0);
9392 op.f = (float)strtod(exp->constant, (((void *)0)));
9396 op.d = (double)strtod(exp->constant, (((void *)0)));
9402 op.p = (unsigned char *)strtoul(exp->constant, (((void *)0)), 0);
9412 int __ecereVMethodID_class_OnGetString;
9414 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9416 static void UnusedFunction()
9420 ((char * (*)(struct __ecereNameSpace__ecere__com__Class *, void *, char * tempString, void * fieldData, unsigned int * needClass))__ecereClass_int->_vTbl[__ecereVMethodID_class_OnGetString])(__ecereClass_int, &a, 0, 0, 0);
9423 extern int __ecereVMethodID_class_OnGetString;
9425 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9427 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9429 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9431 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9432 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9435 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9436 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9438 void * ptr = inst->data + dataMember->offset + offset;
9439 char * result = (((void *)0));
9441 exp->loc = member->loc = inst->loc;
9442 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9443 if(!dataMember->dataType)
9444 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9445 type = dataMember->dataType;
9448 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9450 if(_class->type == 4)
9452 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9456 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9457 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9459 for(item = e->values.first; item; item = item->next)
9461 if((int)item->data == *(int *)ptr)
9463 result = item->name;
9469 exp->identifier = MkIdentifier(result);
9471 exp->destType = MkClassType(_class->fullName);
9472 ProcessExpressionType(exp);
9476 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9478 if(!_class->dataType)
9479 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9480 type = _class->dataType;
9489 FreeExpContents(exp);
9490 exp->constant = PrintFloat(*(float *)ptr);
9496 FreeExpContents(exp);
9497 exp->constant = PrintDouble(*(double *)ptr);
9503 FreeExpContents(exp);
9504 exp->constant = PrintInt(*(int *)ptr);
9510 FreeExpContents(exp);
9511 exp->constant = PrintInt64(*(long long *)ptr);
9517 FreeExpContents(exp);
9518 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9523 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9526 ListAdd(memberList, member);
9528 if(parentDataMember->type == 1)
9533 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9535 void PopulateInstance(struct Instantiation * inst)
9537 struct Symbol * classSym = inst->_class->symbol;
9538 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9539 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9540 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9542 inst->members = MkListOne(MkMembersInitList(memberList));
9543 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9545 if(!dataMember->isProperty)
9547 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9548 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9551 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9552 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9554 void * ptr = inst->data + dataMember->offset;
9555 char * result = (((void *)0));
9557 exp->loc = member->loc = inst->loc;
9558 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9559 if(!dataMember->dataType)
9560 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9561 type = dataMember->dataType;
9564 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9566 if(_class->type == 4)
9568 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9572 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9573 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9575 for(item = e->values.first; item; item = item->next)
9577 if((int)item->data == *(int *)ptr)
9579 result = item->name;
9586 exp->identifier = MkIdentifier(result);
9588 exp->destType = MkClassType(_class->fullName);
9589 ProcessExpressionType(exp);
9592 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9594 if(!_class->dataType)
9595 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9596 type = _class->dataType;
9605 exp->constant = PrintFloat(*(float *)ptr);
9611 exp->constant = PrintDouble(*(double *)ptr);
9617 exp->constant = PrintInt(*(int *)ptr);
9623 exp->constant = PrintInt64(*(long long *)ptr);
9629 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9634 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9637 ListAdd(memberList, member);
9643 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(struct __ecereNameSpace__ecere__com__Class * _class, char * name, unsigned int * offset, struct __ecereNameSpace__ecere__com__Instance * module, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos);
9645 extern void FreeInstance(struct Instantiation * inst);
9647 void ComputeInstantiation(struct Expression * exp)
9649 struct Instantiation * inst = exp->instance;
9650 struct MembersInit * members;
9651 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9652 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9653 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9654 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9655 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9656 int subMemberStackPos = 0;
9659 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9663 if(_class->type == 0 || _class->type == 5)
9664 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9666 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9670 for(members = (*inst->members).first; members; members = members->next)
9672 switch(members->type)
9676 if(members->dataMembers)
9678 struct MemberInit * member;
9680 for(member = (*members->dataMembers).first; member; member = member->next)
9682 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9683 unsigned int found = 0x0;
9684 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9685 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9686 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9687 unsigned int dataMemberOffset;
9691 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9694 if(curMember->isProperty)
9695 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9698 dataMember = curMember;
9699 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9706 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9710 if(prop->memberAccess == 1)
9712 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9713 curClass = prop->_class;
9718 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9719 int _subMemberStackPos = 0;
9721 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9725 if(dataMember->memberAccess == 1)
9727 curMember = dataMember;
9728 curClass = dataMember->_class;
9729 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9730 subMemberStackPos = _subMemberStackPos;
9735 if(found && member->initializer && member->initializer->type == 0)
9737 struct Expression * value = member->initializer->exp;
9738 struct Type * type = (((void *)0));
9742 type = prop->dataType;
9746 if(!dataMember->dataType)
9747 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9748 type = dataMember->dataType;
9750 if(ident && ident->next)
9752 for(ident = ident->next; ident && type; ident = ident->next)
9756 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9758 type = prop->dataType;
9761 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9763 type = dataMember->dataType;
9766 else if(type->kind == 9 || type->kind == 10)
9768 struct Type * memberType;
9770 for(memberType = type->members.first; memberType; memberType = memberType->next)
9772 if(!strcmp(memberType->name, ident->string))
9783 FreeType(value->destType);
9784 value->destType = type;
9787 ComputeExpression(value);
9789 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9793 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9795 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9797 if(!_class->dataType)
9798 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9799 type = _class->dataType;
9804 void * ptr = inst->data + dataMemberOffset;
9806 if(value->type == 2)
9812 GetInt(value, (int *)ptr);
9817 GetInt64(value, (long long *)ptr);
9822 GetIntPtr(value, (intptr_t *)ptr);
9827 GetFloat(value, (float *)ptr);
9832 GetDouble(value, (double *)ptr);
9837 else if(value->type == 1)
9841 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9843 if(_class->type == 1)
9845 ComputeTypeSize(type);
9846 if(value->instance->data)
9847 memcpy(ptr, value->instance->data, type->size);
9854 if(value->type == 1 && value->instance->data)
9856 void (* Set)(void *, void *) = (void *)prop->Set;
9858 Set(inst->data, value->instance->data);
9859 PopulateInstance(inst);
9861 else if(value->type == 2)
9867 void (* Set)(void *, double) = (void *)prop->Set;
9869 Set(inst->data, strtod(value->constant, (((void *)0))));
9874 void (* Set)(void *, float) = (void *)prop->Set;
9876 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9881 void (* Set)(void *, int) = (void *)prop->Set;
9883 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9888 void (* Set)(void *, long long) = (void *)prop->Set;
9890 Set(inst->data, _strtoi64(value->constant, (((void *)0)), 0));
9895 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9897 Set(inst->data, (intptr_t)_strtoi64(value->constant, (((void *)0)), 0));
9902 else if(value->type == 3)
9906 ReadString(temp, value->string);
9907 prop->Set(inst->data, temp);
9911 else if(_class->type == 3)
9915 if(value->type == 2)
9919 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9921 if(_class->type == 3)
9923 if(!_class->dataType)
9924 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9925 type = _class->dataType;
9933 float (* Set)(float) = (void *)prop->Set;
9935 GetFloat(member->initializer->exp, &fValue);
9936 exp->constant = PrintFloat(Set(fValue));
9943 double (* Set)(double) = (void *)prop->Set;
9945 GetDouble(member->initializer->exp, &dValue);
9946 exp->constant = PrintDouble(Set(dValue));
9954 else if(_class->type == 2)
9958 if(value->type == 1 && value->instance->data)
9960 unsigned int (* Set)(void *) = (void *)prop->Set;
9962 bits = Set(value->instance->data);
9964 else if(value->type == 2)
9970 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
9974 GetInt(value, &part);
9975 bits = (bits & ~bitMember->mask);
9976 if(!bitMember->dataType)
9977 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
9978 type = bitMember->dataType;
9979 if(type->kind == 8 && type->_class && type->_class->registered)
9981 if(!type->_class->registered->dataType)
9982 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9983 type = type->_class->registered->dataType;
9989 bits |= ((char)part << bitMember->pos);
9991 bits |= ((unsigned char)part << bitMember->pos);
9995 bits |= ((short)part << bitMember->pos);
9997 bits |= ((unsigned short)part << bitMember->pos);
10002 bits |= (part << bitMember->pos);
10004 bits |= ((unsigned int)part << bitMember->pos);
10008 bits |= ((long long)part << bitMember->pos);
10010 bits |= ((uint64)part << bitMember->pos);
10014 bits |= ((intptr_t)part << bitMember->pos);
10016 bits |= ((uintptr_t)part << bitMember->pos);
10024 if(_class && _class->type == 3)
10026 ComputeExpression(member->initializer->exp);
10027 exp->constant = member->initializer->exp->constant;
10029 member->initializer->exp->constant = (((void *)0));
10039 if(_class && _class->type == 2)
10041 exp->constant = PrintHexUInt(bits);
10046 FreeInstance(inst);
10050 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10052 if(exp->op.op == SIZEOF)
10054 FreeExpContents(exp);
10056 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10066 struct Expression * exp2 = exp->op.exp2;
10068 exp->op.exp2 = (((void *)0));
10069 FreeExpContents(exp);
10070 FreeType(exp->expType);
10071 FreeType(exp->destType);
10073 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10079 FreeExpContents(exp);
10080 op1->ops.Neg(exp, op1);
10084 if(op1->ops.BitNot)
10086 FreeExpContents(exp);
10087 op1->ops.BitNot(exp, op1);
10093 FreeExpContents(exp);
10094 op1->ops.Not(exp, op1);
10106 FreeExpContents(exp);
10107 op1->ops.Add(exp, op1, op2);
10113 FreeExpContents(exp);
10114 op1->ops.Sub(exp, op1, op2);
10120 FreeExpContents(exp);
10121 op1->ops.Mul(exp, op1, op2);
10127 FreeExpContents(exp);
10128 op1->ops.Div(exp, op1, op2);
10134 FreeExpContents(exp);
10135 op1->ops.Mod(exp, op1, op2);
10141 if(op1->ops.BitAnd)
10143 FreeExpContents(exp);
10144 op1->ops.BitAnd(exp, op1, op2);
10151 FreeExpContents(exp);
10152 op1->ops.BitOr(exp, op1, op2);
10156 if(op1->ops.BitXor)
10158 FreeExpContents(exp);
10159 op1->ops.BitXor(exp, op1, op2);
10163 if(op1->ops.LShift)
10165 FreeExpContents(exp);
10166 op1->ops.LShift(exp, op1, op2);
10170 if(op1->ops.RShift)
10172 FreeExpContents(exp);
10173 op1->ops.RShift(exp, op1, op2);
10179 FreeExpContents(exp);
10180 op1->ops.Equ(exp, op1, op2);
10186 FreeExpContents(exp);
10187 op1->ops.Nqu(exp, op1, op2);
10193 FreeExpContents(exp);
10194 op1->ops.And(exp, op1, op2);
10200 FreeExpContents(exp);
10201 op1->ops.Or(exp, op1, op2);
10207 FreeExpContents(exp);
10208 op1->ops.Grt(exp, op1, op2);
10214 FreeExpContents(exp);
10215 op1->ops.Sma(exp, op1, op2);
10219 if(op1->ops.GrtEqu)
10221 FreeExpContents(exp);
10222 op1->ops.GrtEqu(exp, op1, op2);
10226 if(op1->ops.SmaEqu)
10228 FreeExpContents(exp);
10229 op1->ops.SmaEqu(exp, op1, op2);
10237 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10239 void ComputeExpression(struct Expression * exp)
10241 char expString[10240];
10243 expString[0] = '\0';
10248 ComputeInstantiation(exp);
10253 struct Expression * exp1, * exp2 = (((void *)0));
10254 struct Operand op1 =
10258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10261 struct Operand op2 =
10265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10270 ComputeExpression(exp->op.exp2);
10273 ComputeExpression(exp->op.exp1);
10274 exp1 = exp->op.exp1;
10275 exp2 = exp->op.exp2;
10276 op1 = GetOperand(exp1);
10278 op1.type->refCount++;
10281 op2 = GetOperand(exp2);
10283 op2.type->refCount++;
10288 exp1 = exp->op.exp2;
10289 op1 = GetOperand(exp1);
10291 op1.type->refCount++;
10293 CallOperator(exp, exp1, exp2, &op1, &op2);
10295 FreeType(op1.type);
10297 FreeType(op2.type);
10303 struct Expression * e, * n;
10305 for(e = (*exp->list).first; e; e = n)
10310 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10312 ComputeExpression(e);
10313 FreeType(exp->expType);
10314 FreeType(exp->destType);
10316 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10317 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10328 struct Expression * memberExp = exp->member.exp;
10329 struct Identifier * memberID = exp->member.member;
10330 struct Type * type;
10332 ComputeExpression(exp->member.exp);
10333 type = exp->member.exp->expType;
10336 struct __ecereNameSpace__ecere__com__Class * _class = (exp->member.member && exp->member.member->classSym) ? exp->member.member->classSym->registered : (((type->kind == 8 || type->kind == 19) && type->_class) ? type->_class->registered : (((void *)0)));
10337 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10338 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10339 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10341 if(type->kind == 19 && exp->member.exp->type == 26)
10342 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10346 struct Symbol * classSym;
10349 PrintType(type, string, 0x0, 0x1);
10350 classSym = FindClass(string);
10351 _class = classSym ? classSym->registered : (((void *)0));
10353 if(exp->member.member)
10355 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10357 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10359 if(!prop && !member && _class && exp->member.member)
10361 struct Symbol * classSym = FindClass(exp->member.member->string);
10363 convertTo = _class;
10364 _class = classSym ? classSym->registered : (((void *)0));
10365 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10371 struct Type * type = prop->dataType;
10373 if(_class->type == 3)
10375 if(type->kind == 8)
10377 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10379 if(_class->type == 3)
10381 if(!_class->dataType)
10382 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10383 type = _class->dataType;
10391 float (* Get)(float) = (void *)prop->Get;
10393 GetFloat(exp->member.exp, &value);
10394 exp->constant = PrintFloat(Get ? Get(value) : value);
10401 double (* Get)(double);
10403 GetDouble(exp->member.exp, &value);
10405 Get = (void *)prop->Set;
10407 Get = (void *)prop->Get;
10408 exp->constant = PrintDouble(Get ? Get(value) : value);
10418 struct Expression * value = exp->member.exp;
10419 struct Type * type;
10421 if(!prop->dataType)
10422 ProcessPropertyType(prop);
10423 type = prop->dataType;
10427 else if(_class->type == 1)
10433 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10435 if(propertyClass->type == 1 && value->type == 1)
10437 void (* Set)(void *, void *) = (void *)prop->Set;
10439 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10440 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10441 exp->instance->_class = MkSpecifierName(_class->fullName);
10442 exp->instance->loc = exp->loc;
10444 Set(exp->instance->data, value->instance->data);
10445 PopulateInstance(exp->instance);
10452 void (* Set)(void *, int) = (void *)prop->Set;
10454 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10455 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10456 exp->instance->_class = MkSpecifierName(_class->fullName);
10457 exp->instance->loc = exp->loc;
10459 GetInt(value, &intValue);
10460 Set(exp->instance->data, intValue);
10461 PopulateInstance(exp->instance);
10466 long long intValue;
10467 void (* Set)(void *, long long) = (void *)prop->Set;
10469 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10470 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10471 exp->instance->_class = MkSpecifierName(_class->fullName);
10472 exp->instance->loc = exp->loc;
10474 GetInt64(value, &intValue);
10475 Set(exp->instance->data, intValue);
10476 PopulateInstance(exp->instance);
10482 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10484 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10485 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10486 exp->instance->_class = MkSpecifierName(_class->fullName);
10487 exp->instance->loc = exp->loc;
10489 GetIntPtr(value, &intValue);
10490 Set(exp->instance->data, intValue);
10491 PopulateInstance(exp->instance);
10496 double doubleValue;
10497 void (* Set)(void *, double) = (void *)prop->Set;
10499 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10500 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10501 exp->instance->_class = MkSpecifierName(_class->fullName);
10502 exp->instance->loc = exp->loc;
10504 GetDouble(value, &doubleValue);
10505 Set(exp->instance->data, doubleValue);
10506 PopulateInstance(exp->instance);
10511 else if(_class->type == 2)
10517 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10519 if(propertyClass->type == 1 && value->instance->data)
10521 unsigned int (* Set)(void *) = (void *)prop->Set;
10522 unsigned int bits = Set(value->instance->data);
10524 exp->constant = PrintHexUInt(bits);
10528 else if(_class->type == 2)
10530 unsigned int value;
10531 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10534 GetUInt(exp->member.exp, &value);
10536 exp->constant = PrintHexUInt(bits);
10545 if(_class->type == 2)
10547 unsigned int value;
10549 GetUInt(exp->member.exp, &value);
10554 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10556 if(_class->type == 1)
10558 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10560 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10561 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10562 exp->instance->_class = MkSpecifierName(_class->fullName);
10563 exp->instance->loc = exp->loc;
10565 Get(value, exp->instance->data);
10566 PopulateInstance(exp->instance);
10568 else if(_class->type == 2)
10570 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10571 uint64 bits = Get(value);
10573 exp->constant = PrintHexUInt64(bits);
10580 else if(_class->type == 1)
10582 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10588 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10590 if(_class->type == 1 && value)
10592 void (* Get)(void *, void *) = (void *)prop->Get;
10594 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10595 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10596 exp->instance->_class = MkSpecifierName(_class->fullName);
10597 exp->instance->loc = exp->loc;
10599 Get(value, exp->instance->data);
10600 PopulateInstance(exp->instance);
10611 exp->isConstant = 0x0;
10620 FreeExpression(memberExp);
10621 FreeIdentifier(memberID);
10627 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10629 FreeExpContents(exp);
10630 exp->constant = PrintUInt(ComputeTypeSize(type));
10637 struct Symbol * classSym = exp->_class->symbol;
10639 if(classSym && classSym->registered)
10641 if(classSym->registered->fixed)
10643 FreeSpecifier(exp->_class);
10644 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10649 char className[1024];
10651 strcpy(className, "__ecereClass_");
10652 FullClassNameCat(className, classSym->string, 0x1);
10653 MangleClassName(className);
10654 FreeExpContents(exp);
10656 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10657 exp->member.member = MkIdentifier("structSize");
10664 struct Type * type;
10665 struct Expression * e = exp;
10667 if(exp->type == 11)
10670 ComputeExpression(exp->cast.exp);
10673 if(e && exp->expType)
10675 type = exp->expType;
10676 if(type->kind == 8)
10678 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10680 if(_class && (_class->type == 3 || _class->type == 2))
10682 if(!_class->dataType)
10683 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10684 type = _class->dataType;
10694 GetChar(e, &value);
10695 FreeExpContents(exp);
10696 exp->constant = PrintChar(value);
10701 unsigned char value;
10703 GetUChar(e, &value);
10704 FreeExpContents(exp);
10705 exp->constant = PrintUChar(value);
10714 GetShort(e, &value);
10715 FreeExpContents(exp);
10716 exp->constant = PrintShort(value);
10721 unsigned short value;
10723 GetUShort(e, &value);
10724 FreeExpContents(exp);
10725 exp->constant = PrintUShort(value);
10735 FreeExpContents(exp);
10736 exp->constant = PrintInt(value);
10741 unsigned int value;
10743 GetUInt(e, &value);
10744 FreeExpContents(exp);
10745 exp->constant = PrintUInt(value);
10754 GetInt64(e, &value);
10755 FreeExpContents(exp);
10756 exp->constant = PrintInt64(value);
10763 GetUInt64(e, &value);
10764 FreeExpContents(exp);
10765 exp->constant = PrintUInt64(value);
10774 GetIntPtr(e, &value);
10775 FreeExpContents(exp);
10776 exp->constant = PrintInt64((long long)value);
10783 GetUIntPtr(e, &value);
10784 FreeExpContents(exp);
10785 exp->constant = PrintUInt64((uint64)value);
10793 GetFloat(e, &value);
10794 FreeExpContents(exp);
10795 exp->constant = PrintFloat(value);
10803 GetDouble(e, &value);
10804 FreeExpContents(exp);
10805 exp->constant = PrintDouble(value);
10815 struct Operand op1 =
10819 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10822 struct Operand op2 =
10826 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10829 struct Operand op3 =
10833 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10838 ComputeExpression((*exp->cond.exp).last);
10839 if(exp->cond.elseExp)
10840 ComputeExpression(exp->cond.elseExp);
10842 ComputeExpression(exp->cond.cond);
10843 op1 = GetOperand(exp->cond.cond);
10845 op1.type->refCount++;
10846 op2 = GetOperand((*exp->cond.exp).last);
10848 op2.type->refCount++;
10849 op3 = GetOperand(exp->cond.elseExp);
10851 op3.type->refCount++;
10854 FreeExpContents(exp);
10855 op1.ops.Cond(exp, &op1, &op2, &op3);
10858 FreeType(op1.type);
10860 FreeType(op2.type);
10862 FreeType(op3.type);
10868 void ApplyAnyObjectLogic(struct Expression * e);
10870 extern void CopyTypeInto(struct Type * type, struct Type * src);
10872 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10874 unsigned int result = 0x1;
10878 struct __ecereNameSpace__ecere__sys__OldList converts =
10882 struct Conversion * convert;
10884 if(destType->kind == 0)
10886 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
10890 for(convert = converts.first; convert; convert = convert->next)
10892 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
10896 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10897 int objectType = exp->expType ? exp->expType->classObjectType : 0;
10900 newExp->destType = (((void *)0));
10904 exp->addedThis = 0x1;
10905 exp->member.exp = newExp;
10906 FreeType(exp->member.exp->expType);
10907 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
10908 exp->member.exp->expType->classObjectType = objectType;
10909 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
10910 exp->member.memberType = 1;
10911 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10912 exp->needCast = 0x1;
10914 exp->expType->refCount++;
10915 ApplyAnyObjectLogic(exp->member.exp);
10921 exp->addedThis = 0x1;
10922 exp->member.exp = newExp;
10923 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
10925 newExp->byReference = 0x1;
10927 FreeType(exp->member.exp->expType);
10928 exp->member.exp->expType = (((void *)0));
10929 if(convert->convert->dataType)
10931 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
10932 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
10933 exp->member.exp->expType->refCount = 1;
10934 exp->member.exp->expType->classObjectType = objectType;
10935 ApplyAnyObjectLogic(exp->member.exp);
10937 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
10938 exp->member.memberType = 4;
10939 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10940 exp->needCast = 0x1;
10941 if(convert->resultType)
10942 convert->resultType->refCount++;
10948 FreeType(exp->expType);
10951 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
10952 exp->needCast = 0x1;
10954 exp->expType->refCount++;
10958 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
10959 exp->needCast = 0x1;
10960 if(convert->resultType)
10961 convert->resultType->refCount++;
10965 if(exp->isConstant && inCompiler)
10966 ComputeExpression(exp);
10967 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
10969 if(!result && exp->expType && converts.count)
10971 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
10973 if(!result && exp->expType && exp->destType)
10975 if((exp->destType->kind == 8 && exp->expType->kind == 13 && exp->expType->type->kind == 8 && exp->expType->type->_class == exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered->type == 1) || (exp->expType->kind == 8 && exp->destType->kind == 13 && exp->destType->type->kind == 8 && exp->destType->type->_class == exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1))
10982 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
10984 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
10986 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
10988 void CheckTemplateTypes(struct Expression * exp)
10990 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
10992 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10993 struct Statement * compound;
10994 struct Context * context;
10998 exp->destType->refCount++;
11000 exp->expType->refCount++;
11001 newExp->prev = (((void *)0));
11002 newExp->next = (((void *)0));
11003 switch(exp->expType->kind)
11006 if(exp->destType->classObjectType)
11009 exp->destType->refCount--;
11011 exp->expType->refCount--;
11012 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11016 struct __ecereNameSpace__ecere__sys__OldList * specs;
11017 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11018 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11020 context = PushContext();
11021 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11022 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11023 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11025 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11026 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11027 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11028 exp->compound->compound.context = context;
11029 PopContext(context);
11034 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11035 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11039 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11041 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11042 struct Statement * compound;
11043 struct Context * context;
11047 exp->destType->refCount++;
11049 exp->expType->refCount++;
11050 newExp->prev = (((void *)0));
11051 newExp->next = (((void *)0));
11052 switch(exp->expType->kind)
11055 if(exp->destType->classObjectType)
11058 exp->destType->refCount--;
11060 exp->expType->refCount--;
11061 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11065 struct __ecereNameSpace__ecere__sys__OldList * specs;
11066 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11067 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11069 context = PushContext();
11070 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11071 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11072 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11074 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11075 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11076 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11077 exp->compound->compound.context = context;
11078 PopContext(context);
11083 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11086 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11087 ProcessExpressionType((*exp->list).first);
11093 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11094 newExp->needCast = 0x1;
11095 ProcessExpressionType((*exp->list).first);
11101 if(exp->expType->kind == 20)
11103 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11107 FreeType(exp->destType);
11108 FreeType(exp->expType);
11109 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11113 if(newExp->type == 8 && newExp->member.memberType == 3)
11117 exp->op.exp1 = (((void *)0));
11118 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11122 char typeString[1024];
11123 struct Declarator * decl;
11124 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11126 typeString[0] = '\0';
11127 PrintType(exp->expType, typeString, 0x0, 0x0);
11128 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11130 exp->cast.typeName = MkTypeName(specs, decl);
11131 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11132 exp->cast.exp->needCast = 0x1;
11140 extern int strncmp(const char * , const char * , int n);
11142 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11144 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11146 int nsLen = strlen(nameSpace);
11147 struct Symbol * symbol;
11149 for(symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(tree, nameSpace); symbol; symbol = (struct Symbol *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)symbol)))
11151 char * s = symbol->string;
11153 if(!strncmp(s, nameSpace, nsLen))
11158 for(c = strlen(s) - 1; c >= 0; c--)
11161 namePart = s + c + 1;
11162 if(!strcmp(namePart, name))
11170 return (((void *)0));
11173 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11176 char nameSpace[1024];
11178 unsigned int gotColon = 0x0;
11180 nameSpace[0] = '\0';
11181 for(c = strlen(name) - 1; c >= 0; c--)
11187 namePart = name + c + 1;
11188 while(c >= 0 && name[c] == ':')
11192 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11196 memcpy(nameSpace, name, c + 1);
11197 nameSpace[c + 1] = (char)0;
11198 return ScanWithNameSpace(tree, nameSpace, namePart);
11202 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11208 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11212 return ScanWithNameSpace(tree, "", namePart);
11214 return (((void *)0));
11217 static void ProcessDeclaration(struct Declaration * decl);
11219 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11221 struct Context * ctx;
11222 struct Symbol * symbol = (((void *)0));
11224 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11226 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11228 symbol = (((void *)0));
11231 char curName[1024];
11233 strcpy(curName, thisNameSpace);
11234 strcat(curName, "::");
11235 strcat(curName, name);
11236 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11239 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11242 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11243 if(symbol || ctx == endContext)
11246 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11248 if(symbol->pointerExternal->type == 0)
11250 struct FunctionDefinition * function = symbol->pointerExternal->function;
11251 struct Context * tmpContext = curContext;
11253 curContext = (((void *)0));
11254 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11255 curContext = tmpContext;
11256 symbol->pointerExternal->symbol = symbol;
11257 DeclareType(symbol->type, 0x1, 0x1);
11258 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11259 symbol->id = curExternal->symbol->idCode;
11261 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11264 symbol->id = curExternal->symbol->idCode;
11270 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11272 if(!type->isSigned && type->kind != 22)
11273 ListAdd(specs, MkSpecifier(UNSIGNED));
11278 if(type->_class->registered)
11280 if(!type->_class->registered->dataType)
11281 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11282 GetTypeSpecs(type->_class->registered->dataType, specs);
11287 ListAdd(specs, MkSpecifier(DOUBLE));
11290 ListAdd(specs, MkSpecifier(FLOAT));
11293 ListAdd(specs, MkSpecifier(CHAR));
11296 ListAdd(specs, MkSpecifier(SHORT));
11299 ListAdd(specs, MkSpecifier(INT64));
11302 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11306 ListAdd(specs, MkSpecifier(INT));
11311 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11313 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11320 if(type->_class && type->_class->string)
11322 if(type->classObjectType == 2)
11323 strcat(string, "typed_object");
11325 strcat(string, type->_class->string);
11328 if(type->_class->registered)
11329 strcat(string, type->_class->registered->name);
11331 strcat(string, type->_class->string);
11338 _PrintType(type->type, string, 0x0, printFunction, fullName);
11339 strcat(string, " *");
11344 strcat(string, "void");
11347 strcat(string, type->isSigned ? "int" : "uint");
11350 strcat(string, type->isSigned ? "int64" : "uint64");
11353 strcat(string, type->isSigned ? "intptr" : "uintptr");
11356 strcat(string, type->isSigned ? "char" : "byte");
11359 strcat(string, type->isSigned ? "short" : "uint16");
11362 strcat(string, "float");
11365 strcat(string, "double");
11370 strcat(string, "struct ");
11371 strcat(string, type->enumName);
11373 else if(type->typeName)
11375 strcat(string, type->typeName);
11379 struct Type * member;
11381 strcat(string, "struct {");
11382 for(member = type->members.first; member; member = member->next)
11384 PrintType(member, string, 0x1, fullName);
11385 strcat(string, "; ");
11387 strcat(string, "}");
11393 strcat(string, "union ");
11394 strcat(string, type->enumName);
11396 else if(type->typeName)
11398 strcat(string, type->typeName);
11402 strcat(string, "union ");
11403 strcat(string, "(unnamed)");
11409 strcat(string, "enum ");
11410 strcat(string, type->enumName);
11412 else if(type->typeName)
11414 strcat(string, type->typeName);
11417 strcat(string, "enum");
11423 if(type->dllExport)
11424 strcat(string, "dllexport ");
11425 PrintType(type->returnType, string, 0x0, fullName);
11426 strcat(string, " ");
11433 strcat(string, type->name);
11436 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11442 strcat(string, name);
11448 struct Type * param;
11450 strcat(string, "(");
11451 for(param = type->params.first; param; param = param->next)
11453 PrintType(param, string, 0x1, fullName);
11455 strcat(string, ", ");
11457 strcat(string, ")");
11464 char baseType[1024], size[256];
11465 struct Type * arrayType = type;
11467 baseType[0] = '\0';
11469 while(arrayType->kind == 12)
11472 if(arrayType->enumClass)
11473 strcat(size, arrayType->enumClass->string);
11474 else if(arrayType->arraySizeExp)
11475 PrintExpression(arrayType->arraySizeExp, size);
11477 arrayType = arrayType->arrayType;
11479 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11480 strcat(string, baseType);
11481 strcat(string, size);
11487 strcat(string, "...");
11490 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11493 strcat(string, "subclass(");
11494 strcat(string, type->_class ? type->_class->string : "int");
11495 strcat(string, ")");
11498 strcat(string, type->templateParameter->identifier->string);
11501 strcat(string, "thisclass");
11504 strcat(string, "__builtin_va_list");
11507 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11509 strcat(string, " ");
11510 strcat(string, type->name);
11515 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11517 struct Type * funcType;
11519 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11521 if(funcType && funcType->kind == 11 && type != funcType)
11523 char typeString[1024];
11524 struct Type * param;
11526 PrintType(funcType->returnType, string, 0x0, fullName);
11527 strcat(string, "(");
11528 _PrintType(type, string, printName, 0x0, fullName);
11529 strcat(string, ")");
11530 strcat(string, "(");
11531 for(param = funcType->params.first; param; param = param->next)
11533 PrintType(param, string, 0x1, fullName);
11535 strcat(string, ", ");
11537 strcat(string, ")");
11540 _PrintType(type, string, printName, 0x1, fullName);
11541 if(type->bitFieldCount)
11545 sprintf(count, ":%d", type->bitFieldCount);
11546 strcat(string, count);
11550 static struct Type * FindMember(struct Type * type, char * string)
11552 struct Type * memberType;
11554 for(memberType = type->members.first; memberType; memberType = memberType->next)
11556 if(!memberType->name)
11558 struct Type * subType = FindMember(memberType, string);
11563 else if(!strcmp(memberType->name, string))
11566 return (((void *)0));
11569 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11571 struct Type * memberType;
11573 for(memberType = type->members.first; memberType; memberType = memberType->next)
11575 if(!memberType->name)
11577 struct Type * subType = FindMember(memberType, string);
11581 *offset += memberType->offset;
11585 else if(!strcmp(memberType->name, string))
11587 *offset += memberType->offset;
11591 return (((void *)0));
11594 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11596 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11598 struct Expression * ParseExpressionString(char * expression)
11600 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11601 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11602 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11604 parsedExpression = (((void *)0));
11606 expression_yyparse();
11607 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11608 return parsedExpression;
11611 extern char * QMkString(char * source);
11613 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11615 void * __ecereTemp1;
11616 struct Identifier * id = exp->identifier;
11617 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11618 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11619 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11620 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11622 if(_class && _class->type == 4)
11624 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11625 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11629 struct __ecereNameSpace__ecere__com__Class * baseClass;
11631 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11633 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11635 for(value = e->values.first; value; value = value->next)
11637 if(!strcmp(value->name, id->string))
11642 char constant[256];
11644 FreeExpContents(exp);
11646 exp->isConstant = 0x1;
11647 if(!strcmp(baseClass->dataTypeString, "int"))
11648 sprintf(constant, "%d", value->data);
11650 sprintf(constant, "0x%X", value->data);
11651 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11652 exp->expType = MkClassType(baseClass->fullName);
11660 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11662 ProcessMethodType(method);
11663 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
11666 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11668 if(!prop->dataType)
11669 ProcessPropertyType(prop);
11670 exp->expType = prop->dataType;
11672 prop->dataType->refCount++;
11675 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11677 if(!member->dataType)
11678 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11679 exp->expType = member->dataType;
11680 if(member->dataType)
11681 member->dataType->refCount++;
11684 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11686 if(!classProp->dataType)
11687 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11688 if(classProp->constant)
11690 FreeExpContents(exp);
11691 exp->isConstant = 0x1;
11692 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11695 exp->constant = QMkString((char *)classProp->Get(_class));
11699 char constant[256];
11702 sprintf(constant, "%d", classProp->Get(_class));
11703 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11709 exp->expType = classProp->dataType;
11710 if(classProp->dataType)
11711 classProp->dataType->refCount++;
11717 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11719 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11720 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11721 struct __ecereNameSpace__ecere__com__NameSpace * child;
11725 for(child = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&nameSpace->nameSpaces); child; child = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)child)))
11727 data = ScanGlobalData(child, name);
11735 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11737 extern char * strncpy(char * , const char * , int n);
11739 static struct GlobalData * FindGlobalData(char * name)
11742 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11744 nameSpace = globalData;
11745 for(c = 0; name[c]; c++)
11747 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11749 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11750 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11752 strncpy(spaceName, name + start, c - start);
11753 spaceName[c - start] = '\0';
11754 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11755 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11757 return (((void *)0));
11758 nameSpace = newSpace;
11766 return ScanGlobalData(nameSpace, name + start);
11768 return (((void *)0));
11771 static int definedExpStackPos;
11773 static void * definedExpStack[512];
11775 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11777 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11779 FreeExpContents(checkedExp);
11780 FreeType(checkedExp->expType);
11781 FreeType(checkedExp->destType);
11782 *checkedExp = *newExp;
11783 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11784 checkedExp->prev = prev;
11785 checkedExp->next = next;
11788 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11790 extern int printf(char * , ...);
11792 void __ecereMethod_Expression_Clear();
11794 void ApplyAnyObjectLogic(struct Expression * e)
11796 struct Type * destType = e->destType;
11798 if(destType && (destType->classObjectType == 3))
11800 if(e && e->expType)
11802 struct Type * type = e->expType;
11803 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11805 if(type->kind == 8 && type->_class && type->_class->registered)
11807 _class = type->_class->registered;
11809 else if(type->kind == 19)
11811 _class = FindClass("ecere::com::Class")->registered;
11815 char string[1024] = "";
11816 struct Symbol * classSym;
11818 PrintType(type, string, 0x0, 0x1);
11819 classSym = FindClass(string);
11821 _class = classSym->registered;
11823 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
11825 if(!_class || strcmp(_class->fullName, "char *"))
11827 struct Expression * checkedExp = e, * newExp;
11829 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11831 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11833 if(checkedExp->type == 25)
11835 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11838 checkedExp = (*checkedExp->list).last;
11840 else if(checkedExp->type == 11)
11841 checkedExp = checkedExp->cast.exp;
11843 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11845 newExp = checkedExp->op.exp2;
11846 checkedExp->op.exp2 = (((void *)0));
11847 FreeExpContents(checkedExp);
11848 if(e->expType && e->expType->passAsTemplate)
11852 ComputeTypeSize(e->expType);
11853 sprintf(size, "%d", e->expType->size);
11854 newExp = MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp), '+', MkExpCall(MkExpIdentifier(MkIdentifier("__ENDIAN_PAD")), MkListOne(MkExpConstant(size))))));
11856 ReplaceExpContents(checkedExp, newExp);
11857 e->byReference = 0x1;
11859 else if(!e->byReference || (_class && _class->type == 5))
11861 struct Expression * checkedExp, * newExp;
11864 unsigned int hasAddress = e->type == 0 || (e->type == 8 && e->member.memberType == 3) || (e->type == 9 && e->member.memberType == 3) || (e->type == 4 && !e->op.exp1 && e->op.op == '*') || e->type == 6;
11866 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11868 struct Context * context = PushContext();
11869 struct Declarator * decl;
11870 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11871 char typeString[1024];
11872 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11874 typeString[0] = '\0';
11876 newExp->prev = (((void *)0));
11877 newExp->next = (((void *)0));
11878 newExp->expType = (((void *)0));
11879 PrintType(e->expType, typeString, 0x0, 0x1);
11880 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11881 newExp->destType = ProcessType(specs, decl);
11882 curContext = context;
11887 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
11889 sprintf(name, "__internalValue%03X", internalValueCounter++);
11890 if(!curCompound->compound.declarations)
11891 curCompound->compound.declarations = MkList();
11892 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
11893 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
11894 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
11895 e->compound = MkCompoundStmt((((void *)0)), stmts);
11898 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
11900 struct Type * type = e->destType;
11902 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11903 CopyTypeInto(e->destType, type);
11904 e->destType->refCount = 1;
11905 e->destType->classObjectType = 0;
11908 e->compound->compound.context = context;
11909 PopContext(context);
11910 curContext = context->parent;
11914 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11916 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11918 if(checkedExp->type == 25)
11920 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11923 checkedExp = (*checkedExp->list).last;
11925 else if(checkedExp->type == 11)
11926 checkedExp = checkedExp->cast.exp;
11929 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11931 *operand = *checkedExp;
11932 checkedExp->destType = (((void *)0));
11933 checkedExp->expType = (((void *)0));
11934 __ecereMethod_Expression_Clear(checkedExp);
11935 checkedExp->type = 4;
11936 checkedExp->op.op = '&';
11937 checkedExp->op.exp1 = (((void *)0));
11938 checkedExp->op.exp2 = operand;
11947 if((!destType || destType->kind == 14 || destType->kind == 0) && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && (e->expType->byReference || (e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))))
11949 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
11955 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11958 thisExp->prev = (((void *)0));
11959 thisExp->next = (((void *)0));
11960 __ecereMethod_Expression_Clear(e);
11962 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
11963 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
11964 ((struct Expression *)(*e->list).first)->byReference = 0x1;
11966 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11967 CopyTypeInto(e->expType, thisExp->expType);
11968 e->expType->byReference = 0x0;
11969 e->expType->refCount = 1;
11970 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && (e->expType->_class->registered->type == 2 || e->expType->_class->registered->type == 4 || e->expType->_class->registered->type == 3))
11972 e->expType->classObjectType = 0;
11977 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
11979 if(destType->kind == 14)
11981 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
11983 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
11985 unsigned int byReference = e->expType->byReference;
11986 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11987 struct Declarator * decl;
11988 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11989 char typeString[1024];
11990 struct Type * type;
11991 int backupClassObjectType;
11993 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
11997 backupClassObjectType = type->classObjectType;
11998 type->classObjectType = 0;
11999 typeString[0] = '\0';
12000 PrintType(type, typeString, 0x0, 0x1);
12001 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12002 type->classObjectType = backupClassObjectType;
12004 thisExp->prev = (((void *)0));
12005 thisExp->next = (((void *)0));
12006 __ecereMethod_Expression_Clear(e);
12007 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (type->_class->registered->type == 1000 || type->_class->registered->type == 2 || type->_class->registered->type == 4 || type->_class->registered->type == 3)) || (type->kind != 13 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
12011 e->op.exp1 = (((void *)0));
12012 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12017 e->cast.typeName = MkTypeName(specs, decl);
12018 e->cast.exp = thisExp;
12019 e->byReference = 0x1;
12022 e->destType = destType;
12024 destType->refCount++;
12029 extern char * strstr(char * , const char * );
12031 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12033 struct __ecereNameSpace__ecere__com__DefinedExpression
12035 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12036 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12039 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12040 } __attribute__ ((gcc_struct));
12042 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12044 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12046 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12048 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12050 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12052 extern struct Expression * CopyExpression(struct Expression * exp);
12054 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12056 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12058 static void ProcessStatement(struct Statement * stmt);
12060 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12062 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12064 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12066 extern char * sourceFile;
12068 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12070 void ProcessExpressionType(struct Expression * exp)
12072 void * __ecereTemp2;
12073 void * __ecereTemp1;
12074 unsigned int unresolved = 0x0;
12075 struct Location oldyylloc = yylloc;
12076 unsigned int notByReference = 0x0;
12078 if(!exp || exp->expType)
12085 struct Identifier * id = exp->identifier;
12089 if(id->_class && id->_class->name)
12091 id->classSym = id->_class->symbol;
12093 if(strstr(id->string, "__ecereClass") == id->string)
12095 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12098 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12100 ReplaceClassMembers(exp, thisClass);
12103 ProcessExpressionType(exp);
12106 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12111 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12115 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12121 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12124 ProcessExpressionType(exp);
12128 else if(currentClass && !id->_class)
12130 if(ResolveIdWithClass(exp, currentClass, 0x1))
12133 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12138 struct Type * type = symbol->type;
12139 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12141 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12143 struct Context * context = SetupTemplatesContext(_class);
12145 type = ReplaceThisClassType(_class);
12146 FinishTemplatesContext(context);
12148 type->refCount = 0;
12150 FreeSpecifier(id->_class);
12151 id->_class = (((void *)0));
12152 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12153 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12154 id->classSym = (((void *)0));
12155 exp->expType = type;
12158 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12159 exp->isConstant = 0x1;
12160 if(symbol->isParam || !strcmp(id->string, "this"))
12162 if(_class && _class->type == 1)
12163 exp->byReference = 0x1;
12165 if(symbol->isIterator)
12167 if(symbol->isIterator == 3)
12170 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12171 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12172 exp->expType = (((void *)0));
12173 ProcessExpressionType(exp);
12175 else if(symbol->isIterator != 4)
12178 exp->member.exp = MkExpIdentifier(exp->identifier);
12179 exp->member.exp->expType = exp->expType;
12180 exp->member.member = MkIdentifier("data");
12181 exp->expType = (((void *)0));
12182 ProcessExpressionType(exp);
12189 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12191 if(thisNameSpace && !(id->_class && !id->_class->name))
12195 strcpy(name, thisNameSpace);
12196 strcat(name, "::");
12197 strcat(name, id->string);
12198 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12201 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12206 for(c = 0; c < definedExpStackPos; c++)
12207 if(definedExpStack[c] == definedExp)
12209 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12211 struct Location backupYylloc = yylloc;
12213 definedExpStack[definedExpStackPos++] = definedExp;
12214 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12215 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12216 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12218 parsedExpression = (((void *)0));
12220 expression_yyparse();
12221 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12222 yylloc = backupYylloc;
12223 if(parsedExpression)
12225 FreeIdentifier(id);
12227 exp->list = MkListOne(parsedExpression);
12228 parsedExpression->loc = yylloc;
12229 ProcessExpressionType(exp);
12230 definedExpStackPos--;
12233 definedExpStackPos--;
12239 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12245 struct GlobalData * data = (((void *)0));
12247 if(thisNameSpace && !(id->_class && !id->_class->name))
12251 strcpy(name, thisNameSpace);
12252 strcat(name, "::");
12253 strcat(name, id->string);
12254 data = FindGlobalData(name);
12257 data = FindGlobalData(id->string);
12260 DeclareGlobalData(data);
12261 exp->expType = data->dataType;
12263 data->dataType->refCount++;
12264 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12265 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12266 FreeSpecifier(id->_class);
12267 id->_class = (((void *)0));
12272 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12274 if(thisNameSpace && !(id->_class && !id->_class->name))
12278 strcpy(name, thisNameSpace);
12279 strcat(name, "::");
12280 strcat(name, id->string);
12281 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12284 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12289 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12290 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12292 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12293 strcpy(name, "__ecereFunction_");
12294 FullClassNameCat(name, id->string, 0x0);
12295 if(DeclareFunction(function, name))
12297 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12298 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12300 exp->expType = function->dataType;
12301 if(function->dataType)
12302 function->dataType->refCount++;
12303 FreeSpecifier(id->_class);
12304 id->_class = (((void *)0));
12316 struct __ecereNameSpace__ecere__com__Class * _class;
12318 if(!exp->instance->_class)
12320 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12322 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12325 ProcessInstantiationType(exp->instance);
12326 exp->isConstant = exp->instance->isConstant;
12327 if(exp->instance->_class)
12329 exp->expType = MkClassType(exp->instance->_class->name);
12337 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12339 exp->expType = type;
12340 if(exp->constant[0] == '\'')
12342 if((int)((unsigned char *)exp->constant)[1] > 127)
12345 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12348 ch = exp->constant[1];
12349 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12350 exp->constant = PrintUInt(ch);
12352 type->_class = FindClass("unichar");
12353 type->isSigned = 0x0;
12358 type->isSigned = 0x1;
12361 else if(strchr(exp->constant, '.'))
12363 char ch = exp->constant[strlen(exp->constant) - 1];
12369 type->isSigned = 0x1;
12373 if(exp->constant[0] == '0' && exp->constant[1])
12374 type->isSigned = 0x0;
12375 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12376 type->isSigned = 0x0;
12377 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12378 type->isSigned = 0x0;
12380 type->isSigned = 0x1;
12383 exp->isConstant = 0x1;
12389 exp->isConstant = 0x1;
12390 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
12395 ProcessExpressionType(exp->_new.size);
12396 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12397 DeclareType(exp->expType->type, 0x0, 0x0);
12401 ProcessExpressionType(exp->_renew.size);
12402 ProcessExpressionType(exp->_renew.exp);
12403 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
12404 DeclareType(exp->expType->type, 0x0, 0x0);
12408 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12409 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12410 unsigned int useDestType = 0x0, useSideType = 0x0;
12411 struct Location oldyylloc = yylloc;
12412 unsigned int useSideUnit = 0x0;
12413 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12455 if(exp->op.op != '*' || exp->op.exp1)
12462 if(exp->op.op == '&')
12464 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12466 struct Identifier * id = exp->op.exp2->identifier;
12467 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12469 if(symbol && symbol->isIterator == 2)
12472 exp->member.exp = exp->op.exp2;
12473 exp->member.member = MkIdentifier("key");
12474 exp->expType = (((void *)0));
12475 exp->op.exp2->expType = symbol->type;
12476 symbol->type->refCount++;
12477 ProcessExpressionType(exp);
12485 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && useDestType && ((exp->destType->_class->registered->type == 3 && useSideUnit) || exp->destType->_class->registered->type == 4 || exp->destType->_class->registered->type == 2))
12487 if(exp->op.exp1->destType)
12488 FreeType(exp->op.exp1->destType);
12489 exp->op.exp1->destType = exp->destType;
12491 exp->destType->refCount++;
12495 if(exp->op.exp1->destType)
12496 FreeType(exp->op.exp1->destType);
12497 exp->op.exp1->destType = dummy;
12500 if(exp->op.exp1->destType && exp->op.op != '=')
12501 exp->op.exp1->destType->count++;
12502 ProcessExpressionType(exp->op.exp1);
12503 if(exp->op.exp1->destType && exp->op.op != '=')
12504 exp->op.exp1->destType->count--;
12505 if(exp->op.exp1->destType == dummy)
12508 exp->op.exp1->destType = (((void *)0));
12510 type1 = exp->op.exp1->expType;
12514 char expString[10240];
12516 expString[0] = '\0';
12517 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12521 exp->op.exp2->destType = exp->op.exp1->expType;
12522 if(exp->op.exp1->expType)
12523 exp->op.exp1->expType->refCount++;
12527 exp->op.exp2->destType = exp->destType;
12529 exp->destType->refCount++;
12533 exp->expType = type1;
12538 PrintExpression(exp->op.exp2, expString);
12539 if(type1 && type1->kind == 13)
12541 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN || exp->op.op == AND_ASSIGN || exp->op.op == OR_ASSIGN)
12542 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12543 else if(exp->op.op == '=')
12545 if(exp->op.exp2->destType)
12546 FreeType(exp->op.exp2->destType);
12547 exp->op.exp2->destType = type1;
12554 if(exp->op.op == MUL_ASSIGN || exp->op.op == DIV_ASSIGN || exp->op.op == MOD_ASSIGN || exp->op.op == LEFT_ASSIGN || exp->op.op == RIGHT_ASSIGN)
12558 if(exp->op.exp2->destType)
12559 FreeType(exp->op.exp2->destType);
12560 exp->op.exp2->destType = type1;
12567 exp->expType = type1;
12569 else if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && ((exp->destType->_class->registered->type == 3 && useDestType && useSideUnit) || (exp->destType->_class->registered->type == 4 && useDestType)))
12571 if(exp->op.exp2->destType)
12572 FreeType(exp->op.exp2->destType);
12573 exp->op.exp2->destType = exp->destType;
12575 exp->destType->refCount++;
12579 if(exp->op.exp2->destType)
12580 FreeType(exp->op.exp2->destType);
12581 exp->op.exp2->destType = dummy;
12584 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12586 FreeType(exp->op.exp2->destType);
12587 exp->op.exp2->destType = type1;
12590 if(exp->op.exp2->destType && exp->op.op != '=')
12591 exp->op.exp2->destType->count++;
12592 ProcessExpressionType(exp->op.exp2);
12593 if(exp->op.exp2->destType && exp->op.op != '=')
12594 exp->op.exp2->destType->count--;
12595 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12597 if(exp->op.exp2->expType->kind == 22 || exp->op.exp2->expType->kind == 4 || exp->op.exp2->expType->kind == 3 || exp->op.exp2->expType->kind == 2 || exp->op.exp2->expType->kind == 1)
12599 if(exp->op.op != '=' && type1->type->kind == 0)
12600 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12602 else if(exp->op.exp2->expType->kind == 13 || exp->op.exp2->expType->kind == 12 || exp->op.exp2->expType->kind == 11 || exp->op.exp2->expType->kind == 16 || (type1->type->kind == 0 && exp->op.exp2->expType->kind == 8 && exp->op.exp2->expType->_class->registered && (exp->op.exp2->expType->_class->registered->type == 0 || exp->op.exp2->expType->_class->registered->type == 1 || exp->op.exp2->expType->_class->registered->type == 5)))
12604 if(exp->op.op == ADD_ASSIGN)
12605 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12607 else if((exp->op.exp2->expType->kind == 8 && type1->kind == 13 && type1->type->kind == 8 && type1->type->_class == exp->op.exp2->expType->_class && exp->op.exp2->expType->_class->registered && exp->op.exp2->expType->_class->registered->type == 1))
12609 if(exp->op.op == ADD_ASSIGN)
12610 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12612 else if(inCompiler)
12614 char type1String[1024];
12615 char type2String[1024];
12617 type1String[0] = '\0';
12618 type2String[0] = '\0';
12619 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12620 PrintType(type1, type2String, 0x0, 0x1);
12621 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12622 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12625 if(exp->op.exp2->destType == dummy)
12628 exp->op.exp2->destType = (((void *)0));
12630 type2 = exp->op.exp2->expType;
12633 if(exp->op.op == SIZEOF)
12635 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12636 exp->isConstant = 0x1;
12638 else if(exp->op.op == '*' && !exp->op.exp1)
12640 exp->expType = Dereference(type2);
12641 if(type2 && type2->kind == 8)
12642 notByReference = 0x1;
12644 else if(exp->op.op == '&' && !exp->op.exp1)
12645 exp->expType = Reference(type2);
12652 if(exp->op.exp1->destType)
12653 FreeType(exp->op.exp1->destType);
12654 exp->op.exp1->destType = MkClassType("bool");
12655 exp->op.exp1->destType->truth = 0x1;
12656 if(!exp->op.exp1->expType)
12657 ProcessExpressionType(exp->op.exp1);
12659 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12660 FreeType(exp->op.exp1->expType);
12661 exp->op.exp1->expType = MkClassType("bool");
12662 exp->op.exp1->expType->truth = 0x1;
12666 if(exp->op.exp2->destType)
12667 FreeType(exp->op.exp2->destType);
12668 exp->op.exp2->destType = MkClassType("bool");
12669 exp->op.exp2->destType->truth = 0x1;
12670 if(!exp->op.exp2->expType)
12671 ProcessExpressionType(exp->op.exp2);
12673 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12674 FreeType(exp->op.exp2->expType);
12675 exp->op.exp2->expType = MkClassType("bool");
12676 exp->op.exp2->expType->truth = 0x1;
12679 else if(exp->op.exp1 && exp->op.exp2 && ((useSideType) || ((!type1 || type1->kind != 8 || !strcmp(type1->_class->string, "String")) && (!type2 || type2->kind != 8 || !strcmp(type2->_class->string, "String")))))
12681 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12683 if(exp->op.exp2->destType)
12684 FreeType(exp->op.exp2->destType);
12685 exp->op.exp2->destType = type1;
12687 if(exp->op.exp1->destType)
12688 FreeType(exp->op.exp1->destType);
12689 exp->op.exp1->destType = type2;
12691 if(!boolResult && type1->kind == 8 && (!exp->destType || exp->destType->kind != 8) && type1->_class->registered && type1->_class->registered->type == 3 && type2->_class->registered && type2->_class->registered->type == 3 && type1->_class->registered != type2->_class->registered)
12692 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
12693 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12695 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12699 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12701 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12702 ProcessExpressionType(exp->op.exp1);
12703 if(type2->kind != 13)
12705 ProcessExpressionType(classExp);
12706 exp->op.exp2 = MkExpBrackets(MkListOne(MkExpOp(exp->op.exp2, '*', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("5")), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpConstant("0"))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize"))))))));
12707 if(!exp->op.exp2->expType)
12708 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12709 ProcessExpressionType(exp->op.exp2);
12713 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
12715 if(type1->kind != 8 && type1->type->kind == 0)
12716 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12717 exp->expType = type1;
12721 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
12723 if(type2->kind != 8 && type2->type->kind == 0)
12724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12725 exp->expType = type2;
12729 else if((type1->kind == 13 && type2->kind != 13 && type2->kind != 12 && type2->kind != 11 && type2->kind != 16 && type2->kind != 8 && type2->kind != 19) || (type2->kind == 13 && type1->kind != 13 && type1->kind != 12 && type1->kind != 11 && type1->kind != 16 && type1->kind != 8 && type1->kind != 19))
12731 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12735 unsigned int success = 0x0;
12737 if(type1->kind == 13 && type2->kind == 13)
12739 if(exp->op.op == '+')
12740 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12741 else if(exp->op.op == '-')
12743 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12745 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12747 if(type1->type->kind == 20)
12749 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12753 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12755 ProcessExpressionType(classExp);
12757 exp->list = MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp1))), exp->op.op, MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(exp->op.exp2)))))), '/', MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("noHeadClass"))), OR_OP, MkExpOp(MkExpMember(CopyExpression(classExp), MkIdentifier("type")), EQ_OP, MkExpIdentifier(MkIdentifier("normalClass")))))), MkListOne(MkExpTypeSize(MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))))), MkExpMember(classExp, MkIdentifier("typeSize")))))));
12758 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12766 if(!success && exp->op.exp1->type == 2)
12768 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12771 FreeType(exp->expType);
12772 exp->expType = exp->op.exp1->destType;
12773 if(exp->op.exp1->destType)
12774 exp->op.exp1->destType->refCount++;
12777 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12780 FreeType(exp->expType);
12781 exp->expType = exp->op.exp2->destType;
12782 if(exp->op.exp2->destType)
12783 exp->op.exp2->destType->refCount++;
12789 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12792 FreeType(exp->expType);
12793 exp->expType = exp->op.exp2->destType;
12794 if(exp->op.exp2->destType)
12795 exp->op.exp2->destType->refCount++;
12798 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12801 FreeType(exp->expType);
12802 exp->expType = exp->op.exp1->destType;
12803 if(exp->op.exp1->destType)
12804 exp->op.exp1->destType->refCount++;
12810 char expString1[10240];
12811 char expString2[10240];
12815 expString1[0] = '\0';
12816 expString2[0] = '\0';
12821 PrintExpression(exp->op.exp1, expString1);
12822 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12823 PrintExpression(exp->op.exp2, expString2);
12824 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12825 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12826 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12828 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12832 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12834 if(exp->op.exp1->destType)
12835 FreeType(exp->op.exp1->destType);
12836 exp->op.exp1->destType = type2->_class->registered->dataType;
12837 if(type2->_class->registered->dataType)
12838 type2->_class->registered->dataType->refCount++;
12839 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12840 exp->expType = type2;
12844 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12846 if(exp->op.exp2->destType)
12847 FreeType(exp->op.exp2->destType);
12848 exp->op.exp2->destType = type1->_class->registered->dataType;
12849 if(type1->_class->registered->dataType)
12850 type1->_class->registered->dataType->refCount++;
12851 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12852 exp->expType = type1;
12858 unsigned int valid = 0x0;
12860 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12862 if(exp->op.exp2->destType)
12863 FreeType(exp->op.exp2->destType);
12864 if(!type1->_class->registered->dataType)
12865 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12866 exp->op.exp2->destType = type1->_class->registered->dataType;
12867 exp->op.exp2->destType->refCount++;
12868 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12869 type2 = exp->op.exp2->destType;
12870 exp->expType = type2;
12873 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
12875 if(exp->op.exp1->destType)
12876 FreeType(exp->op.exp1->destType);
12877 if(!type2->_class->registered->dataType)
12878 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
12879 exp->op.exp1->destType = type2->_class->registered->dataType;
12880 exp->op.exp1->destType->refCount++;
12881 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12882 type1 = exp->op.exp1->destType;
12883 exp->expType = type1;
12886 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
12888 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
12890 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
12893 FreeType(exp->expType);
12894 exp->expType = exp->op.exp1->expType;
12895 if(exp->op.exp2->expType)
12896 exp->op.exp1->expType->refCount++;
12900 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
12902 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
12905 FreeType(exp->expType);
12906 exp->expType = exp->op.exp2->expType;
12907 if(exp->op.exp2->expType)
12908 exp->op.exp2->expType->refCount++;
12915 if(exp->op.exp2->destType)
12916 FreeType(exp->op.exp2->destType);
12917 exp->op.exp2->destType = type1;
12919 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12922 FreeType(exp->expType);
12923 exp->expType = exp->op.exp2->destType;
12924 if(exp->op.exp2->destType)
12925 exp->op.exp2->destType->refCount++;
12927 else if(type1 && type2)
12929 char expString1[10240];
12930 char expString2[10240];
12931 char type1String[1024];
12932 char type2String[1024];
12934 expString1[0] = '\0';
12935 expString2[0] = '\0';
12936 type1String[0] = '\0';
12937 type2String[0] = '\0';
12940 PrintExpression(exp->op.exp1, expString1);
12941 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12942 PrintExpression(exp->op.exp2, expString2);
12943 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12944 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
12945 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
12947 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
12948 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
12950 exp->expType = exp->op.exp1->expType;
12951 if(exp->op.exp1->expType)
12952 exp->op.exp1->expType->refCount++;
12954 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12956 exp->expType = exp->op.exp2->expType;
12957 if(exp->op.exp2->expType)
12958 exp->op.exp2->expType->refCount++;
12965 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
12967 struct Type * oldType = exp->op.exp1->expType;
12969 exp->op.exp1->expType = (((void *)0));
12970 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12973 exp->op.exp1->expType = oldType;
12975 if(exp->op.exp1->destType)
12976 FreeType(exp->op.exp1->destType);
12977 exp->op.exp1->destType = type2;
12979 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12982 FreeType(exp->expType);
12983 exp->expType = exp->op.exp1->destType;
12984 if(exp->op.exp1->destType)
12985 exp->op.exp1->destType->refCount++;
12989 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
12991 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12993 if(exp->op.exp1->destType)
12994 FreeType(exp->op.exp1->destType);
12995 exp->op.exp1->destType = type2->_class->registered->dataType;
12996 if(type2->_class->registered->dataType)
12997 type2->_class->registered->dataType->refCount++;
12998 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13000 if(exp->op.op == '!')
13002 exp->expType = MkClassType("bool");
13003 exp->expType->truth = 0x1;
13007 exp->expType = type2;
13012 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13014 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13016 if(exp->op.exp2->destType)
13017 FreeType(exp->op.exp2->destType);
13018 exp->op.exp2->destType = type1->_class->registered->dataType;
13019 if(type1->_class->registered->dataType)
13020 type1->_class->registered->dataType->refCount++;
13021 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13023 exp->expType = type1;
13029 if(exp->op.exp1 && !exp->op.exp1->expType)
13031 char expString[10000];
13033 expString[0] = '\0';
13036 PrintExpression(exp->op.exp1, expString);
13037 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13040 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13042 if(exp->op.exp2 && !exp->op.exp2->expType)
13044 char expString[10240];
13046 expString[0] = '\0';
13049 PrintExpression(exp->op.exp2, expString);
13050 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13053 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13057 FreeType(exp->expType);
13058 exp->expType = MkClassType("bool");
13059 exp->expType->truth = 0x1;
13061 if(exp->op.op != SIZEOF)
13062 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13063 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13065 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13067 yylloc = oldyylloc;
13074 struct Expression * e;
13076 exp->isConstant = 0x1;
13077 for(e = (*exp->list).first; e; e = e->next)
13079 unsigned int inced = 0x0;
13083 FreeType(e->destType);
13084 e->destType = exp->destType;
13087 exp->destType->refCount++;
13088 e->destType->count++;
13092 ProcessExpressionType(e);
13094 exp->destType->count--;
13095 if(!exp->expType && !e->next)
13097 exp->expType = e->expType;
13099 e->expType->refCount++;
13102 exp->isConstant = 0x0;
13104 e = (*exp->list).first;
13105 if(!e->next && e->type == 8)
13107 struct Expression * next = exp->next, * prev = exp->prev;
13109 FreeType(exp->expType);
13110 FreeType(exp->destType);
13111 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13115 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13116 ProcessExpressionType(exp);
13122 struct Expression * e;
13124 exp->isConstant = 0x1;
13125 ProcessExpressionType(exp->index.exp);
13126 if(!exp->index.exp->isConstant)
13127 exp->isConstant = 0x0;
13128 if(exp->index.exp->expType)
13130 struct Type * source = exp->index.exp->expType;
13132 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
13134 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13136 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13137 if(exp->index.index && (*exp->index.index).last)
13139 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13143 for(e = (*exp->index.index).first; e; e = e->next)
13145 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13148 FreeType(e->destType);
13149 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13151 ProcessExpressionType(e);
13156 exp->isConstant = 0x0;
13159 exp->expType = Dereference(exp->index.exp->expType);
13161 DeclareType(exp->expType, 0x0, 0x0);
13166 struct Expression * e;
13167 struct Type * functionType;
13168 struct Type * methodType = (((void *)0));
13174 PrintExpression(exp->call.exp, name);
13175 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13177 PrintExpression(exp->call.exp, name);
13180 if(exp->call.exp->type == 0)
13182 struct Expression * idExp = exp->call.exp;
13183 struct Identifier * id = idExp->identifier;
13185 if(!strcmp(id->string, "__ENDIAN_PAD"))
13187 exp->expType = ProcessTypeString("int", 0x1);
13188 if(exp->call.arguments && (*exp->call.arguments).first)
13189 ProcessExpressionType((*exp->call.arguments).first);
13192 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13194 struct Expression * a = (((void *)0));
13195 struct Expression * b = (((void *)0));
13196 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13198 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13200 a = (*exp->call.arguments).first;
13201 b = (*exp->call.arguments).last;
13205 else if((*exp->call.arguments).count == 1)
13207 a = (*exp->call.arguments).first;
13212 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13213 idExp->identifier = (((void *)0));
13214 FreeExpContents(exp);
13215 ProcessExpressionType(a);
13217 ProcessExpressionType(b);
13219 exp->list = MkList();
13220 if(a->expType && (!b || b->expType))
13222 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13226 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13227 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13228 struct Declaration * decl;
13229 char temp1[1024], temp2[1024];
13231 GetTypeSpecs(a->expType, specs);
13232 if(a && !a->isConstant && a->type != 0)
13234 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13235 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13236 tempExp1 = QMkExpId(temp1);
13237 tempExp1->expType = a->expType;
13239 a->expType->refCount++;
13240 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13242 if(b && !b->isConstant && b->type != 0)
13244 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13245 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13246 tempExp2 = QMkExpId(temp2);
13247 tempExp2->expType = b->expType;
13249 b->expType->refCount++;
13250 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13252 decl = MkDeclaration(specs, decls);
13253 if(!curCompound->compound.declarations)
13254 curCompound->compound.declarations = MkList();
13255 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13259 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13261 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13263 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13264 exp->expType = a->expType;
13266 a->expType->refCount++;
13268 else if(!strcmp(id->string, "Abs"))
13270 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13271 exp->expType = a->expType;
13273 a->expType->refCount++;
13275 else if(!strcmp(id->string, "Sgn"))
13277 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '!', CopyExpression(tempExp1)))), MkListOne(MkExpConstant("0")), MkExpBrackets(MkListOne(MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpConstant("-1")), MkExpConstant("1"))))));
13278 exp->expType = ProcessTypeString("int", 0x0);
13280 FreeExpression(tempExp1);
13282 FreeExpression(tempExp2);
13283 FreeIdentifier(id);
13289 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13291 if(!exp->call.exp->destType)
13293 exp->call.exp->destType = dummy;
13296 ProcessExpressionType(exp->call.exp);
13297 if(exp->call.exp->destType == dummy)
13300 exp->call.exp->destType = (((void *)0));
13304 functionType = exp->call.exp->expType;
13305 if(functionType && functionType->kind == 16)
13307 methodType = functionType;
13308 functionType = methodType->method->dataType;
13309 if(exp->call.exp->expType->usedClass)
13311 char typeString[1024];
13313 typeString[0] = '\0';
13314 PrintType(functionType, typeString, 0x1, 0x1);
13315 if(strstr(typeString, "thisclass"))
13317 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13318 struct Declarator * decl;
13321 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13323 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13324 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13325 thisClassParams = 0x0;
13326 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13328 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13330 thisClass = exp->call.exp->expType->usedClass;
13331 ProcessDeclarator(decl);
13332 thisClass = backupThisClass;
13334 thisClassParams = 0x1;
13335 functionType = ProcessType(specs, decl);
13336 functionType->refCount = 0;
13337 FinishTemplatesContext(context);
13339 FreeList(specs, FreeSpecifier);
13340 FreeDeclarator(decl);
13344 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13346 struct Type * type = functionType->type;
13348 if(!functionType->refCount)
13350 functionType->type = (((void *)0));
13351 FreeType(functionType);
13353 functionType = type;
13355 if(functionType && functionType->kind != 11)
13357 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13359 else if(functionType)
13361 unsigned int emptyParams = 0x0, noParams = 0x0;
13362 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13363 struct Type * type = functionType->params.first;
13364 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13366 struct Location oldyylloc = yylloc;
13370 if(functionType->extraParam && e)
13372 e->destType = MkClassType(functionType->thisClass->string);
13375 if(!functionType->staticMethod)
13377 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13379 type = MkClassType(memberExp->member.exp->expType->_class->string);
13382 e->destType = type;
13384 type = functionType->params.first;
13387 type->refCount = 0;
13389 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13391 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13394 e->destType = type;
13396 type = functionType->params.first;
13399 type->refCount = 0;
13402 if(type && type->kind == 0)
13405 if(!type->refCount)
13407 type = (((void *)0));
13409 for(; e; e = e->next)
13411 if(!type && !emptyParams)
13414 if(methodType && methodType->methodClass)
13415 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13417 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
13420 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13422 struct Type * templatedType = (((void *)0));
13423 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13424 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13427 if(_class && _class->templateArgs)
13429 struct __ecereNameSpace__ecere__com__Class * sClass;
13431 for(sClass = _class; sClass; sClass = sClass->base)
13433 if(sClass->templateClass)
13434 sClass = sClass->templateClass;
13436 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13438 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13440 struct __ecereNameSpace__ecere__com__Class * nextClass;
13442 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13444 if(nextClass->templateClass)
13445 nextClass = nextClass->templateClass;
13446 id += nextClass->templateParams.count;
13456 if(curParam && _class->templateArgs[id].dataTypeString)
13458 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13461 struct Context * context = SetupTemplatesContext(_class);
13463 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13464 FinishTemplatesContext(context);
13466 e->destType = templatedType;
13469 templatedType->passAsTemplate = 0x1;
13474 e->destType = type;
13481 e->destType = type;
13485 if(type && type->kind != 14)
13487 struct Type * next = type->next;
13489 if(!type->refCount)
13494 if(type && type->kind != 14)
13496 if(methodType && methodType->methodClass)
13497 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13499 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
13501 yylloc = oldyylloc;
13502 if(type && !type->refCount)
13507 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13508 if(exp->call.exp->type == 0)
13510 char * string = exp->call.exp->identifier->string;
13514 struct Symbol * symbol;
13515 struct Location oldyylloc = yylloc;
13517 yylloc = exp->call.exp->identifier->loc;
13518 if(strstr(string, "__builtin_") == string)
13521 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13522 symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
13523 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13524 if(strstr(symbol->string, "::"))
13525 globalContext->hasNameSpace = 0x1;
13526 yylloc = oldyylloc;
13529 else if(exp->call.exp->type == 8)
13533 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13534 if(!functionType->returnType)
13536 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13539 if(functionType && functionType->kind == 11)
13541 exp->expType = functionType->returnType;
13542 if(functionType->returnType)
13543 functionType->returnType->refCount++;
13544 if(!functionType->refCount)
13545 FreeType(functionType);
13547 if(exp->call.arguments)
13549 for(e = (*exp->call.arguments).first; e; e = e->next)
13551 struct Type * destType = e->destType;
13553 ProcessExpressionType(e);
13560 struct Type * type;
13561 struct Location oldyylloc = yylloc;
13562 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13564 exp->thisPtr = thisPtr;
13565 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13567 exp->member.member->classSym = exp->member.member->_class->symbol;
13569 ProcessExpressionType(exp->member.exp);
13570 if(exp->member.exp->expType && exp->member.exp->expType->kind == 8 && exp->member.exp->expType->_class && exp->member.exp->expType->_class->registered && exp->member.exp->expType->_class->registered->type == 0)
13572 exp->isConstant = 0x0;
13575 exp->isConstant = exp->member.exp->isConstant;
13576 type = exp->member.exp->expType;
13578 if(type && (type->kind == 20))
13580 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13581 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13585 for(param = _class->templateParams.first; param; param = param->next)
13587 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13591 if(param && param->defaultArg.member)
13593 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13597 struct Expression * expMember = exp->member.exp;
13598 struct Declarator * decl;
13599 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13600 char thisClassTypeString[1024];
13602 FreeIdentifier(exp->member.member);
13603 ProcessExpressionType(argExp);
13605 char * colon = strstr(param->defaultArg.memberString, "::");
13609 char className[1024];
13610 struct __ecereNameSpace__ecere__com__Class * sClass;
13612 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13613 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13616 strcpy(thisClassTypeString, _class->fullName);
13618 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13619 exp->expType = ProcessType(specs, decl);
13620 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13622 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13623 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13625 int paramCount = 0;
13626 int lastParam = -1;
13627 char templateString[1024];
13628 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13630 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13631 for(cClass = expClass; cClass; cClass = cClass->base)
13635 for(param = cClass->templateParams.first; param; param = param->next)
13638 struct __ecereNameSpace__ecere__com__Class * sClass;
13639 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13641 for(sClass = cClass->base; sClass; sClass = sClass->base)
13642 id += sClass->templateParams.count;
13643 arg = expClass->templateArgs[id];
13644 for(sClass = _class; sClass; sClass = sClass->base)
13646 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13648 struct __ecereNameSpace__ecere__com__Class * nextClass;
13650 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13651 p += nextClass->templateParams.count;
13652 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13654 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13656 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13658 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13659 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13666 char argument[256];
13668 argument[0] = '\0';
13669 switch(param->type)
13673 char expString[1024];
13674 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13675 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13676 struct Expression * exp;
13677 char * string = PrintHexUInt64(arg.expression.ui64);
13679 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13680 ProcessExpressionType(exp);
13681 ComputeExpression(exp);
13682 expString[0] = '\0';
13683 PrintExpression(exp, expString);
13684 strcat(argument, expString);
13685 FreeExpression(exp);
13690 strcat(argument, arg.member->name);
13695 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13697 if(!strcmp(arg.dataTypeString, "thisclass"))
13698 strcat(argument, thisClassTypeString);
13700 strcat(argument, arg.dataTypeString);
13708 strcat(templateString, ", ");
13709 if(lastParam != p - 1)
13711 strcat(templateString, param->name);
13712 strcat(templateString, " = ");
13714 strcat(templateString, argument);
13723 int len = strlen(templateString);
13725 if(templateString[len - 1] == '>')
13726 templateString[len++] = ' ';
13727 templateString[len++] = '>';
13728 templateString[len++] = '\0';
13731 struct Context * context = SetupTemplatesContext(_class);
13733 FreeType(exp->expType);
13734 exp->expType = ProcessTypeString(templateString, 0x0);
13735 FinishTemplatesContext(context);
13739 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpBrackets(MkListOne(MkExpOp(MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), expMember))), '+', MkExpOp(MkExpMember(MkExpMember(argExp, MkIdentifier("member")), MkIdentifier("offset")), '+', MkExpMember(MkExpMember(MkExpMember(CopyExpression(argExp), MkIdentifier("member")), MkIdentifier("_class")), MkIdentifier("offset")))))))));
13742 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13744 type = ProcessTemplateParameterType(type->templateParameter);
13747 if(type && (type->kind == 20))
13749 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13751 struct Identifier * id = exp->member.member;
13752 int typeKind = type->kind;
13753 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
13755 if(typeKind == 19 && exp->member.exp->type == 26)
13757 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13760 if(id && (typeKind == 3 || typeKind == 15))
13761 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13764 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13765 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13766 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13767 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13768 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13770 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13771 exp->member.memberType = 1;
13772 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13773 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13776 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13778 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13779 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13781 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13783 member = (((void *)0));
13785 if(!member && !prop)
13786 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13787 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13788 exp->member.thisPtr = 0x1;
13794 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13795 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13796 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13798 if(!prop && !member)
13800 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13803 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13804 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13805 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13810 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13811 prop = (((void *)0));
13813 member = (((void *)0));
13817 if(!prop && !member)
13818 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13819 if(!prop && !member && !method)
13823 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13826 exp->member.memberType = 5;
13827 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13831 char structName[1024];
13832 struct Identifier * id = exp->member.member;
13833 struct Expression * classExp = exp->member.exp;
13836 FreeType(classExp->expType);
13837 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13838 strcpy(structName, "__ecereClassData_");
13839 FullClassNameCat(structName, type->_class->string, 0x0);
13841 exp->member.member = id;
13842 exp->member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(type->_class->string)), (((void *)0))), MkIdentifier("offsetClass"))))))));
13844 ProcessExpressionType(exp);
13850 struct Symbol * classSym = FindClass(id->string);
13854 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13857 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13863 exp->member.memberType = 1;
13864 if(!prop->dataType)
13865 ProcessPropertyType(prop);
13866 exp->expType = prop->dataType;
13868 prop->dataType->refCount++;
13872 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13874 FreeExpContents(exp);
13876 exp->identifier = MkIdentifier("class");
13877 ProcessExpressionType(exp);
13880 exp->member.memberType = 3;
13881 DeclareStruct(_class->fullName, 0x0);
13882 if(!member->dataType)
13884 struct Context * context = SetupTemplatesContext(_class);
13886 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13887 FinishTemplatesContext(context);
13889 exp->expType = member->dataType;
13890 if(member->dataType)
13891 member->dataType->refCount++;
13893 else if(revConvert)
13895 exp->member.memberType = 4;
13896 exp->expType = MkClassType(revConvert->_class->fullName);
13902 exp->member.memberType = 2;
13904 if(!method->dataType)
13905 ProcessMethodType(method);
13906 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
13907 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
13908 exp->expType->usedClass = _class;
13910 else if(!classProp)
13912 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
13914 FreeExpContents(exp);
13916 exp->identifier = MkIdentifier("class");
13917 ProcessExpressionType(exp);
13920 yylloc = exp->member.member->loc;
13921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
13923 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
13925 if(_class && exp->expType)
13927 struct __ecereNameSpace__ecere__com__Class * tClass;
13930 while(tClass && !tClass->templateClass)
13931 tClass = tClass->base;
13932 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
13935 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13936 struct __ecereNameSpace__ecere__com__Class * sClass;
13938 for(sClass = tClass; sClass; sClass = sClass->base)
13941 if(sClass->templateClass)
13942 sClass = sClass->templateClass;
13943 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13945 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
13947 for(sClass = sClass->base; sClass; sClass = sClass->base)
13948 id += sClass->templateParams.count;
13956 if(curParam && tClass->templateArgs[id].dataTypeString)
13958 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
13959 struct Context * context = SetupTemplatesContext(tClass);
13961 FreeType(exp->expType);
13962 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
13965 if(exp->expType->kind == 21)
13967 FreeType(exp->expType);
13968 exp->expType = ReplaceThisClassType(_class);
13970 if(tClass->templateClass)
13971 exp->expType->passAsTemplate = 0x1;
13974 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
13975 if(exp->destType->kind == 21)
13977 FreeType(exp->destType);
13978 exp->destType = ReplaceThisClassType(_class);
13982 FinishTemplatesContext(context);
13985 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
13988 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13989 struct __ecereNameSpace__ecere__com__Class * sClass;
13991 for(sClass = tClass; sClass; sClass = sClass->base)
13994 if(sClass->templateClass)
13995 sClass = sClass->templateClass;
13996 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13998 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14000 for(sClass = sClass->base; sClass; sClass = sClass->base)
14001 id += sClass->templateParams.count;
14011 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14012 struct Context * context = SetupTemplatesContext(tClass);
14013 struct Type * basicType;
14015 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14018 if(basicType->kind == 21)
14020 FreeType(basicType);
14021 basicType = ReplaceThisClassType(_class);
14023 FreeType(exp->expType);
14024 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
14027 exp->destType = exp->expType;
14028 exp->destType->refCount++;
14031 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14032 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14033 struct Declarator * decl;
14035 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14038 exp->destType->refCount++;
14040 exp->expType->refCount++;
14042 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14043 exp->cast.exp = newExp;
14046 FinishTemplatesContext(context);
14049 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14051 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14055 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14058 int paramCount = 0;
14059 int lastParam = -1;
14060 char templateString[1024];
14061 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14063 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14064 while(cClass != expClass)
14066 struct __ecereNameSpace__ecere__com__Class * sClass;
14068 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14071 for(param = cClass->templateParams.first; param; param = param->next)
14073 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14076 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14077 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14079 while(cClassCur != tClass && !paramCur)
14081 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14083 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14085 cClassCur = sClassCur;
14086 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14088 if(!strcmp(paramCur->name, param->name))
14095 if(paramCur && paramCur->type == 0)
14096 arg = tClass->templateArgs[cp];
14098 arg = expClass->templateArgs[p];
14100 char argument[256];
14102 argument[0] = '\0';
14103 switch(param->type)
14107 char expString[1024];
14108 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14109 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14110 struct Expression * exp;
14111 char * string = PrintHexUInt64(arg.expression.ui64);
14113 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14114 ProcessExpressionType(exp);
14115 ComputeExpression(exp);
14116 expString[0] = '\0';
14117 PrintExpression(exp, expString);
14118 strcat(argument, expString);
14119 FreeExpression(exp);
14124 strcat(argument, arg.member->name);
14129 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14130 strcat(argument, arg.dataTypeString);
14137 strcat(templateString, ", ");
14138 if(lastParam != p - 1)
14140 strcat(templateString, param->name);
14141 strcat(templateString, " = ");
14143 strcat(templateString, argument);
14152 int len = strlen(templateString);
14154 if(templateString[len - 1] == '>')
14155 templateString[len++] = ' ';
14156 templateString[len++] = '>';
14157 templateString[len++] = '\0';
14159 FreeType(exp->expType);
14161 struct Context * context = SetupTemplatesContext(tClass);
14163 exp->expType = ProcessTypeString(templateString, 0x0);
14164 FinishTemplatesContext(context);
14171 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->string : (type->_class ? type->_class->string : (((void *)0)))) : "(null)");
14173 else if(type && (type->kind == 9 || type->kind == 10))
14175 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14179 exp->expType = memberType;
14181 memberType->refCount++;
14186 char expString[10240];
14188 expString[0] = '\0';
14191 PrintExpression(exp, expString);
14192 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14194 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14196 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14198 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14200 struct Identifier * id = exp->member.member;
14201 struct __ecereNameSpace__ecere__com__Class * _class = (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->registered : (type->_class ? type->_class->registered : (((void *)0)))) : (((void *)0));
14205 FreeType(exp->expType);
14206 exp->expType = ReplaceThisClassType(_class);
14210 yylloc = oldyylloc;
14215 struct Type * destType = exp->destType;
14217 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14219 exp->member.member->classSym = exp->member.member->_class->symbol;
14221 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14225 ProcessExpressionType(exp);
14232 struct Symbol * classSym = exp->_class->symbol;
14234 if(classSym && classSym->registered)
14236 if(classSym->registered->type == 5)
14241 DeclareStruct(classSym->string, 0x0);
14242 FreeSpecifier(exp->_class);
14244 FullClassNameCat(name, classSym->string, 0x0);
14245 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14249 if(classSym->registered->fixed)
14251 FreeSpecifier(exp->_class);
14252 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14257 char className[1024];
14259 strcpy(className, "__ecereClass_");
14260 FullClassNameCat(className, classSym->string, 0x1);
14261 MangleClassName(className);
14262 DeclareClass(classSym, className);
14263 FreeExpContents(exp);
14265 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14266 exp->member.member = MkIdentifier("structSize");
14270 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14275 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14277 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14278 exp->isConstant = 0x1;
14279 DeclareType(type, 0x0, 0x0);
14285 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14287 type->count = (unsigned int)1;
14288 FreeType(exp->cast.exp->destType);
14289 exp->cast.exp->destType = type;
14291 ProcessExpressionType(exp->cast.exp);
14292 type->count = (unsigned int)0;
14293 exp->expType = type;
14294 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14296 void * prev = exp->prev, * next = exp->next;
14297 struct Type * expType = exp->cast.exp->destType;
14298 struct Expression * castExp = exp->cast.exp;
14299 struct Type * destType = exp->destType;
14302 expType->refCount++;
14303 FreeType(exp->expType);
14304 FreeTypeName(exp->cast.typeName);
14306 FreeType(exp->expType);
14307 FreeType(exp->destType);
14308 exp->expType = expType;
14309 exp->destType = destType;
14310 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14316 exp->isConstant = exp->cast.exp->isConstant;
14322 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14325 exp->expType = type;
14330 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14332 ProcessExpressionType(exp->vaArg.exp);
14334 exp->expType = type;
14339 struct Expression * e;
14341 exp->isConstant = 0x1;
14342 FreeType(exp->cond.cond->destType);
14343 exp->cond.cond->destType = MkClassType("bool");
14344 exp->cond.cond->destType->truth = 0x1;
14345 ProcessExpressionType(exp->cond.cond);
14346 if(!exp->cond.cond->isConstant)
14347 exp->isConstant = 0x0;
14348 for(e = (*exp->cond.exp).first; e; e = e->next)
14352 FreeType(e->destType);
14353 e->destType = exp->destType;
14355 e->destType->refCount++;
14357 ProcessExpressionType(e);
14360 exp->expType = e->expType;
14362 e->expType->refCount++;
14365 exp->isConstant = 0x0;
14367 FreeType(exp->cond.elseExp->destType);
14368 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14369 if(exp->cond.elseExp->destType)
14370 exp->cond.elseExp->destType->refCount++;
14371 ProcessExpressionType(exp->cond.elseExp);
14372 if(!exp->cond.elseExp->isConstant)
14373 exp->isConstant = 0x0;
14378 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14380 struct Statement * last = (*exp->compound->compound.statements).last;
14382 if(last->type == 3 && last->expressions && (*last->expressions).last)
14384 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14386 exp->destType->refCount++;
14388 ProcessStatement(exp->compound);
14389 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14390 if(((struct Expression *)(*last->expressions).last)->expType)
14391 exp->expType->refCount++;
14397 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14399 if(spec && spec->type == 1)
14401 exp->expType = MkClassType(spec->name);
14402 exp->expType->kind = 19;
14403 exp->byReference = 0x1;
14407 exp->expType = MkClassType("ecere::com::Class");
14408 exp->byReference = 0x1;
14414 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14418 struct Identifier * id = exp->classData.id;
14419 char structName[1024];
14420 struct Expression * classExp;
14422 strcpy(structName, "__ecereClassData_");
14423 FullClassNameCat(structName, _class->fullName, 0x0);
14425 exp->member.member = id;
14426 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14427 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14429 classExp = MkExpIdentifier(MkIdentifier("class"));
14430 exp->member.exp = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp(MkExpCast(MkTypeName(MkListOne(MkSpecifier(CHAR)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpMember(classExp, MkIdentifier("data"))), '+', MkExpMember(MkExpClass(MkListOne(MkSpecifierName(_class->fullName)), (((void *)0))), MkIdentifier("offsetClass"))))))));
14431 ProcessExpressionType(exp);
14438 struct Type * type = (((void *)0));
14439 char * typeString = (((void *)0));
14440 char typeStringBuf[1024];
14442 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class && exp->destType->_class->registered && exp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(exp->destType->_class->registered, containerClass))
14444 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14446 typeString = templateClass->templateArgs[2].dataTypeString;
14450 struct Expression * e;
14452 for(e = (*exp->list).first; e; e = e->next)
14454 ProcessExpressionType(e);
14464 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14468 e->expType = (((void *)0));
14469 e = (*exp->list).first;
14470 ProcessExpressionType(e);
14473 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14475 FreeType(e->expType);
14476 e->expType = (((void *)0));
14478 type = (((void *)0));
14486 FreeType(e->expType);
14487 e->expType = (((void *)0));
14493 typeStringBuf[0] = '\0';
14494 PrintType(type, typeStringBuf, 0x0, 0x1);
14495 typeString = typeStringBuf;
14497 type = (((void *)0));
14502 char templateString[1024];
14503 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14504 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14505 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14506 struct Expression * expExt;
14507 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14509 sprintf(templateString, "Container<%s>", typeString);
14512 struct Expression * e;
14514 type = ProcessTypeString(typeString, 0x0);
14515 while(e = (*exp->list).first)
14517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14518 e->destType = type;
14520 ProcessExpressionType(e);
14521 ListAdd(initializers, MkInitializerAssignment(e));
14524 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14526 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14527 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14528 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14529 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14530 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14531 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14532 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14533 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14534 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14535 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), ((struct Expression *)__ecereTemp1))));
14536 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14537 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14538 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14539 exp->expType = ProcessTypeString(templateString, 0x0);
14541 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14542 ProcessExpressionType(expExt);
14546 exp->expType = ProcessTypeString("Container", 0x0);
14547 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14552 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14554 FreeType(exp->expType);
14555 exp->expType = ReplaceThisClassType(thisClass);
14557 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14559 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14563 if(exp->expType->kind != 15)
14565 struct Type * member;
14566 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14568 FreeType(exp->expType);
14569 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14570 exp->expType->kind = symbol->type->kind;
14571 exp->expType->refCount++;
14572 exp->expType->enumName = enumName;
14573 exp->expType->members = symbol->type->members;
14574 for(member = symbol->type->members.first; member; member = member->next)
14575 member->refCount++;
14579 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14581 for(member = symbol->type->members.first; member; member = member->next)
14583 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(16), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14585 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14591 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14593 else if(exp->destType && !exp->destType->keepCast)
14595 if(!CheckExpressionType(exp, exp->destType, 0x0))
14597 if(!exp->destType->count || unresolved)
14602 if(exp->destType->kind != 14)
14609 char expString[10240];
14611 expString[0] = '\0';
14612 PrintType(exp->destType, type2, 0x0, 0x1);
14615 PrintExpression(exp, expString);
14616 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14619 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14620 else if(exp->type != 16)
14621 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14626 char expString[10240];
14628 expString[0] = '\0';
14631 PrintExpression(exp, expString);
14632 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14635 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14636 else if(exp->type != 16)
14637 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14649 PrintType(exp->expType, type1, 0x0, 0x1);
14650 PrintType(exp->destType, type2, 0x0, 0x1);
14652 if(exp->destType->truth && exp->destType->_class && exp->destType->_class->registered && !strcmp(exp->destType->_class->registered->name, "bool") && exp->expType->kind != 0 && exp->expType->kind != 9 && exp->expType->kind != 10 && (exp->expType->kind != 8 || exp->expType->classObjectType || (exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type != 1)))
14656 char expString[10240];
14658 expString[0] = '\0';
14661 PrintExpression(exp, expString);
14662 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14664 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14665 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14666 FreeType(exp->expType);
14667 exp->destType->refCount++;
14668 exp->expType = exp->destType;
14673 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14675 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14676 char typeString[1024];
14677 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14678 struct Declarator * decl;
14680 typeString[0] = '\0';
14683 exp->expType->refCount++;
14685 exp->expType->refCount++;
14687 newExp->destType = exp->expType;
14688 PrintType(exp->expType, typeString, 0x0, 0x0);
14689 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14690 exp->cast.typeName = MkTypeName(specs, decl);
14691 exp->cast.exp = newExp;
14694 else if(unresolved)
14696 if(exp->identifier->_class && exp->identifier->_class->name)
14697 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14698 else if(exp->identifier->string && exp->identifier->string[0])
14699 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14701 else if(!exp->expType && exp->type != 16)
14703 char expString[10240];
14705 expString[0] = '\0';
14708 PrintExpression(exp, expString);
14709 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14711 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14713 ApplyAnyObjectLogic(exp);
14714 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14716 exp->byReference = 0x1;
14718 yylloc = oldyylloc;
14721 static void FindNextDataMember(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class ** curClass, struct __ecereNameSpace__ecere__com__DataMember ** curMember, struct __ecereNameSpace__ecere__com__DataMember ** subMemberStack, int * subMemberStackPos)
14725 *curMember = (*curMember)->next;
14726 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14728 *curMember = subMemberStack[--(*subMemberStackPos)];
14729 *curMember = (*curMember)->next;
14731 while((*curMember) && (*curMember)->isProperty)
14732 *curMember = (*curMember)->next;
14733 if(subMemberStackPos)
14735 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14737 subMemberStack[(*subMemberStackPos)++] = *curMember;
14738 *curMember = (*curMember)->members.first;
14739 while(*curMember && (*curMember)->isProperty)
14740 *curMember = (*curMember)->next;
14748 if(subMemberStackPos && *subMemberStackPos)
14750 *curMember = subMemberStack[--(*subMemberStackPos)];
14751 *curMember = (*curMember)->next;
14755 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14757 if(*curClass == _class)
14759 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14761 *curMember = (*curClass)->membersAndProperties.first;
14763 while((*curMember) && (*curMember)->isProperty)
14764 *curMember = (*curMember)->next;
14765 if(subMemberStackPos)
14767 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14769 subMemberStack[(*subMemberStackPos)++] = *curMember;
14770 *curMember = (*curMember)->members.first;
14771 while(*curMember && (*curMember)->isProperty)
14772 *curMember = (*curMember)->next;
14779 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14784 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14786 if(init->exp && !init->exp->destType)
14788 FreeType(init->exp->destType);
14789 init->exp->destType = type;
14795 ProcessExpressionType(init->exp);
14796 init->isConstant = init->exp->isConstant;
14802 struct Expression * exp = init->exp;
14803 struct Instantiation * inst = exp->instance;
14804 struct MembersInit * members;
14807 init->list = MkList();
14810 for(members = (*inst->members).first; members; members = members->next)
14812 if(members->type == 0)
14814 struct MemberInit * member;
14816 for(member = (*members->dataMembers).first; member; member = member->next)
14818 ListAdd(init->list, member->initializer);
14819 member->initializer = (((void *)0));
14824 FreeExpression(exp);
14828 struct Initializer * i;
14829 struct Type * initializerType = (((void *)0));
14830 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14831 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14832 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14833 int subMemberStackPos = 0;
14835 if(type && type->kind == 12)
14836 initializerType = Dereference(type);
14837 else if(type && (type->kind == 9 || type->kind == 10))
14838 initializerType = type->members.first;
14839 for(i = (*init->list).first; i; i = i->next)
14841 if(type && type->kind == 8 && type->_class && type->_class->registered)
14843 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14846 if(!curMember->dataType)
14847 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14848 initializerType = curMember->dataType;
14851 ProcessInitializer(i, initializerType);
14852 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14853 initializerType = initializerType->next;
14855 init->isConstant = 0x0;
14857 if(type && type->kind == 12)
14858 FreeType(initializerType);
14859 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14861 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
14868 extern struct Symbol * FindType(struct Context * ctx, char * name);
14870 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
14872 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
14878 if(spec->specifier == THISCLASS)
14883 spec->name = ReplaceThisClass(thisClass);
14884 spec->symbol = FindClass(spec->name);
14885 ProcessSpecifier(spec, declareStruct);
14892 struct Symbol * symbol = FindType(curContext, spec->name);
14895 DeclareType(symbol->type, 0x1, 0x1);
14896 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
14897 DeclareStruct(spec->name, 0x0);
14902 struct Enumerator * e;
14906 for(e = (*spec->list).first; e; e = e->next)
14909 ProcessExpressionType(e->exp);
14917 if(spec->definitions)
14919 struct ClassDef * def;
14920 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
14922 ProcessClass(spec->definitions, symbol);
14929 static void ProcessDeclarator(struct Declarator * decl)
14934 if(decl->identifier->classSym)
14936 FreeSpecifier(decl->identifier->_class);
14937 decl->identifier->_class = (((void *)0));
14941 if(decl->array.exp)
14942 ProcessExpressionType(decl->array.exp);
14949 if(decl->declarator)
14950 ProcessDeclarator(decl->declarator);
14951 if(decl->type == 4)
14953 struct Identifier * id = GetDeclId(decl);
14955 if(id && id->_class)
14957 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
14959 if(!decl->function.parameters)
14960 decl->function.parameters = MkList();
14961 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
14962 id->_class = (((void *)0));
14964 if(decl->function.parameters)
14966 struct TypeName * param;
14968 for(param = (*decl->function.parameters).first; param; param = param->next)
14970 if(param->qualifiers && (*param->qualifiers).first)
14972 struct Specifier * spec = (*param->qualifiers).first;
14974 if(spec && spec->specifier == TYPED_OBJECT)
14976 struct Declarator * d = param->declarator;
14977 struct TypeName * newParam = (newParam = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), newParam->qualifiers = MkListOne(MkSpecifier(VOID)), newParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d), newParam);
14979 FreeList(param->qualifiers, FreeSpecifier);
14980 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
14981 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
14982 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
14985 else if(spec && spec->specifier == ANY_OBJECT)
14987 struct Declarator * d = param->declarator;
14989 FreeList(param->qualifiers, FreeSpecifier);
14990 param->qualifiers = MkListOne(MkSpecifier(VOID));
14991 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
14993 else if(spec->specifier == THISCLASS)
14998 spec->name = ReplaceThisClass(thisClass);
14999 spec->symbol = FindClass(spec->name);
15000 ProcessSpecifier(spec, 0x0);
15004 if(param->declarator)
15005 ProcessDeclarator(param->declarator);
15013 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15015 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15017 static void ProcessDeclaration(struct Declaration * decl)
15019 yylloc = decl->loc;
15024 unsigned int declareStruct = 0x0;
15026 if(decl->declarators)
15028 struct InitDeclarator * d;
15030 for(d = (*decl->declarators).first; d; d = d->next)
15032 struct Type * type, * subType;
15034 ProcessDeclarator(d->declarator);
15035 type = ProcessType(decl->specifiers, d->declarator);
15038 ProcessInitializer(d->initializer, type);
15039 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15041 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15043 struct Instantiation * inst = d->initializer->exp->instance;
15045 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15046 d->initializer->exp->instance = (((void *)0));
15047 if(decl->specifiers)
15048 FreeList(decl->specifiers, FreeSpecifier);
15049 FreeList(decl->declarators, FreeInitDeclarator);
15056 for(subType = type; subType; )
15058 if(subType->kind == 8)
15060 declareStruct = 0x1;
15063 else if(subType->kind == 13)
15065 else if(subType->kind == 12)
15066 subType = subType->arrayType;
15075 if(decl->specifiers)
15077 struct Specifier * s;
15079 for(s = (*decl->specifiers).first; s; s = s->next)
15081 ProcessSpecifier(s, declareStruct);
15088 ProcessInstantiationType(decl->inst);
15093 struct Specifier * spec;
15094 struct Declarator * d;
15095 unsigned int declareStruct = 0x0;
15097 if(decl->declarators)
15099 for(d = (*decl->declarators).first; d; d = d->next)
15101 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15102 struct Type * subType;
15104 ProcessDeclarator(d);
15105 for(subType = type; subType; )
15107 if(subType->kind == 8)
15109 declareStruct = 0x1;
15112 else if(subType->kind == 13)
15114 else if(subType->kind == 12)
15115 subType = subType->arrayType;
15122 if(decl->specifiers)
15124 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15125 ProcessSpecifier(spec, declareStruct);
15132 static struct FunctionDefinition * curFunction;
15134 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15136 char propName[1024], propNameM[1024];
15137 char getName[1024], setName[1024];
15138 struct __ecereNameSpace__ecere__sys__OldList * args;
15140 DeclareProperty(prop, setName, getName);
15141 strcpy(propName, "__ecereProp_");
15142 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15143 strcat(propName, "_");
15144 FullClassNameCat(propName, prop->name, 0x1);
15145 MangleClassName(propName);
15146 strcpy(propNameM, "__ecerePropM_");
15147 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15148 strcat(propNameM, "_");
15149 FullClassNameCat(propNameM, prop->name, 0x1);
15150 MangleClassName(propNameM);
15151 if(prop->isWatchable)
15154 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15155 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15156 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15158 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15159 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15160 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15164 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15165 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15166 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15168 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15169 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15170 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15172 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15173 curFunction->propSet->fireWatchersDone = 0x1;
15176 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15178 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15180 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15182 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15184 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15186 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15188 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15190 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15192 static void ProcessStatement(struct Statement * stmt)
15194 yylloc = stmt->loc;
15198 ProcessStatement(stmt->labeled.stmt);
15201 if(stmt->caseStmt.exp)
15203 FreeType(stmt->caseStmt.exp->destType);
15204 stmt->caseStmt.exp->destType = curSwitchType;
15206 curSwitchType->refCount++;
15207 ProcessExpressionType(stmt->caseStmt.exp);
15208 ComputeExpression(stmt->caseStmt.exp);
15210 if(stmt->caseStmt.stmt)
15211 ProcessStatement(stmt->caseStmt.stmt);
15215 if(stmt->compound.context)
15217 struct Declaration * decl;
15218 struct Statement * s;
15219 struct Statement * prevCompound = curCompound;
15220 struct Context * prevContext = curContext;
15222 if(!stmt->compound.isSwitch)
15224 curCompound = stmt;
15225 curContext = stmt->compound.context;
15227 if(stmt->compound.declarations)
15229 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15230 ProcessDeclaration(decl);
15232 if(stmt->compound.statements)
15234 for(s = (*stmt->compound.statements).first; s; s = s->next)
15235 ProcessStatement(s);
15237 curContext = prevContext;
15238 curCompound = prevCompound;
15244 struct Expression * exp;
15246 if(stmt->expressions)
15248 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15249 ProcessExpressionType(exp);
15255 struct Expression * exp;
15257 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15258 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15259 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15260 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15262 ProcessExpressionType(exp);
15264 if(stmt->ifStmt.stmt)
15265 ProcessStatement(stmt->ifStmt.stmt);
15266 if(stmt->ifStmt.elseStmt)
15267 ProcessStatement(stmt->ifStmt.elseStmt);
15272 struct Type * oldSwitchType = curSwitchType;
15274 if(stmt->switchStmt.exp)
15276 struct Expression * exp;
15278 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15282 ProcessExpressionType(exp);
15285 curSwitchType = exp->expType;
15288 ProcessStatement(stmt->switchStmt.stmt);
15289 curSwitchType = oldSwitchType;
15294 if(stmt->whileStmt.exp)
15296 struct Expression * exp;
15298 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15299 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15300 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15301 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15303 ProcessExpressionType(exp);
15306 if(stmt->whileStmt.stmt)
15307 ProcessStatement(stmt->whileStmt.stmt);
15312 if(stmt->doWhile.exp)
15314 struct Expression * exp;
15316 if((*stmt->doWhile.exp).last)
15318 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15319 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15320 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15322 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15324 ProcessExpressionType(exp);
15327 if(stmt->doWhile.stmt)
15328 ProcessStatement(stmt->doWhile.stmt);
15333 struct Expression * exp;
15335 if(stmt->forStmt.init)
15336 ProcessStatement(stmt->forStmt.init);
15337 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15339 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15340 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15341 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15343 if(stmt->forStmt.check)
15344 ProcessStatement(stmt->forStmt.check);
15345 if(stmt->forStmt.increment)
15347 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15348 ProcessExpressionType(exp);
15350 if(stmt->forStmt.stmt)
15351 ProcessStatement(stmt->forStmt.stmt);
15356 struct Identifier * id = stmt->forEachStmt.id;
15357 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15358 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15359 struct Statement * block = stmt->forEachStmt.stmt;
15360 char iteratorType[1024];
15361 struct Type * source;
15362 struct Expression * e;
15363 unsigned int isBuiltin = exp && (*exp).last && (((struct Expression *)(*exp).last)->type == 37 || (((struct Expression *)(*exp).last)->type == 11 && ((struct Expression *)(*exp).last)->cast.exp->type == 37));
15364 struct Expression * arrayExp;
15365 char * typeString = (((void *)0));
15366 int builtinCount = 0;
15368 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15372 FreeType(e->destType);
15373 e->destType = ProcessTypeString("Container", 0x0);
15375 if(!isBuiltin || e->next)
15376 ProcessExpressionType(e);
15378 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15379 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15381 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15382 struct Symbol * symbol;
15383 struct Expression * expIt = (((void *)0));
15384 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15385 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15386 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15387 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15390 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15391 stmt->compound.context->parent = curContext;
15392 curContext = stmt->compound.context;
15393 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15395 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15396 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15398 isCustomAVLTree = 0x1;
15399 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15401 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15404 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15406 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15408 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15411 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15415 struct Declarator * decl;
15416 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15418 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15419 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15420 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15424 struct Type * type = (((void *)0));
15425 char typeStringBuf[1024];
15427 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15428 if(((struct Expression *)(*exp).last)->type == 11)
15430 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15433 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15435 if(arrayExp->destType && arrayExp->destType->kind == 8 && arrayExp->destType->_class && arrayExp->destType->_class->registered && arrayExp->destType->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(arrayExp->destType->_class->registered, containerClass) && arrayExp->destType->_class->registered->templateArgs)
15437 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15439 typeString = templateClass->templateArgs[2].dataTypeString;
15441 else if(arrayExp->list)
15443 struct Expression * e;
15445 for(e = (*arrayExp->list).first; e; e = e->next)
15447 ProcessExpressionType(e);
15457 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15461 e->expType = (((void *)0));
15462 e = (*arrayExp->list).first;
15463 ProcessExpressionType(e);
15466 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15468 FreeType(e->expType);
15469 e->expType = (((void *)0));
15471 type = (((void *)0));
15479 FreeType(e->expType);
15480 e->expType = (((void *)0));
15486 typeStringBuf[0] = '\0';
15487 PrintType(type, typeStringBuf, 0x0, 0x1);
15488 typeString = typeStringBuf;
15494 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15495 struct Declarator * decl;
15496 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15500 struct Expression * e;
15502 builtinCount = (*arrayExp->list).count;
15503 type = ProcessTypeString(typeString, 0x0);
15504 while(e = (*arrayExp->list).first)
15506 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15507 e->destType = type;
15509 ProcessExpressionType(e);
15510 ListAdd(initializers, MkInitializerAssignment(e));
15513 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15515 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15516 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15517 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15518 FreeList(exp, FreeExpression);
15522 arrayExp->expType = ProcessTypeString("Container", 0x0);
15523 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15526 else if(isLinkList && !isList)
15528 struct Declarator * decl;
15529 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15531 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15532 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15533 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15535 else if(_class->templateArgs)
15538 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15540 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15541 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15543 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15544 if(block && block->type == 2 && block->compound.context)
15546 block->compound.context->parent = stmt->compound.context;
15550 block = MkIfStmt(filter, block, (((void *)0)));
15554 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("array")), '+', MkExpMember(MkExpIdentifier(MkIdentifier("__internalArray")), MkIdentifier("count")))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
15555 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15556 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15557 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15563 sprintf(count, "%d", builtinCount);
15564 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpIdentifier(MkIdentifier("__internalArray"))))), MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '<', MkExpOp(MkExpIdentifier(MkIdentifier("__internalArray")), '+', MkExpConstant(count))))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), INC_OP, (((void *)0)))), block));
15565 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15566 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15567 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15569 else if(isLinkList && !isList)
15571 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15572 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15574 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15576 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("next")))), block));
15580 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15581 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15583 stmt->compound.statements = MkListOne(MkForStmt(MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("first"))))), MkExpressionStmt(MkListOne(MkExpIdentifier(CopyIdentifier(id)))), MkListOne(MkExpOp(MkExpIdentifier(CopyIdentifier(id)), '=', MkExpCast(MkTypeName(specs, decl), MkExpCall(MkExpMember(MkExpIdentifier(MkIdentifier("__internalLinkList")), MkIdentifier("GetNext")), MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("IteratorPointer")), (((void *)0))), MkExpIdentifier(CopyIdentifier(id)))))))), block));
15585 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15586 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15587 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15591 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15593 ProcessExpressionType(expIt);
15594 if((*stmt->compound.declarations).first)
15595 ProcessDeclaration((*stmt->compound.declarations).first);
15597 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15598 ProcessStatement(stmt);
15599 curContext = stmt->compound.context->parent;
15604 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15616 struct Expression * exp;
15618 if(stmt->expressions)
15620 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15624 if(curFunction && !curFunction->type)
15625 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15626 FreeType(exp->destType);
15627 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15629 exp->destType->refCount++;
15631 ProcessExpressionType(exp);
15638 ProcessDeclaration(stmt->decl);
15643 struct AsmField * field;
15645 if(stmt->asmStmt.inputFields)
15647 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15648 if(field->expression)
15649 ProcessExpressionType(field->expression);
15651 if(stmt->asmStmt.outputFields)
15653 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15654 if(field->expression)
15655 ProcessExpressionType(field->expression);
15657 if(stmt->asmStmt.clobberedFields)
15659 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15661 if(field->expression)
15662 ProcessExpressionType(field->expression);
15669 struct PropertyWatch * propWatch;
15670 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15671 struct Expression * object = stmt->_watch.object;
15672 struct Expression * watcher = stmt->_watch.watcher;
15675 ProcessExpressionType(watcher);
15677 ProcessExpressionType(object);
15680 if(watcher || thisClass)
15682 struct External * external = curExternal;
15683 struct Context * context = curContext;
15686 stmt->expressions = MkList();
15687 curExternal = external->prev;
15688 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15690 struct ClassFunction * func;
15691 char watcherName[1024];
15692 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15693 struct External * createdExternal;
15694 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15696 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15697 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15698 if(propWatch->deleteWatch)
15699 strcat(watcherName, "_delete");
15702 struct Identifier * propID;
15704 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15706 strcat(watcherName, "_");
15707 strcat(watcherName, propID->string);
15710 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15712 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15713 ProcessClassFunctionBody(func, propWatch->compound);
15714 propWatch->compound = (((void *)0));
15715 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15716 createdExternal->symbol->idCode = external->symbol->idCode;
15717 curExternal = createdExternal;
15718 ProcessFunction(createdExternal->function);
15720 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15722 externalDecl->declaration = decl;
15723 if(decl->symbol && !decl->symbol->pointerExternal)
15724 decl->symbol->pointerExternal = externalDecl;
15726 if(propWatch->deleteWatch)
15728 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15730 ListAdd(args, CopyExpression(object));
15731 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15732 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15733 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15737 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15738 struct Identifier * propID;
15740 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15742 char propName[1024];
15743 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15747 char getName[1024], setName[1024];
15748 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15750 DeclareProperty(prop, setName, getName);
15751 strcpy(propName, "__ecereProp_");
15752 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15753 strcat(propName, "_");
15754 FullClassNameCat(propName, prop->name, 0x1);
15755 ListAdd(args, CopyExpression(object));
15756 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15757 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15758 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15759 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15769 curExternal = external;
15770 curContext = context;
15772 FreeExpression(watcher);
15774 FreeExpression(object);
15775 FreeList(watches, FreePropertyWatch);
15778 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15782 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15784 ProcessStatement(propWatch->compound);
15791 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15792 struct Expression * object = stmt->_watch.object;
15793 struct __ecereNameSpace__ecere__com__Class * _class;
15796 ProcessExpressionType(object);
15799 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15802 struct Identifier * propID;
15805 stmt->expressions = MkList();
15806 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15808 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15815 for(propID = (*watches).first; propID; propID = propID->next)
15817 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15821 CreateFireWatcher(prop, object, stmt);
15824 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15829 struct __ecereNameSpace__ecere__com__Property * prop;
15830 struct __ecereNameSpace__ecere__com__Class * base;
15832 for(base = _class; base; base = base->base)
15834 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15836 if(prop->isProperty && prop->isWatchable)
15838 CreateFireWatcher(prop, object, stmt);
15844 FreeExpression(object);
15845 FreeList(watches, FreeIdentifier);
15848 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15854 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15855 struct Expression * object = stmt->_watch.object;
15856 struct Expression * watcher = stmt->_watch.watcher;
15857 struct __ecereNameSpace__ecere__com__Class * _class;
15860 ProcessExpressionType(object);
15862 ProcessExpressionType(watcher);
15865 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
15866 if(watcher || thisClass)
15870 struct Identifier * propID;
15873 stmt->expressions = MkList();
15876 struct __ecereNameSpace__ecere__sys__OldList * args;
15879 ListAdd(args, CopyExpression(object));
15880 ListAdd(args, MkExpConstant("0"));
15881 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15882 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15886 for(propID = (*watches).first; propID; propID = propID->next)
15888 char propName[1024];
15889 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15893 char getName[1024], setName[1024];
15894 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15896 DeclareProperty(prop, setName, getName);
15897 strcpy(propName, "__ecereProp_");
15898 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15899 strcat(propName, "_");
15900 FullClassNameCat(propName, prop->name, 0x1);
15901 MangleClassName(propName);
15902 ListAdd(args, CopyExpression(object));
15903 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15904 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15905 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
15908 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15912 FreeExpression(object);
15914 FreeExpression(watcher);
15915 FreeList(watches, FreeIdentifier);
15918 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
15928 extern struct Expression * QBrackets(struct Expression * exp);
15930 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
15932 extern struct Declarator * QMkPtrDecl(char * id);
15934 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
15936 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
15938 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
15940 static void ProcessFunction(struct FunctionDefinition * function)
15942 void * __ecereTemp2;
15943 void * __ecereTemp1;
15944 struct Identifier * id = GetDeclId(function->declarator);
15945 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
15946 struct Type * type = symbol ? symbol->type : (((void *)0));
15947 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
15948 struct Context * oldTopContext = topContext;
15950 yylloc = function->loc;
15951 if(type && type->thisClass)
15953 struct Symbol * classSym = type->thisClass;
15954 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
15955 char className[1024];
15956 char structName[1024];
15957 struct Declarator * funcDecl;
15958 struct Symbol * thisSymbol;
15959 unsigned int typedObject = 0x0;
15961 if(_class && !_class->base)
15963 _class = currentClass;
15964 if(_class && !_class->symbol)
15965 _class->symbol = FindClass(_class->fullName);
15966 classSym = _class ? _class->symbol : (((void *)0));
15969 thisClass = _class;
15970 if(inCompiler && _class)
15972 if(type->kind == 11)
15974 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
15976 struct Type * param = symbol->type->params.first;
15978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
15981 if(type->classObjectType != 1)
15983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
15984 symbol->type->staticMethod = 0x1;
15985 symbol->type->thisClass = (((void *)0));
15986 symbol->type->extraParam = 0x0;
15989 strcpy(className, "__ecereClass_");
15990 FullClassNameCat(className, _class->fullName, 0x1);
15991 MangleClassName(className);
15992 structName[0] = (char)0;
15993 FullClassNameCat(structName, _class->fullName, 0x0);
15994 funcDecl = GetFuncDecl(function->declarator);
15997 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
15999 struct TypeName * param = (*funcDecl->function.parameters).first;
16001 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16003 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16004 FreeTypeName(param);
16007 if(!function->propertyNoThis)
16009 struct TypeName * thisParam;
16011 if(type->classObjectType != 1)
16013 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16014 if(!funcDecl->function.parameters)
16015 funcDecl->function.parameters = MkList();
16016 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16020 if(type->classObjectType != 1)
16022 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16023 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16025 thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
16026 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16030 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16032 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16034 funcDecl = GetFuncDecl(initDecl->declarator);
16037 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16039 struct TypeName * param = (*funcDecl->function.parameters).first;
16041 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16043 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16044 FreeTypeName(param);
16047 if(type->classObjectType != 1)
16049 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16051 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16053 if(!funcDecl->function.parameters)
16054 funcDecl->function.parameters = MkList();
16055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16063 if(type->classObjectType != 1)
16065 thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
16066 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16067 if(typedObject && thisSymbol->type)
16069 thisSymbol->type->classObjectType = 2;
16070 thisSymbol->type->byReference = type->byReference;
16074 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16076 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16079 struct __ecereNameSpace__ecere__com__Class * base;
16081 for(base = _class; base && base->type != 1000; base = base->next)
16083 for(member = base->membersAndProperties.first; member; member = member->next)
16084 if(!member->isProperty)
16090 for(member = _class->membersAndProperties.first; member; member = member->next)
16091 if(!member->isProperty)
16095 char pointerName[1024];
16096 struct Declaration * decl;
16097 struct Initializer * initializer;
16098 struct Expression * exp, * bytePtr;
16100 strcpy(pointerName, "__ecerePointer_");
16101 FullClassNameCat(pointerName, _class->fullName, 0x0);
16103 char className[1024];
16105 strcpy(className, "__ecereClass_");
16106 FullClassNameCat(className, classSym->string, 0x1);
16107 MangleClassName(className);
16108 DeclareClass(classSym, className);
16110 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16115 sprintf(string, "%d", _class->offset);
16116 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16120 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16122 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16123 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
16126 yylloc = function->body->loc;
16127 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16129 struct Context * prevContext = curContext;
16131 curContext = function->body->compound.context;
16132 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16133 curContext = prevContext;
16135 decl->symbol = (((void *)0));
16136 if(!function->body->compound.declarations)
16137 function->body->compound.declarations = MkList();
16138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16144 thisClass = (((void *)0));
16147 FreeSpecifier(id->_class);
16148 id->_class = (((void *)0));
16149 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16151 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16153 id = GetDeclId(initDecl->declarator);
16154 FreeSpecifier(id->_class);
16155 id->_class = (((void *)0));
16159 topContext = function->body->compound.context;
16161 struct FunctionDefinition * oldFunction = curFunction;
16163 curFunction = function;
16165 ProcessStatement(function->body);
16166 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16168 struct Statement * prevCompound = curCompound;
16169 struct Context * prevContext = curContext;
16170 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16172 if(!function->body->compound.statements)
16173 function->body->compound.statements = MkList();
16174 ListAdd(function->body->compound.statements, fireWatchers);
16175 curCompound = function->body;
16176 curContext = function->body->compound.context;
16177 ProcessStatement(fireWatchers);
16178 curContext = prevContext;
16179 curCompound = prevCompound;
16181 curFunction = oldFunction;
16183 if(function->declarator)
16185 ProcessDeclarator(function->declarator);
16187 topContext = oldTopContext;
16188 thisClass = oldThisClass;
16191 extern void FreeSymbol(struct Symbol * symbol);
16193 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16195 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16197 struct ClassDef * def;
16198 struct External * external = curExternal;
16199 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16201 for(def = definitions->first; def; def = def->next)
16205 if(def->function->declarator)
16206 curExternal = def->function->declarator->symbol->pointerExternal;
16208 curExternal = external;
16209 ProcessFunction((struct FunctionDefinition *)def->function);
16211 else if(def->type == 2)
16213 if(def->decl->type == 2)
16215 thisClass = regClass;
16216 ProcessInstantiationType(def->decl->inst);
16217 thisClass = (((void *)0));
16221 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16224 thisClass = regClass;
16225 ProcessDeclaration(def->decl);
16226 thisClass = backThisClass;
16229 else if(def->type == 1 && def->defProperties)
16231 struct MemberInit * defProperty;
16232 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = regClass ? MkClassType(regClass->fullName) : (((void *)0)), thisSymbol);
16234 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16235 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16237 thisClass = regClass;
16238 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16239 thisClass = (((void *)0));
16241 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16242 FreeSymbol(thisSymbol);
16244 else if(def->type == 3 && def->propertyDef)
16246 struct PropertyDef * prop = def->propertyDef;
16248 thisClass = regClass;
16253 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16255 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16257 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16258 ProcessStatement(prop->setStmt);
16264 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16266 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16268 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16269 ProcessStatement(prop->getStmt);
16271 if(prop->issetStmt)
16275 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16277 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16279 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16280 ProcessStatement(prop->issetStmt);
16282 thisClass = (((void *)0));
16284 else if(def->type == 4 && def->propertyWatch)
16286 struct PropertyWatch * propertyWatch = def->propertyWatch;
16288 thisClass = regClass;
16289 if(propertyWatch->compound)
16291 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = regClass ? MkClassType(regClass->fullName) : (((void *)0)), thisSymbol);
16293 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16294 curExternal = (((void *)0));
16295 ProcessStatement(propertyWatch->compound);
16297 thisClass = (((void *)0));
16302 void DeclareFunctionUtil(char * s)
16304 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16311 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16312 strcpy(name, "__ecereFunction_");
16313 FullClassNameCat(name, s, 0x0);
16314 DeclareFunction(function, name);
16318 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16320 void ComputeDataTypes()
16322 void * __ecereTemp1;
16323 struct External * external;
16324 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16326 currentClass = (((void *)0));
16327 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16328 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16329 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
16330 curExternal = temp;
16331 DeclareFunctionUtil("eSystem_New");
16332 DeclareFunctionUtil("eSystem_New0");
16333 DeclareFunctionUtil("eSystem_Renew");
16334 DeclareFunctionUtil("eSystem_Renew0");
16335 DeclareFunctionUtil("eClass_GetProperty");
16336 DeclareStruct("ecere::com::Class", 0x0);
16337 DeclareStruct("ecere::com::Instance", 0x0);
16338 DeclareStruct("ecere::com::Property", 0x0);
16339 DeclareStruct("ecere::com::DataMember", 0x0);
16340 DeclareStruct("ecere::com::Method", 0x0);
16341 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16342 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16343 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16344 for(external = (*ast).first; external; external = external->next)
16346 afterExternal = curExternal = external;
16347 if(external->type == 0)
16349 currentClass = external->function->_class;
16350 ProcessFunction(external->function);
16352 else if(external->type == 1)
16354 currentClass = (((void *)0));
16355 ProcessDeclaration(external->declaration);
16357 else if(external->type == 2)
16359 struct ClassDefinition * _class = external->_class;
16361 currentClass = external->symbol->registered;
16362 if(_class->definitions)
16364 ProcessClass(_class->definitions, _class->symbol);
16368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16369 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16372 else if(external->type == 4)
16374 thisNameSpace = external->id->string;
16377 currentClass = (((void *)0));
16378 thisNameSpace = (((void *)0));
16379 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16380 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16383 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);
16385 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16387 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16389 struct __ecereNameSpace__ecere__com__Class * class;
16391 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16392 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16393 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16394 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16395 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoi64", "int64 _strtoi64(char * string, char * * endString, int base)", _strtoi64, module, 2);
16396 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("_strtoui64", "uint64 _strtoui64(char * string, char * * endString, int base)", _strtoui64, module, 2);
16397 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16398 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16399 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16400 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16401 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16402 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16403 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16404 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16405 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16406 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16407 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16408 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16409 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16410 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16411 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16412 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16413 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16414 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16415 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16416 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16417 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16418 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16419 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16420 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16421 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16422 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16423 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16424 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16425 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16426 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass)", AddMembers, module, 2);
16427 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16428 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16429 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16430 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMemberInitData", "void ProcessMemberInitData(MemberInit member, ecere::com::Class _class, ecere::com::Class * curClass, ecere::com::DataMember * curMember, ecere::com::DataMember * subMemberStack, int * subMemberStackPos)", ProcessMemberInitData, module, 2);
16431 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16432 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16433 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16434 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16435 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16436 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16437 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16438 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16439 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16440 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16441 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16442 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16443 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16444 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + 12)))->application && class)
16445 __ecereClass_Conversion = class;
16446 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypes", "bool MatchTypes(Type source, Type dest, ecere::sys::OldList conversions, ecere::com::Class owningClassSource, ecere::com::Class owningClassDest, bool doConversion, bool enumBaseType, bool acceptReversedParams, bool isConversionExploration)", MatchTypes, module, 1);
16447 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchWithEnums_NameSpace", "bool MatchWithEnums_NameSpace(ecere::com::NameSpace nameSpace, Expression sourceExp, Type dest, char * string, ecere::sys::OldList conversions)", MatchWithEnums_NameSpace, module, 2);
16448 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16449 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchWithEnums_Module", "bool MatchWithEnums_Module(ecere::com::Module mainModule, Expression sourceExp, Type dest, char * string, ecere::sys::OldList conversions)", MatchWithEnums_Module, module, 2);
16450 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16451 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16452 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16453 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16454 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16455 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16456 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16457 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16458 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16459 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16460 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16461 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16462 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16463 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16464 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16465 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16466 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16469 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)