1 /* Code generated from eC source file: pass15.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
43 #define structSize_NamedLink (_64BIT ? 32 : 16)
45 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
51 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
55 struct __ecereNameSpace__ecere__sys__BTNode;
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
59 struct __ecereNameSpace__ecere__sys__BinaryTree
61 struct __ecereNameSpace__ecere__sys__BTNode * root;
63 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
64 void (* FreeKey)(void * key);
65 } __attribute__ ((gcc_struct));
67 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
69 struct __ecereNameSpace__ecere__sys__OldList
76 } __attribute__ ((gcc_struct));
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
80 struct __ecereNameSpace__ecere__com__Method
83 struct __ecereNameSpace__ecere__com__Method * parent;
84 struct __ecereNameSpace__ecere__com__Method * left;
85 struct __ecereNameSpace__ecere__com__Method * right;
90 struct __ecereNameSpace__ecere__com__Class * _class;
92 char * dataTypeString;
93 struct Type * dataType;
95 } __attribute__ ((gcc_struct));
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
99 struct __ecereNameSpace__ecere__com__Property
101 struct __ecereNameSpace__ecere__com__Property * prev;
102 struct __ecereNameSpace__ecere__com__Property * next;
104 unsigned int isProperty;
107 struct __ecereNameSpace__ecere__com__Class * _class;
108 char * dataTypeString;
109 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
110 struct Type * dataType;
111 void (* Set)(void * , int);
112 int (* Get)(void * );
113 unsigned int (* IsSet)(void * );
117 unsigned int conversion;
118 unsigned int watcherOffset;
120 unsigned int compiled;
121 unsigned int selfWatchable;
122 unsigned int isWatchable;
123 } __attribute__ ((gcc_struct));
125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
133 } __attribute__ ((gcc_struct));
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
139 struct CodePosition start;
140 struct CodePosition end;
141 } __attribute__ ((gcc_struct));
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
156 struct Attrib * attr;
157 } __attribute__ ((gcc_struct));
158 } __attribute__ ((gcc_struct));
160 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
162 struct ClassDefinition
164 struct ClassDefinition * prev;
165 struct ClassDefinition * next;
167 struct Specifier * _class;
168 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
169 struct __ecereNameSpace__ecere__sys__OldList * definitions;
170 struct Symbol * symbol;
171 struct Location blockStart;
172 struct Location nameLoc;
175 unsigned int deleteWatchable;
176 } __attribute__ ((gcc_struct));
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
182 struct Context * parent;
183 struct __ecereNameSpace__ecere__sys__BinaryTree types;
184 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
185 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
186 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
190 struct ClassDefinition * classDef;
191 unsigned int templateTypesOnly;
192 unsigned int hasNameSpace;
193 } __attribute__ ((gcc_struct));
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
199 struct Instantiation * prev;
200 struct Instantiation * next;
202 struct Specifier * _class;
203 struct Expression * exp;
204 struct __ecereNameSpace__ecere__sys__OldList * members;
205 struct Symbol * symbol;
206 unsigned int fullSet;
207 unsigned int isConstant;
208 unsigned char * data;
209 struct Location nameLoc;
210 struct Location insideLoc;
212 } __attribute__ ((gcc_struct));
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
218 struct Declaration * prev;
219 struct Declaration * next;
226 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
227 struct __ecereNameSpace__ecere__sys__OldList * declarators;
228 } __attribute__ ((gcc_struct));
229 struct Instantiation * inst;
232 struct Identifier * id;
233 struct Expression * exp;
234 } __attribute__ ((gcc_struct));
235 } __attribute__ ((gcc_struct));
236 struct Specifier * extStorage;
237 struct Symbol * symbol;
239 } __attribute__ ((gcc_struct));
241 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
245 struct Statement * prev;
246 struct Statement * next;
251 struct __ecereNameSpace__ecere__sys__OldList * expressions;
254 struct Identifier * id;
255 struct Statement * stmt;
256 } __attribute__ ((gcc_struct)) labeled;
259 struct Expression * exp;
260 struct Statement * stmt;
261 } __attribute__ ((gcc_struct)) caseStmt;
264 struct __ecereNameSpace__ecere__sys__OldList * declarations;
265 struct __ecereNameSpace__ecere__sys__OldList * statements;
266 struct Context * context;
267 unsigned int isSwitch;
268 } __attribute__ ((gcc_struct)) compound;
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 struct Statement * elseStmt;
274 } __attribute__ ((gcc_struct)) ifStmt;
277 struct __ecereNameSpace__ecere__sys__OldList * exp;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) switchStmt;
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 } __attribute__ ((gcc_struct)) whileStmt;
287 struct __ecereNameSpace__ecere__sys__OldList * exp;
288 struct Statement * stmt;
289 } __attribute__ ((gcc_struct)) doWhile;
292 struct Statement * init;
293 struct Statement * check;
294 struct __ecereNameSpace__ecere__sys__OldList * increment;
295 struct Statement * stmt;
296 } __attribute__ ((gcc_struct)) forStmt;
299 struct Identifier * id;
300 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct Specifier * spec;
305 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
307 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
308 } __attribute__ ((gcc_struct)) asmStmt;
311 struct Expression * watcher;
312 struct Expression * object;
313 struct __ecereNameSpace__ecere__sys__OldList * watches;
314 } __attribute__ ((gcc_struct)) _watch;
317 struct Identifier * id;
318 struct __ecereNameSpace__ecere__sys__OldList * exp;
319 struct __ecereNameSpace__ecere__sys__OldList * filter;
320 struct Statement * stmt;
321 } __attribute__ ((gcc_struct)) forEachStmt;
322 struct Declaration * decl;
323 } __attribute__ ((gcc_struct));
324 } __attribute__ ((gcc_struct));
326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
330 struct TypeName * prev;
331 struct TypeName * next;
333 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
334 struct Declarator * declarator;
336 struct Expression * bitCount;
337 } __attribute__ ((gcc_struct));
339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
343 struct Initializer * prev;
344 struct Initializer * next;
349 struct Expression * exp;
350 struct __ecereNameSpace__ecere__sys__OldList * list;
351 } __attribute__ ((gcc_struct));
352 unsigned int isConstant;
353 } __attribute__ ((gcc_struct));
355 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
357 struct __ecereNameSpace__ecere__com__DataValue
372 } __attribute__ ((gcc_struct));
373 } __attribute__ ((gcc_struct));
375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
379 struct Expression * prev;
380 struct Expression * next;
388 struct Identifier * identifier;
389 } __attribute__ ((gcc_struct));
390 struct Statement * compound;
391 struct Instantiation * instance;
393 struct __ecereNameSpace__ecere__sys__OldList * list;
396 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
397 struct Declarator * decl;
398 } __attribute__ ((gcc_struct)) _classExp;
401 struct Identifier * id;
402 } __attribute__ ((gcc_struct)) classData;
405 struct Expression * exp;
406 struct __ecereNameSpace__ecere__sys__OldList * arguments;
407 struct Location argLoc;
408 } __attribute__ ((gcc_struct)) call;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * index;
413 } __attribute__ ((gcc_struct)) index;
416 struct Expression * exp;
417 struct Identifier * member;
419 unsigned int thisPtr;
420 } __attribute__ ((gcc_struct)) member;
424 struct Expression * exp1;
425 struct Expression * exp2;
426 } __attribute__ ((gcc_struct)) op;
427 struct TypeName * typeName;
428 struct Specifier * _class;
431 struct TypeName * typeName;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) cast;
436 struct Expression * cond;
437 struct __ecereNameSpace__ecere__sys__OldList * exp;
438 struct Expression * elseExp;
439 } __attribute__ ((gcc_struct)) cond;
442 struct TypeName * typeName;
443 struct Expression * size;
444 } __attribute__ ((gcc_struct)) _new;
447 struct TypeName * typeName;
448 struct Expression * size;
449 struct Expression * exp;
450 } __attribute__ ((gcc_struct)) _renew;
454 struct Identifier * id;
455 } __attribute__ ((gcc_struct)) db;
458 struct Expression * ds;
459 struct Expression * name;
460 } __attribute__ ((gcc_struct)) dbopen;
463 struct TypeName * typeName;
464 struct Initializer * initializer;
465 } __attribute__ ((gcc_struct)) initializer;
468 struct Expression * exp;
469 struct TypeName * typeName;
470 } __attribute__ ((gcc_struct)) vaArg;
471 } __attribute__ ((gcc_struct));
472 unsigned int debugValue;
473 struct __ecereNameSpace__ecere__com__DataValue val;
475 unsigned int hasAddress;
476 struct Type * expType;
477 struct Type * destType;
480 unsigned int byReference;
481 unsigned int isConstant;
482 unsigned int addedThis;
483 unsigned int needCast;
484 unsigned int thisPtr;
485 } __attribute__ ((gcc_struct));
487 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
489 struct TemplateDatatype
491 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
492 struct Declarator * decl;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
497 struct TemplateArgument;
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
501 struct TemplateParameter
503 struct TemplateParameter * prev;
504 struct TemplateParameter * next;
507 struct Identifier * identifier;
510 struct TemplateDatatype * dataType;
512 } __attribute__ ((gcc_struct));
513 struct TemplateArgument * defaultArgument;
514 char * dataTypeString;
515 struct Type * baseType;
516 } __attribute__ ((gcc_struct));
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
522 struct Specifier * prev;
523 struct Specifier * next;
531 struct ExtDecl * extDecl;
533 struct Symbol * symbol;
534 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
535 } __attribute__ ((gcc_struct));
538 struct Identifier * id;
539 struct __ecereNameSpace__ecere__sys__OldList * list;
540 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
541 struct __ecereNameSpace__ecere__sys__OldList * definitions;
542 unsigned int addNameSpace;
543 struct Context * ctx;
544 struct ExtDecl * extDeclStruct;
545 } __attribute__ ((gcc_struct));
546 struct Expression * expression;
547 struct Specifier * _class;
548 struct TemplateParameter * templateParameter;
549 } __attribute__ ((gcc_struct));
550 } __attribute__ ((gcc_struct));
552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
556 struct Identifier * prev;
557 struct Identifier * next;
559 struct Symbol * classSym;
560 struct Specifier * _class;
562 struct Identifier * badID;
563 } __attribute__ ((gcc_struct));
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
569 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
573 struct Declarator * prev;
574 struct Declarator * next;
577 struct Symbol * symbol;
578 struct Declarator * declarator;
581 struct Identifier * identifier;
584 struct Expression * exp;
585 struct Expression * posExp;
586 struct Attrib * attrib;
587 } __attribute__ ((gcc_struct)) structDecl;
590 struct Expression * exp;
591 struct Specifier * enumClass;
592 } __attribute__ ((gcc_struct)) array;
595 struct __ecereNameSpace__ecere__sys__OldList * parameters;
596 } __attribute__ ((gcc_struct)) function;
599 struct Pointer * pointer;
600 } __attribute__ ((gcc_struct)) pointer;
603 struct ExtDecl * extended;
604 } __attribute__ ((gcc_struct)) extended;
605 } __attribute__ ((gcc_struct));
606 } __attribute__ ((gcc_struct));
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
610 struct FunctionDefinition
612 struct FunctionDefinition * prev;
613 struct FunctionDefinition * next;
615 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
616 struct Declarator * declarator;
617 struct __ecereNameSpace__ecere__sys__OldList * declarations;
618 struct Statement * body;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 struct __ecereNameSpace__ecere__sys__OldList attached;
623 struct Symbol * propSet;
625 unsigned int propertyNoThis;
626 } __attribute__ ((gcc_struct));
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
636 struct External * prev;
637 struct External * next;
640 struct Symbol * symbol;
643 struct FunctionDefinition * function;
644 struct ClassDefinition * _class;
645 struct Declaration * declaration;
647 struct Identifier * id;
648 struct DBTableDef * table;
649 } __attribute__ ((gcc_struct));
651 } __attribute__ ((gcc_struct));
653 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
657 struct ModuleImport * prev;
658 struct ModuleImport * next;
660 struct __ecereNameSpace__ecere__sys__OldList classes;
661 struct __ecereNameSpace__ecere__sys__OldList functions;
664 } __attribute__ ((gcc_struct));
666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
670 struct ClassImport * prev;
671 struct ClassImport * next;
673 struct __ecereNameSpace__ecere__sys__OldList methods;
674 struct __ecereNameSpace__ecere__sys__OldList properties;
676 unsigned int isRemote;
677 } __attribute__ ((gcc_struct));
679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
684 struct Symbol * parent;
685 struct Symbol * left;
686 struct Symbol * right;
691 struct __ecereNameSpace__ecere__com__Method * method;
692 struct __ecereNameSpace__ecere__com__Property * _property;
693 struct __ecereNameSpace__ecere__com__Class * registered;
694 } __attribute__ ((gcc_struct));
701 struct External * pointerExternal;
702 struct External * structExternal;
703 } __attribute__ ((gcc_struct));
706 struct External * externalGet;
707 struct External * externalSet;
708 struct External * externalPtr;
709 struct External * externalIsSet;
710 } __attribute__ ((gcc_struct));
713 struct External * methodExternal;
714 struct External * methodCodeExternal;
715 } __attribute__ ((gcc_struct));
716 } __attribute__ ((gcc_struct));
717 unsigned int imported;
718 unsigned int declaredStructSym;
719 struct __ecereNameSpace__ecere__com__Class * _class;
720 unsigned int declaredStruct;
721 unsigned int needConstructor;
722 unsigned int needDestructor;
723 char * constructorName;
726 char * destructorName;
727 struct ModuleImport * module;
728 struct ClassImport * _import;
729 struct Location nameLoc;
730 unsigned int isParam;
731 unsigned int isRemote;
732 unsigned int isStruct;
733 unsigned int fireWatchersDone;
735 unsigned int classData;
736 unsigned int isStatic;
738 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
739 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
740 struct Context * ctx;
742 struct Expression * propCategory;
743 } __attribute__ ((gcc_struct));
745 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
754 struct Symbol * _class;
757 struct __ecereNameSpace__ecere__sys__OldList members;
759 } __attribute__ ((gcc_struct));
762 struct Type * returnType;
763 struct __ecereNameSpace__ecere__sys__OldList params;
764 struct Symbol * thisClass;
765 unsigned int staticMethod;
766 struct TemplateParameter * thisClassTemplate;
767 } __attribute__ ((gcc_struct));
770 struct __ecereNameSpace__ecere__com__Method * method;
771 struct __ecereNameSpace__ecere__com__Class * methodClass;
772 struct __ecereNameSpace__ecere__com__Class * usedClass;
773 } __attribute__ ((gcc_struct));
776 struct Type * arrayType;
778 struct Expression * arraySizeExp;
779 unsigned int freeExp;
780 struct Symbol * enumClass;
781 } __attribute__ ((gcc_struct));
783 struct TemplateParameter * templateParameter;
784 } __attribute__ ((gcc_struct));
794 unsigned int isSigned : 1;
795 unsigned int constant : 1;
796 unsigned int truth : 1;
797 unsigned int byReference : 1;
798 unsigned int extraParam : 1;
799 unsigned int directClassAccess : 1;
800 unsigned int computing : 1;
801 unsigned int keepCast : 1;
802 unsigned int passAsTemplate : 1;
803 unsigned int dllExport : 1;
804 unsigned int attrStdcall : 1;
805 unsigned int declaredWithStruct : 1;
806 unsigned int typedByReference : 1;
807 } __attribute__ ((gcc_struct));
809 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
811 struct __ecereNameSpace__ecere__com__Class
813 struct __ecereNameSpace__ecere__com__Class * prev;
814 struct __ecereNameSpace__ecere__com__Class * next;
820 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
821 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
824 struct __ecereNameSpace__ecere__com__Class * base;
825 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
826 struct __ecereNameSpace__ecere__sys__BinaryTree members;
827 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
828 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
829 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
830 struct __ecereNameSpace__ecere__sys__OldList derivatives;
834 struct __ecereNameSpace__ecere__com__Instance * module;
835 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
836 char * dataTypeString;
837 struct Type * dataType;
839 int defaultAlignment;
840 void (* Initialize)();
842 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
843 char * designerClass;
844 unsigned int noExpansion;
845 char * defaultProperty;
846 unsigned int comRedefinition;
848 unsigned int isRemote;
849 unsigned int internalDecl;
851 unsigned int computeSize;
853 int destructionWatchOffset;
855 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
856 int inheritanceAccess;
859 struct __ecereNameSpace__ecere__sys__OldList conversions;
860 struct __ecereNameSpace__ecere__sys__OldList templateParams;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
862 struct __ecereNameSpace__ecere__com__Class * templateClass;
863 struct __ecereNameSpace__ecere__sys__OldList templatized;
865 unsigned int isInstanceClass;
866 unsigned int byValueSystemClass;
867 } __attribute__ ((gcc_struct));
869 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
873 struct __ecereNameSpace__ecere__com__Instance
876 struct __ecereNameSpace__ecere__com__Class * _class;
878 } __attribute__ ((gcc_struct));
880 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
882 struct __ecereNameSpace__ecere__com__DataMember
884 struct __ecereNameSpace__ecere__com__DataMember * prev;
885 struct __ecereNameSpace__ecere__com__DataMember * next;
887 unsigned int isProperty;
890 struct __ecereNameSpace__ecere__com__Class * _class;
891 char * dataTypeString;
892 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
893 struct Type * dataType;
897 struct __ecereNameSpace__ecere__sys__OldList members;
898 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
901 } __attribute__ ((gcc_struct));
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
905 struct __ecereNameSpace__ecere__com__SerialBuffer
907 unsigned char * _buffer;
911 } __attribute__ ((gcc_struct));
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
915 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
921 char * dataTypeString;
922 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
923 } __attribute__ ((gcc_struct));
924 struct __ecereNameSpace__ecere__com__DataValue expression;
930 struct __ecereNameSpace__ecere__com__DataMember * member;
931 struct __ecereNameSpace__ecere__com__Property * prop;
932 struct __ecereNameSpace__ecere__com__Method * method;
933 } __attribute__ ((gcc_struct));
934 } __attribute__ ((gcc_struct));
935 } __attribute__ ((gcc_struct));
936 } __attribute__ ((gcc_struct));
938 void exit(int status);
940 void * calloc(size_t nmemb, size_t size);
942 void free(void * ptr);
944 void * malloc(size_t size);
946 void * realloc(void * ptr, size_t size);
948 long int strtol(const char * nptr, char ** endptr, int base);
950 long long int strtoll(const char * nptr, char ** endptr, int base);
952 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
956 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371
959 typedef union YYSTYPE
964 struct Identifier * id;
965 struct Expression * exp;
966 struct Specifier * specifier;
967 struct __ecereNameSpace__ecere__sys__OldList * list;
968 struct Enumerator * enumerator;
969 struct Declarator * declarator;
970 struct Pointer * pointer;
971 struct Initializer * initializer;
972 struct InitDeclarator * initDeclarator;
973 struct TypeName * typeName;
974 struct Declaration * declaration;
975 struct Statement * stmt;
976 struct FunctionDefinition * function;
977 struct External * external;
978 struct Context * context;
979 struct AsmField * asmField;
980 struct Attrib * attrib;
981 struct ExtDecl * extDecl;
982 struct Attribute * attribute;
983 struct Instantiation * instance;
984 struct MembersInit * membersInit;
985 struct MemberInit * memberInit;
986 struct ClassFunction * classFunction;
987 struct ClassDefinition * _class;
988 struct ClassDef * classDef;
989 struct PropertyDef * prop;
991 struct Symbol * symbol;
992 struct PropertyWatch * propertyWatch;
993 struct TemplateParameter * templateParameter;
994 struct TemplateArgument * templateArgument;
995 struct TemplateDatatype * templateDatatype;
996 struct DBTableEntry * dbtableEntry;
997 struct DBIndexItem * dbindexItem;
998 struct DBTableDef * dbtableDef;
999 } __attribute__ ((gcc_struct)) YYSTYPE;
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1005 struct Enumerator * prev;
1006 struct Enumerator * next;
1007 struct Location loc;
1008 struct Identifier * id;
1009 struct Expression * exp;
1010 } __attribute__ ((gcc_struct));
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1014 struct InitDeclarator
1016 struct InitDeclarator * prev;
1017 struct InitDeclarator * next;
1018 struct Location loc;
1019 struct Declarator * declarator;
1020 struct Initializer * initializer;
1021 } __attribute__ ((gcc_struct));
1023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1027 struct AsmField * prev;
1028 struct AsmField * next;
1029 struct Location loc;
1031 struct Expression * expression;
1032 } __attribute__ ((gcc_struct));
1034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1038 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1040 struct ClassFunction
1042 struct ClassFunction * prev;
1043 struct ClassFunction * next;
1044 struct Location loc;
1045 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1046 struct Declarator * declarator;
1047 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1048 struct Statement * body;
1049 struct __ecereNameSpace__ecere__com__Class * _class;
1050 struct __ecereNameSpace__ecere__sys__OldList attached;
1053 struct Symbol * propSet;
1054 unsigned int isVirtual;
1055 unsigned int isConstructor;
1056 unsigned int isDestructor;
1057 unsigned int dontMangle;
1060 } __attribute__ ((gcc_struct));
1062 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1066 struct MembersInit * prev;
1067 struct MembersInit * next;
1068 struct Location loc;
1072 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1073 struct ClassFunction * function;
1074 } __attribute__ ((gcc_struct));
1075 } __attribute__ ((gcc_struct));
1077 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1081 struct MemberInit * prev;
1082 struct MemberInit * next;
1083 struct Location loc;
1084 struct Location realLoc;
1085 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1086 struct Initializer * initializer;
1088 unsigned int variable;
1089 unsigned int takeOutExp;
1090 } __attribute__ ((gcc_struct));
1092 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1096 struct PropertyDef * prev;
1097 struct PropertyDef * next;
1098 struct Location loc;
1099 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1100 struct Declarator * declarator;
1101 struct Identifier * id;
1102 struct Statement * getStmt;
1103 struct Statement * setStmt;
1104 struct Statement * issetStmt;
1105 struct Symbol * symbol;
1106 unsigned int conversion;
1107 unsigned int isWatchable;
1108 struct Expression * category;
1109 } __attribute__ ((gcc_struct));
1111 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1113 struct PropertyWatch
1115 struct PropertyWatch * prev;
1116 struct PropertyWatch * next;
1117 struct Location loc;
1118 struct Statement * compound;
1119 struct __ecereNameSpace__ecere__sys__OldList * properties;
1120 unsigned int deleteWatch;
1121 } __attribute__ ((gcc_struct));
1123 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1127 struct ClassDef * prev;
1128 struct ClassDef * next;
1129 struct Location loc;
1133 struct Declaration * decl;
1134 struct ClassFunction * function;
1135 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1136 struct PropertyDef * propertyDef;
1137 struct PropertyWatch * propertyWatch;
1139 struct Identifier * defaultProperty;
1142 struct Identifier * id;
1143 struct Initializer * initializer;
1144 } __attribute__ ((gcc_struct));
1145 } __attribute__ ((gcc_struct));
1148 } __attribute__ ((gcc_struct));
1150 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1152 struct DBTableEntry;
1154 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1158 extern YYSTYPE yylval;
1160 extern struct Location yylloc;
1162 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1164 extern int returnCode;
1166 extern struct Expression * parsedExpression;
1168 extern unsigned int yydebug;
1170 void SetYydebug(unsigned int b)
1175 extern unsigned int echoOn;
1177 void resetScanner();
1181 int expression_yyparse();
1183 static struct Statement * curCompound;
1185 struct External * curExternal, * afterExternal;
1187 static struct Type * curSwitchType;
1189 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1191 struct __ecereNameSpace__ecere__com__Class * thisClass;
1193 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1198 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1203 static char * thisNameSpace;
1205 struct __ecereNameSpace__ecere__com__Class * containerClass;
1207 unsigned int thisClassParams = 0x1;
1209 unsigned int internalValueCounter;
1211 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1213 extern size_t strlen(const char * );
1215 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1217 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1219 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1221 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1223 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1225 void PrintExpression(struct Expression * exp, char * string)
1228 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1232 OutputExpression(exp, f);
1233 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1234 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1236 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1237 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1238 count = strlen(string);
1239 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1240 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1242 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1243 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1244 string[count] = '\0';
1245 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1249 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1251 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1253 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1255 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1257 if(!param->baseType)
1259 if(param->dataTypeString)
1260 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1262 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1264 return param->baseType;
1266 return (((void *)0));
1269 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1271 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1273 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1277 if(type1->kind == type2->kind)
1288 if(type1->passAsTemplate && !type2->passAsTemplate)
1290 return type1->isSigned != type2->isSigned;
1292 return type1->_class != type2->_class;
1294 return NeedCast(type1->type, type2->type);
1302 extern int strcmp(const char * , const char * );
1304 extern struct Context * curContext;
1306 extern struct Context * topContext;
1308 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1310 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);
1312 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1314 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);
1316 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);
1318 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1320 struct __ecereNameSpace__ecere__com__ClassProperty
1323 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1324 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1325 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1327 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1328 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1329 char * dataTypeString;
1330 struct Type * dataType;
1331 unsigned int constant;
1332 } __attribute__ ((gcc_struct));
1334 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1336 extern struct Expression * QMkExpId(char * id);
1338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1340 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1342 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1343 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1348 char * dataTypeString;
1350 } __attribute__ ((gcc_struct));
1351 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1353 } __attribute__ ((gcc_struct));
1355 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1357 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1359 extern void FreeIdentifier(struct Identifier * id);
1361 void ProcessExpressionType(struct Expression * exp);
1363 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1365 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1367 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1369 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1371 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1373 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1375 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1377 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1379 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1381 if(exp->type == 0 && exp->identifier)
1383 struct Identifier * id = exp->identifier;
1384 struct Context * ctx;
1385 struct Symbol * symbol = (((void *)0));
1387 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1389 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1391 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1396 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1398 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1399 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1400 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1401 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1405 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1407 if(!prop && !method)
1408 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1409 if(!prop && !method && !member)
1411 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1413 if(prop || method || member || classProp)
1416 exp->member.member = id;
1417 exp->member.memberType = 0;
1418 exp->member.exp = QMkExpId("this");
1419 exp->addedThis = 0x1;
1421 else if(_class && _class->templateParams.first)
1423 struct __ecereNameSpace__ecere__com__Class * sClass;
1425 for(sClass = _class; sClass; sClass = sClass->base)
1427 if(sClass->templateParams.first)
1429 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1431 for(param = sClass->templateParams.first; param; param = param->next)
1433 if(param->type == 2 && !strcmp(param->name, id->string))
1435 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1439 struct Declarator * decl;
1440 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1442 FreeIdentifier(exp->member.member);
1443 ProcessExpressionType(argExp);
1444 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1445 exp->expType = ProcessType(specs, decl);
1447 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1458 extern int sprintf(char * , char * , ...);
1460 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1462 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1464 char * PrintInt(long long result)
1468 if(result > (((long long)0x7fffffffffffffffLL)))
1469 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1471 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1472 return __ecereNameSpace__ecere__sys__CopyString(temp);
1475 char * PrintUInt(uint64 result)
1479 if(result > (0xffffffff))
1480 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1481 else if(result > (((int)0x7fffffff)))
1482 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1484 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1485 return __ecereNameSpace__ecere__sys__CopyString(temp);
1488 char * PrintInt64(long long result)
1492 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1493 return __ecereNameSpace__ecere__sys__CopyString(temp);
1496 char * PrintUInt64(uint64 result)
1500 if(result > (((long long)0x7fffffffffffffffLL)))
1501 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1503 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1504 return __ecereNameSpace__ecere__sys__CopyString(temp);
1507 char * PrintHexUInt(uint64 result)
1511 if(result > (0xffffffff))
1512 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1515 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 char * PrintHexUInt64(uint64 result)
1522 if(result > (0xffffffff))
1523 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1525 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1526 return __ecereNameSpace__ecere__sys__CopyString(temp);
1529 char * PrintShort(short result)
1533 sprintf(temp, "%d", (unsigned short)result);
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1537 char * PrintUShort(unsigned short result)
1541 if(result > (unsigned short)32767)
1542 sprintf(temp, "0x%X", (int)result);
1544 sprintf(temp, "%d", (int)result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 extern int isprint(int c);
1550 char * PrintChar(char result)
1554 if(result > (char)0 && isprint(result))
1555 sprintf(temp, "'%c'", result);
1556 else if(result < (char)0)
1557 sprintf(temp, "%d", (int)result);
1559 sprintf(temp, "0x%X", (unsigned char)result);
1560 return __ecereNameSpace__ecere__sys__CopyString(temp);
1563 char * PrintUChar(unsigned char result)
1567 sprintf(temp, "0x%X", result);
1568 return __ecereNameSpace__ecere__sys__CopyString(temp);
1571 char * PrintFloat(float result)
1575 sprintf(temp, "%.16ff", result);
1576 return __ecereNameSpace__ecere__sys__CopyString(temp);
1579 char * PrintDouble(double result)
1583 sprintf(temp, "%.16f", result);
1584 return __ecereNameSpace__ecere__sys__CopyString(temp);
1587 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1591 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* Neg)(struct Expression *, struct Operand *);
1597 unsigned int (* Inc)(struct Expression *, struct Operand *);
1598 unsigned int (* Dec)(struct Expression *, struct Operand *);
1599 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1600 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1611 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1612 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (* Not)(struct Expression *, struct Operand *);
1617 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1618 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1624 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1626 } __attribute__ ((gcc_struct));
1628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1634 unsigned int ptrSize;
1647 } __attribute__ ((gcc_struct));
1649 } __attribute__ ((gcc_struct));
1651 struct Operand GetOperand(struct Expression * exp);
1653 unsigned int GetInt(struct Expression * exp, int * value2)
1655 struct Operand op2 = GetOperand(exp);
1657 if(op2.kind == 3 && op2.type->isSigned)
1659 else if(op2.kind == 3)
1660 *value2 = (int)op2.ui;
1661 else if(op2.kind == 4 && op2.type->isSigned)
1662 *value2 = (int)op2.i64;
1663 else if(op2.kind == 4)
1664 *value2 = (int)op2.ui64;
1665 else if(op2.kind == 23 && op2.type->isSigned)
1666 *value2 = (int)op2.i64;
1667 else if(op2.kind == 23)
1668 *value2 = (int)op2.ui64;
1669 else if(op2.kind == 22 && op2.type->isSigned)
1670 *value2 = (int)op2.i64;
1671 else if(op2.kind == 22)
1672 *value2 = (int)op2.ui64;
1673 else if(op2.kind == 2 && op2.type->isSigned)
1674 *value2 = (int)op2.s;
1675 else if(op2.kind == 2)
1676 *value2 = (int)op2.us;
1677 else if(op2.kind == 1 && op2.type->isSigned)
1678 *value2 = (int)op2.c;
1679 else if(op2.kind == 24 || op2.kind == 1)
1680 *value2 = (int)op2.uc;
1681 else if(op2.kind == 6)
1682 *value2 = (int)op2.f;
1683 else if(op2.kind == 7)
1684 *value2 = (int)op2.d;
1685 else if(op2.kind == 13)
1686 *value2 = (int)op2.ui64;
1692 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1694 struct Operand op2 = GetOperand(exp);
1696 if(op2.kind == 3 && op2.type->isSigned)
1697 *value2 = (unsigned int)op2.i;
1698 else if(op2.kind == 3)
1700 else if(op2.kind == 4 && op2.type->isSigned)
1701 *value2 = (unsigned int)op2.i64;
1702 else if(op2.kind == 4)
1703 *value2 = (unsigned int)op2.ui64;
1704 else if(op2.kind == 23 && op2.type->isSigned)
1705 *value2 = (unsigned int)op2.i64;
1706 else if(op2.kind == 23)
1707 *value2 = (unsigned int)op2.ui64;
1708 else if(op2.kind == 22 && op2.type->isSigned)
1709 *value2 = (unsigned int)op2.i64;
1710 else if(op2.kind == 22)
1711 *value2 = (unsigned int)op2.ui64;
1712 else if(op2.kind == 2 && op2.type->isSigned)
1713 *value2 = (unsigned int)op2.s;
1714 else if(op2.kind == 2)
1715 *value2 = (unsigned int)op2.us;
1716 else if(op2.kind == 1 && op2.type->isSigned)
1717 *value2 = (unsigned int)op2.c;
1718 else if(op2.kind == 24 || op2.kind == 1)
1719 *value2 = (unsigned int)op2.uc;
1720 else if(op2.kind == 6)
1721 *value2 = (unsigned int)op2.f;
1722 else if(op2.kind == 7)
1723 *value2 = (unsigned int)op2.d;
1724 else if(op2.kind == 13)
1725 *value2 = (unsigned int)op2.ui64;
1731 unsigned int GetInt64(struct Expression * exp, long long * value2)
1733 struct Operand op2 = GetOperand(exp);
1735 if(op2.kind == 3 && op2.type->isSigned)
1736 *value2 = (long long)op2.i;
1737 else if(op2.kind == 3)
1738 *value2 = (long long)op2.ui;
1739 else if(op2.kind == 4 && op2.type->isSigned)
1741 else if(op2.kind == 4)
1742 *value2 = (long long)op2.ui64;
1743 else if(op2.kind == 23 && op2.type->isSigned)
1745 else if(op2.kind == 23)
1746 *value2 = (long long)op2.ui64;
1747 else if(op2.kind == 22 && op2.type->isSigned)
1749 else if(op2.kind == 22)
1750 *value2 = (long long)op2.ui64;
1751 else if(op2.kind == 2 && op2.type->isSigned)
1752 *value2 = (long long)op2.s;
1753 else if(op2.kind == 2)
1754 *value2 = (long long)op2.us;
1755 else if(op2.kind == 1 && op2.type->isSigned)
1756 *value2 = (long long)op2.c;
1757 else if(op2.kind == 24 || op2.kind == 1)
1758 *value2 = (long long)op2.uc;
1759 else if(op2.kind == 6)
1760 *value2 = (long long)op2.f;
1761 else if(op2.kind == 7)
1762 *value2 = (long long)op2.d;
1763 else if(op2.kind == 13)
1764 *value2 = (long long)op2.ui64;
1770 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1772 struct Operand op2 = GetOperand(exp);
1774 if(op2.kind == 3 && op2.type->isSigned)
1775 *value2 = (uint64)op2.i;
1776 else if(op2.kind == 3)
1777 *value2 = (uint64)op2.ui;
1778 else if(op2.kind == 4 && op2.type->isSigned)
1779 *value2 = (uint64)op2.i64;
1780 else if(op2.kind == 4)
1782 else if(op2.kind == 23 && op2.type->isSigned)
1783 *value2 = (uint64)op2.i64;
1784 else if(op2.kind == 23)
1786 else if(op2.kind == 22 && op2.type->isSigned)
1787 *value2 = (uint64)op2.i64;
1788 else if(op2.kind == 22)
1790 else if(op2.kind == 2 && op2.type->isSigned)
1791 *value2 = (uint64)op2.s;
1792 else if(op2.kind == 2)
1793 *value2 = (uint64)op2.us;
1794 else if(op2.kind == 1 && op2.type->isSigned)
1795 *value2 = (uint64)op2.c;
1796 else if(op2.kind == 24 || op2.kind == 1)
1797 *value2 = (uint64)op2.uc;
1798 else if(op2.kind == 6)
1799 *value2 = (uint64)op2.f;
1800 else if(op2.kind == 7)
1801 *value2 = (uint64)op2.d;
1802 else if(op2.kind == 13)
1809 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1811 struct Operand op2 = GetOperand(exp);
1813 if(op2.kind == 3 && op2.type->isSigned)
1814 *value2 = (intptr_t)op2.i;
1815 else if(op2.kind == 3)
1816 *value2 = (intptr_t)op2.ui;
1817 else if(op2.kind == 4 && op2.type->isSigned)
1818 *value2 = (intptr_t)op2.i64;
1819 else if(op2.kind == 4)
1820 *value2 = (intptr_t)op2.ui64;
1821 else if(op2.kind == 23 && op2.type->isSigned)
1822 *value2 = (intptr_t)op2.i64;
1823 else if(op2.kind == 23)
1824 *value2 = (intptr_t)op2.ui64;
1825 else if(op2.kind == 22 && op2.type->isSigned)
1826 *value2 = (intptr_t)op2.i64;
1827 else if(op2.kind == 22)
1828 *value2 = (intptr_t)op2.ui64;
1829 else if(op2.kind == 2 && op2.type->isSigned)
1830 *value2 = (intptr_t)op2.s;
1831 else if(op2.kind == 2)
1832 *value2 = (intptr_t)op2.us;
1833 else if(op2.kind == 1 && op2.type->isSigned)
1834 *value2 = (intptr_t)op2.c;
1835 else if(op2.kind == 24 || op2.kind == 1)
1836 *value2 = (intptr_t)op2.uc;
1837 else if(op2.kind == 6)
1838 *value2 = (intptr_t)op2.f;
1839 else if(op2.kind == 7)
1840 *value2 = (intptr_t)op2.d;
1841 else if(op2.kind == 13)
1842 *value2 = (intptr_t)op2.ui64;
1848 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1850 struct Operand op2 = GetOperand(exp);
1852 if(op2.kind == 3 && op2.type->isSigned)
1853 *value2 = (uintptr_t)op2.i;
1854 else if(op2.kind == 3)
1855 *value2 = (uintptr_t)op2.ui;
1856 else if(op2.kind == 4 && op2.type->isSigned)
1857 *value2 = (uintptr_t)op2.i64;
1858 else if(op2.kind == 4)
1859 *value2 = (uintptr_t)op2.ui64;
1860 else if(op2.kind == 23 && op2.type->isSigned)
1861 *value2 = (uintptr_t)op2.i64;
1862 else if(op2.kind == 23)
1863 *value2 = (uintptr_t)op2.ui64;
1864 else if(op2.kind == 22 && op2.type->isSigned)
1865 *value2 = (uintptr_t)op2.i64;
1866 else if(op2.kind == 22)
1867 *value2 = (uintptr_t)op2.ui64;
1868 else if(op2.kind == 2 && op2.type->isSigned)
1869 *value2 = (uintptr_t)op2.s;
1870 else if(op2.kind == 2)
1871 *value2 = (uintptr_t)op2.us;
1872 else if(op2.kind == 1 && op2.type->isSigned)
1873 *value2 = (uintptr_t)op2.c;
1874 else if(op2.kind == 24 || op2.kind == 1)
1875 *value2 = (uintptr_t)op2.uc;
1876 else if(op2.kind == 6)
1877 *value2 = (uintptr_t)op2.f;
1878 else if(op2.kind == 7)
1879 *value2 = (uintptr_t)op2.d;
1880 else if(op2.kind == 13)
1881 *value2 = (uintptr_t)op2.ui64;
1887 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1889 struct Operand op2 = GetOperand(exp);
1891 if(op2.kind == 3 && op2.type->isSigned)
1892 *value2 = (ssize_t)op2.i;
1893 else if(op2.kind == 3)
1894 *value2 = (ssize_t)op2.ui;
1895 else if(op2.kind == 4 && op2.type->isSigned)
1896 *value2 = (ssize_t)op2.i64;
1897 else if(op2.kind == 4)
1898 *value2 = (ssize_t)op2.ui64;
1899 else if(op2.kind == 23 && op2.type->isSigned)
1900 *value2 = (ssize_t)op2.i64;
1901 else if(op2.kind == 23)
1902 *value2 = (ssize_t)op2.ui64;
1903 else if(op2.kind == 22 && op2.type->isSigned)
1904 *value2 = (ssize_t)op2.i64;
1905 else if(op2.kind == 22)
1906 *value2 = (ssize_t)op2.ui64;
1907 else if(op2.kind == 2 && op2.type->isSigned)
1908 *value2 = (ssize_t)op2.s;
1909 else if(op2.kind == 2)
1910 *value2 = (ssize_t)op2.us;
1911 else if(op2.kind == 1 && op2.type->isSigned)
1912 *value2 = (ssize_t)op2.c;
1913 else if(op2.kind == 24 || op2.kind == 1)
1914 *value2 = (ssize_t)op2.uc;
1915 else if(op2.kind == 6)
1916 *value2 = (ssize_t)op2.f;
1917 else if(op2.kind == 7)
1918 *value2 = (ssize_t)op2.d;
1919 else if(op2.kind == 13)
1920 *value2 = (ssize_t)op2.ui64;
1926 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1928 struct Operand op2 = GetOperand(exp);
1930 if(op2.kind == 3 && op2.type->isSigned)
1931 *value2 = (size_t)op2.i;
1932 else if(op2.kind == 3)
1933 *value2 = (size_t)op2.ui;
1934 else if(op2.kind == 4 && op2.type->isSigned)
1935 *value2 = (size_t)op2.i64;
1936 else if(op2.kind == 4)
1937 *value2 = (size_t)op2.ui64;
1938 else if(op2.kind == 23 && op2.type->isSigned)
1939 *value2 = (size_t)op2.i64;
1940 else if(op2.kind == 23)
1941 *value2 = (size_t)op2.ui64;
1942 else if(op2.kind == 22 && op2.type->isSigned)
1943 *value2 = (size_t)op2.i64;
1944 else if(op2.kind == 22)
1945 *value2 = (size_t)op2.ui64;
1946 else if(op2.kind == 2 && op2.type->isSigned)
1947 *value2 = (size_t)op2.s;
1948 else if(op2.kind == 2)
1949 *value2 = (size_t)op2.us;
1950 else if(op2.kind == 1 && op2.type->isSigned)
1951 *value2 = (size_t)op2.c;
1952 else if(op2.kind == 24 || op2.kind == 1)
1953 *value2 = (size_t)op2.uc;
1954 else if(op2.kind == 6)
1955 *value2 = (size_t)op2.f;
1956 else if(op2.kind == 7)
1957 *value2 = (size_t)op2.d;
1958 else if(op2.kind == 13)
1959 *value2 = (size_t)op2.ui64;
1965 unsigned int GetShort(struct Expression * exp, short * value2)
1967 struct Operand op2 = GetOperand(exp);
1969 if(op2.kind == 3 && op2.type->isSigned)
1970 *value2 = (short)op2.i;
1971 else if(op2.kind == 3)
1972 *value2 = (short)op2.ui;
1973 else if(op2.kind == 4 && op2.type->isSigned)
1974 *value2 = (short)op2.i64;
1975 else if(op2.kind == 4)
1976 *value2 = (short)op2.ui64;
1977 else if(op2.kind == 23 && op2.type->isSigned)
1978 *value2 = (short)op2.i64;
1979 else if(op2.kind == 23)
1980 *value2 = (short)op2.ui64;
1981 else if(op2.kind == 22 && op2.type->isSigned)
1982 *value2 = (short)op2.i64;
1983 else if(op2.kind == 22)
1984 *value2 = (short)op2.ui64;
1985 else if(op2.kind == 2 && op2.type->isSigned)
1987 else if(op2.kind == 2)
1988 *value2 = (short)op2.us;
1989 else if(op2.kind == 1 && op2.type->isSigned)
1990 *value2 = (short)op2.c;
1991 else if(op2.kind == 24 || op2.kind == 1)
1992 *value2 = (short)op2.uc;
1993 else if(op2.kind == 6)
1994 *value2 = (short)op2.f;
1995 else if(op2.kind == 7)
1996 *value2 = (short)op2.d;
1997 else if(op2.kind == 13)
1998 *value2 = (short)op2.ui64;
2004 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2006 struct Operand op2 = GetOperand(exp);
2008 if(op2.kind == 3 && op2.type->isSigned)
2009 *value2 = (unsigned short)op2.i;
2010 else if(op2.kind == 3)
2011 *value2 = (unsigned short)op2.ui;
2012 else if(op2.kind == 4 && op2.type->isSigned)
2013 *value2 = (unsigned short)op2.i64;
2014 else if(op2.kind == 4)
2015 *value2 = (unsigned short)op2.ui64;
2016 else if(op2.kind == 23 && op2.type->isSigned)
2017 *value2 = (unsigned short)op2.i64;
2018 else if(op2.kind == 23)
2019 *value2 = (unsigned short)op2.ui64;
2020 else if(op2.kind == 22 && op2.type->isSigned)
2021 *value2 = (unsigned short)op2.i64;
2022 else if(op2.kind == 22)
2023 *value2 = (unsigned short)op2.ui64;
2024 else if(op2.kind == 2 && op2.type->isSigned)
2025 *value2 = (unsigned short)op2.s;
2026 else if(op2.kind == 2)
2028 else if(op2.kind == 1 && op2.type->isSigned)
2029 *value2 = (unsigned short)op2.c;
2030 else if(op2.kind == 24 || op2.kind == 1)
2031 *value2 = (unsigned short)op2.uc;
2032 else if(op2.kind == 6)
2033 *value2 = (unsigned short)op2.f;
2034 else if(op2.kind == 7)
2035 *value2 = (unsigned short)op2.d;
2036 else if(op2.kind == 13)
2037 *value2 = (unsigned short)op2.ui64;
2043 unsigned int GetChar(struct Expression * exp, char * value2)
2045 struct Operand op2 = GetOperand(exp);
2047 if(op2.kind == 3 && op2.type->isSigned)
2048 *value2 = (char)op2.i;
2049 else if(op2.kind == 3)
2050 *value2 = (char)op2.ui;
2051 else if(op2.kind == 4 && op2.type->isSigned)
2052 *value2 = (char)op2.i64;
2053 else if(op2.kind == 4)
2054 *value2 = (char)op2.ui64;
2055 else if(op2.kind == 23 && op2.type->isSigned)
2056 *value2 = (char)op2.i64;
2057 else if(op2.kind == 23)
2058 *value2 = (char)op2.ui64;
2059 else if(op2.kind == 22 && op2.type->isSigned)
2060 *value2 = (char)op2.i64;
2061 else if(op2.kind == 22)
2062 *value2 = (char)op2.ui64;
2063 else if(op2.kind == 2 && op2.type->isSigned)
2064 *value2 = (char)op2.s;
2065 else if(op2.kind == 2)
2066 *value2 = (char)op2.us;
2067 else if(op2.kind == 1 && op2.type->isSigned)
2069 else if(op2.kind == 24 || op2.kind == 1)
2070 *value2 = (char)op2.uc;
2071 else if(op2.kind == 6)
2072 *value2 = (char)op2.f;
2073 else if(op2.kind == 7)
2074 *value2 = (char)op2.d;
2075 else if(op2.kind == 13)
2076 *value2 = (char)op2.ui64;
2082 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2084 struct Operand op2 = GetOperand(exp);
2086 if(op2.kind == 3 && op2.type->isSigned)
2087 *value2 = (unsigned char)op2.i;
2088 else if(op2.kind == 3)
2089 *value2 = (unsigned char)op2.ui;
2090 else if(op2.kind == 4 && op2.type->isSigned)
2091 *value2 = (unsigned char)op2.i64;
2092 else if(op2.kind == 4)
2093 *value2 = (unsigned char)op2.ui64;
2094 else if(op2.kind == 23 && op2.type->isSigned)
2095 *value2 = (unsigned char)op2.i64;
2096 else if(op2.kind == 23)
2097 *value2 = (unsigned char)op2.ui64;
2098 else if(op2.kind == 22 && op2.type->isSigned)
2099 *value2 = (unsigned char)op2.i64;
2100 else if(op2.kind == 22)
2101 *value2 = (unsigned char)op2.ui64;
2102 else if(op2.kind == 2 && op2.type->isSigned)
2103 *value2 = (unsigned char)op2.s;
2104 else if(op2.kind == 2)
2105 *value2 = (unsigned char)op2.us;
2106 else if(op2.kind == 1 && op2.type->isSigned)
2107 *value2 = (unsigned char)op2.c;
2108 else if(op2.kind == 24 || op2.kind == 1)
2110 else if(op2.kind == 6)
2111 *value2 = (unsigned char)op2.f;
2112 else if(op2.kind == 7)
2113 *value2 = (unsigned char)op2.d;
2114 else if(op2.kind == 13)
2115 *value2 = (unsigned char)op2.ui64;
2121 unsigned int GetFloat(struct Expression * exp, float * value2)
2123 struct Operand op2 = GetOperand(exp);
2125 if(op2.kind == 3 && op2.type->isSigned)
2126 *value2 = (float)(float)op2.i;
2127 else if(op2.kind == 3)
2128 *value2 = (float)(float)op2.ui;
2129 else if(op2.kind == 4 && op2.type->isSigned)
2130 *value2 = (float)(float)op2.i64;
2131 else if(op2.kind == 4)
2132 *value2 = (float)(float)op2.ui64;
2133 else if(op2.kind == 23 && op2.type->isSigned)
2134 *value2 = (float)(float)op2.i64;
2135 else if(op2.kind == 23)
2136 *value2 = (float)(float)op2.ui64;
2137 else if(op2.kind == 22 && op2.type->isSigned)
2138 *value2 = (float)(float)op2.i64;
2139 else if(op2.kind == 22)
2140 *value2 = (float)(float)op2.ui64;
2141 else if(op2.kind == 2 && op2.type->isSigned)
2142 *value2 = (float)(float)op2.s;
2143 else if(op2.kind == 2)
2144 *value2 = (float)(float)op2.us;
2145 else if(op2.kind == 1 && op2.type->isSigned)
2146 *value2 = (float)(float)op2.c;
2147 else if(op2.kind == 24 || op2.kind == 1)
2148 *value2 = (float)(float)op2.uc;
2149 else if(op2.kind == 6)
2150 *value2 = (float)op2.f;
2151 else if(op2.kind == 7)
2152 *value2 = (float)op2.d;
2153 else if(op2.kind == 13)
2154 *value2 = (float)(float)op2.ui64;
2160 unsigned int GetDouble(struct Expression * exp, double * value2)
2162 struct Operand op2 = GetOperand(exp);
2164 if(op2.kind == 3 && op2.type->isSigned)
2165 *value2 = (double)(double)op2.i;
2166 else if(op2.kind == 3)
2167 *value2 = (double)(double)op2.ui;
2168 else if(op2.kind == 4 && op2.type->isSigned)
2169 *value2 = (double)(double)op2.i64;
2170 else if(op2.kind == 4)
2171 *value2 = (double)(double)op2.ui64;
2172 else if(op2.kind == 23 && op2.type->isSigned)
2173 *value2 = (double)(double)op2.i64;
2174 else if(op2.kind == 23)
2175 *value2 = (double)(double)op2.ui64;
2176 else if(op2.kind == 22 && op2.type->isSigned)
2177 *value2 = (double)(double)op2.i64;
2178 else if(op2.kind == 22)
2179 *value2 = (double)(double)op2.ui64;
2180 else if(op2.kind == 2 && op2.type->isSigned)
2181 *value2 = (double)(double)op2.s;
2182 else if(op2.kind == 2)
2183 *value2 = (double)(double)op2.us;
2184 else if(op2.kind == 1 && op2.type->isSigned)
2185 *value2 = (double)(double)op2.c;
2186 else if(op2.kind == 24 || op2.kind == 1)
2187 *value2 = (double)(double)op2.uc;
2188 else if(op2.kind == 6)
2189 *value2 = (double)op2.f;
2190 else if(op2.kind == 7)
2191 *value2 = (double)op2.d;
2192 else if(op2.kind == 13)
2193 *value2 = (double)(double)op2.ui64;
2199 void ComputeExpression(struct Expression * exp);
2201 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2203 extern int targetBits;
2205 int ComputeTypeSize(struct Type * type);
2207 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2209 struct __ecereNameSpace__ecere__com__BitMember
2211 struct __ecereNameSpace__ecere__com__BitMember * prev;
2212 struct __ecereNameSpace__ecere__com__BitMember * next;
2214 unsigned int isProperty;
2217 struct __ecereNameSpace__ecere__com__Class * _class;
2218 char * dataTypeString;
2219 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2220 struct Type * dataType;
2225 } __attribute__ ((gcc_struct));
2227 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2229 struct __ecereNameSpace__ecere__sys__OldLink
2231 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2232 struct __ecereNameSpace__ecere__sys__OldLink * next;
2234 } __attribute__ ((gcc_struct));
2236 void FinishTemplatesContext(struct Context * context);
2238 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2240 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2241 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2243 if(member || ((_class->type == 2 || _class->type == 0 || _class->type == 1 || _class->type == 5) && (_class->type == 2 || (!_class->structSize || _class->structSize == _class->offset)) && _class->computeSize))
2246 int unionMemberOffset = 0;
2251 member->memberOffset = 0;
2252 if(targetBits < sizeof(void *) * 8)
2253 member->structAlignment = 0;
2255 else if(targetBits < sizeof(void *) * 8)
2256 _class->structAlignment = 0;
2257 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2258 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2259 if(!member && _class->destructionWatchOffset)
2260 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2262 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2264 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2266 if(!dataMember->isProperty)
2268 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2270 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2276 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2278 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2280 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2282 if(!isMember && _class->type == 2 && dataMember->dataType)
2284 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2288 ComputeTypeSize(dataMember->dataType);
2289 if(bitMember->pos == -1)
2290 bitMember->pos = _class->memberOffset;
2291 if(!bitMember->size)
2292 bitMember->size = dataMember->dataType->size * 8;
2293 _class->memberOffset = bitMember->pos + bitMember->size;
2294 for(d = 0; d < bitMember->size; d++)
2300 bitMember->mask = mask << bitMember->pos;
2302 else if(dataMember->type == 0 && dataMember->dataType)
2307 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2308 ComputeTypeSize(dataMember->dataType);
2309 if(dataMember->dataType->bitFieldCount)
2311 bitFields += dataMember->dataType->bitFieldCount;
2318 int size = (bitFields + 7) / 8;
2322 int __simpleStruct0;
2326 int __simpleStruct0;
2328 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2329 if(member->memberOffset % alignment)
2330 member->memberOffset += alignment - (member->memberOffset % alignment);
2332 dataMember->offset = member->memberOffset;
2333 if(member->type == 1)
2334 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2337 member->memberOffset += size;
2344 int __simpleStruct0;
2346 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2347 if(_class->memberOffset % alignment)
2348 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2350 dataMember->offset = _class->memberOffset;
2351 _class->memberOffset += size;
2355 size = dataMember->dataType->size;
2356 alignment = dataMember->dataType->alignment;
2360 int __simpleStruct0;
2364 int __simpleStruct0;
2366 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2367 if(member->memberOffset % alignment)
2368 member->memberOffset += alignment - (member->memberOffset % alignment);
2370 dataMember->offset = member->memberOffset;
2371 if(member->type == 1)
2372 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2375 member->memberOffset += size;
2382 int __simpleStruct0;
2384 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2385 if(_class->memberOffset % alignment)
2386 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2388 dataMember->offset = _class->memberOffset;
2389 _class->memberOffset += size;
2396 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2397 alignment = dataMember->structAlignment;
2400 int __simpleStruct0;
2404 int __simpleStruct0;
2406 if(member->memberOffset % alignment)
2407 member->memberOffset += alignment - (member->memberOffset % alignment);
2408 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2410 dataMember->offset = member->memberOffset;
2411 if(member->type == 1)
2412 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2414 member->memberOffset += dataMember->memberOffset;
2420 int __simpleStruct0;
2422 if(_class->memberOffset % alignment)
2423 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2424 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2426 dataMember->offset = _class->memberOffset;
2427 _class->memberOffset += dataMember->memberOffset;
2435 int size = (bitFields + 7) / 8;
2439 int __simpleStruct0;
2443 int __simpleStruct0;
2445 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2446 if(member->memberOffset % alignment)
2447 member->memberOffset += alignment - (member->memberOffset % alignment);
2449 if(member->type == 1)
2450 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2453 member->memberOffset += size;
2460 int __simpleStruct0;
2462 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2463 if(_class->memberOffset % alignment)
2464 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2466 _class->memberOffset += size;
2471 if(member && member->type == 1)
2473 member->memberOffset = unionMemberOffset;
2477 if(_class->type != 2)
2481 if(_class->structAlignment)
2483 if(_class->memberOffset % _class->structAlignment)
2484 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2486 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2489 struct __ecereNameSpace__ecere__com__Property * prop;
2491 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2493 if(prop->isProperty && prop->isWatchable)
2495 prop->watcherOffset = _class->structSize;
2496 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2501 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2503 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2505 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2507 if(deriv->computeSize)
2509 deriv->offset = _class->structSize;
2510 deriv->memberOffset = 0;
2511 deriv->structSize = deriv->offset;
2512 ComputeClassMembers(deriv, 0x0);
2520 FinishTemplatesContext(context);
2523 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2525 struct __ecereNameSpace__ecere__com__NameSpace
2528 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2529 struct __ecereNameSpace__ecere__com__NameSpace * left;
2530 struct __ecereNameSpace__ecere__com__NameSpace * right;
2532 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2533 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2534 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2535 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2536 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2537 } __attribute__ ((gcc_struct));
2539 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2541 struct __ecereNameSpace__ecere__com__Module
2543 struct __ecereNameSpace__ecere__com__Instance * application;
2544 struct __ecereNameSpace__ecere__sys__OldList classes;
2545 struct __ecereNameSpace__ecere__sys__OldList defines;
2546 struct __ecereNameSpace__ecere__sys__OldList functions;
2547 struct __ecereNameSpace__ecere__sys__OldList modules;
2548 struct __ecereNameSpace__ecere__com__Instance * prev;
2549 struct __ecereNameSpace__ecere__com__Instance * next;
2555 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2556 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2557 } __attribute__ ((gcc_struct));
2559 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2561 struct __ecereNameSpace__ecere__com__Class * _class;
2562 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2564 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2565 ComputeModuleClasses(subModule->data);
2566 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2567 ComputeClassMembers(_class, 0x0);
2570 extern unsigned int inCompiler;
2572 extern void Compiler_Error(char * format, ...);
2574 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2576 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2578 int ComputeTypeSize(struct Type * type)
2580 unsigned int size = type ? type->size : 0;
2582 if(!size && type && !type->computing)
2584 type->computing = 0x1;
2588 type->alignment = size = sizeof(char);
2591 type->alignment = size = sizeof(char);
2594 type->alignment = size = sizeof(int);
2597 type->alignment = size = sizeof(long long);
2600 type->alignment = size = targetBits / 8;
2603 type->alignment = size = targetBits / 8;
2606 type->alignment = size = sizeof(long);
2609 type->alignment = size = sizeof(short);
2612 type->alignment = size = sizeof(float);
2615 type->alignment = size = sizeof(double);
2619 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2621 if(_class && _class->type == 1)
2623 ComputeClassMembers(_class, 0x0);
2624 type->alignment = _class->structAlignment;
2625 size = _class->structSize;
2626 if(type->alignment && size % type->alignment)
2627 size += type->alignment - (size % type->alignment);
2629 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2631 if(!_class->dataType)
2632 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2633 size = type->alignment = ComputeTypeSize(_class->dataType);
2636 size = type->alignment = targetBits / 8;
2641 size = type->alignment = targetBits / 8;
2644 if(type->arraySizeExp)
2646 ProcessExpressionType(type->arraySizeExp);
2647 ComputeExpression(type->arraySizeExp);
2648 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)))
2650 struct Location oldLoc = yylloc;
2651 char expression[10240];
2653 expression[0] = '\0';
2654 type->arraySizeExp->expType = (((void *)0));
2655 yylloc = type->arraySizeExp->loc;
2657 PrintExpression(type->arraySizeExp, expression);
2658 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2661 GetInt(type->arraySizeExp, &type->arraySize);
2663 else if(type->enumClass)
2665 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2667 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2670 type->arraySize = 0;
2674 type->arraySize = 0;
2676 size = ComputeTypeSize(type->type) * type->arraySize;
2678 type->alignment = type->type->alignment;
2682 struct Type * member;
2684 for(member = type->members.first; member; member = member->next)
2686 int __simpleStruct0, __simpleStruct1;
2687 unsigned int addSize = ComputeTypeSize(member);
2689 member->offset = size;
2690 if(member->alignment && size % member->alignment)
2691 member->offset += member->alignment - (size % member->alignment);
2692 size = member->offset;
2693 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2696 if(type->alignment && size % type->alignment)
2697 size += type->alignment - (size % type->alignment);
2702 struct Type * member;
2704 for(member = type->members.first; member; member = member->next)
2706 int __simpleStruct0, __simpleStruct1;
2707 unsigned int addSize = ComputeTypeSize(member);
2709 member->offset = size;
2710 if(member->alignment && size % member->alignment)
2711 member->offset += member->alignment - (size % member->alignment);
2712 size = member->offset;
2713 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2714 size = ((size > addSize) ? size : addSize);
2716 if(type->alignment && size % type->alignment)
2717 size += type->alignment - (size % type->alignment);
2722 struct TemplateParameter * param = type->templateParameter;
2723 struct Type * baseType = ProcessTemplateParameterType(param);
2727 size = ComputeTypeSize(baseType);
2728 type->alignment = baseType->alignment;
2731 type->alignment = size = sizeof(uint64);
2736 type->alignment = size = sizeof(enum
2744 type->alignment = size = targetBits / 8;
2749 type->computing = 0x0;
2754 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2756 extern struct Identifier * MkIdentifier(char * string);
2758 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2760 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2762 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2764 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2766 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2768 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2770 extern void FreeType(struct Type * type);
2772 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2774 extern struct Specifier * MkSpecifier(int specifier);
2776 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2778 extern struct Expression * MkExpConstant(char * string);
2780 int AddMembers(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember, unsigned int * retSize, struct __ecereNameSpace__ecere__com__Class * topClass, unsigned int * addedPadding)
2782 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2783 unsigned int totalSize = 0;
2784 unsigned int maxSize = 0;
2785 int alignment, size;
2786 struct __ecereNameSpace__ecere__com__DataMember * member;
2787 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2790 *addedPadding = 0x0;
2791 if(!isMember && _class->base)
2793 maxSize = _class->structSize;
2795 if(_class->type == 1 || _class->type == 5)
2796 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2799 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2801 if(maxSize > baseSize)
2802 maxSize -= baseSize;
2808 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2810 if(!member->isProperty)
2812 switch(member->type)
2816 if(member->dataTypeString)
2818 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2819 struct Declarator * decl;
2821 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2822 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2823 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2824 if(!member->dataType)
2825 member->dataType = ProcessType(specs, decl);
2826 ReplaceThisClassSpecifiers(specs, topClass);
2828 struct Type * type = ProcessType(specs, decl);
2830 DeclareType(member->dataType, 0x0, 0x0);
2833 ComputeTypeSize(member->dataType);
2834 size = member->dataType->size;
2835 alignment = member->dataType->alignment;
2838 if(totalSize % alignment)
2839 totalSize += alignment - (totalSize % alignment);
2848 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2851 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2852 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2853 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2854 alignment = member->structAlignment;
2857 if(totalSize % alignment)
2858 totalSize += alignment - (totalSize % alignment);
2868 unsigned int __simpleStruct0;
2870 if(topMember && topMember->type == 1)
2871 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2873 *retSize += totalSize;
2875 else if(totalSize < maxSize && _class->type != 1000)
2877 int autoPadding = 0;
2879 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2880 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2881 if(totalSize + autoPadding < maxSize)
2883 char sizeString[50];
2885 sprintf(sizeString, "%d", maxSize - totalSize);
2886 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2888 *addedPadding = 0x1;
2892 FinishTemplatesContext(context);
2893 return topMember ? topMember->memberID : _class->memberID;
2896 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2898 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2899 unsigned int totalSize = 0;
2900 struct __ecereNameSpace__ecere__com__DataMember * member;
2901 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2903 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2904 DeclareMembers(_class->base, 0x0);
2905 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2907 if(!member->isProperty)
2909 switch(member->type)
2913 if(!member->dataType && member->dataTypeString)
2914 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2915 if(member->dataType)
2916 DeclareType(member->dataType, 0x0, 0x0);
2922 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2929 FinishTemplatesContext(context);
2930 return topMember ? topMember->memberID : _class->memberID;
2933 extern struct Symbol * FindClass(char * name);
2935 extern char * strchr(const char * , int);
2937 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2939 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2941 extern void FreeClassDef(struct ClassDef * def);
2943 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2945 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2947 extern char * strcpy(char * , const char * );
2949 extern void MangleClassName(char * className);
2951 extern void DeclareClass(struct Symbol * classSym, char * className);
2953 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2955 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2957 void DeclareStruct(char * name, unsigned int skipNoHead)
2959 struct External * external = (((void *)0));
2960 struct Symbol * classSym = FindClass(name);
2962 if(!inCompiler || !classSym)
2964 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2966 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2968 struct Declaration * decl;
2969 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2970 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2971 char structName[1024];
2973 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2974 classSym->declaring++;
2975 if(strchr(classSym->string, '<'))
2977 if(classSym->registered->templateClass)
2979 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2980 classSym->declaring--;
2984 DeclareMembers(classSym->registered, 0x0);
2985 structName[0] = (char)0;
2986 FullClassNameCat(structName, name, 0x0);
2989 unsigned int addedPadding = 0x0;
2991 classSym->declaredStructSym = 0x1;
2992 declarations = MkList();
2993 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2994 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2996 FreeList(declarations, FreeClassDef);
2997 declarations = (((void *)0));
3000 if(skipNoHead || declarations)
3002 if(external && external->declaration)
3004 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3005 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3007 if(classSym->structExternal)
3008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3010 classSym->id = curExternal->symbol->idCode;
3011 classSym->idCode = curExternal->symbol->idCode;
3017 external = MkExternalDeclaration((((void *)0)));
3018 specifiers = MkList();
3019 declarators = MkList();
3020 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3021 external->declaration = decl = MkDeclaration(specifiers, declarators);
3022 if(decl->symbol && !decl->symbol->pointerExternal)
3023 decl->symbol->pointerExternal = external;
3024 if(classSym->registered && classSym->registered->type == 1)
3026 char className[1024];
3028 strcpy(className, "__ecereClass_");
3029 FullClassNameCat(className, classSym->string, 0x1);
3030 MangleClassName(className);
3031 DeclareClass(classSym, className);
3032 external->symbol = classSym;
3033 classSym->pointerExternal = external;
3034 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3035 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3039 char className[1024];
3041 strcpy(className, "__ecereClass_");
3042 FullClassNameCat(className, classSym->string, 0x1);
3043 MangleClassName(className);
3044 classSym->structExternal = external;
3045 DeclareClass(classSym, className);
3046 external->symbol = classSym;
3048 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3051 classSym->declaring--;
3053 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3055 classSym->declaring++;
3057 if(classSym->registered)
3058 DeclareMembers(classSym->registered, 0x0);
3060 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3062 if(classSym->structExternal)
3063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3065 classSym->id = curExternal->symbol->idCode;
3066 classSym->idCode = curExternal->symbol->idCode;
3068 classSym->declaring--;
3072 extern char * strcat(char * , const char * );
3074 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3076 extern struct ModuleImport * mainModule;
3078 extern struct Specifier * MkSpecifierName(char * name);
3080 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3082 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3084 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3086 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3088 extern void FreeDeclarator(struct Declarator * decl);
3090 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3092 struct PropertyImport
3094 struct PropertyImport * prev;
3095 struct PropertyImport * next;
3097 unsigned int isVirtual;
3098 unsigned int hasSet;
3099 unsigned int hasGet;
3100 } __attribute__ ((gcc_struct));
3102 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3104 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3106 struct Symbol * symbol = prop->symbol;
3107 char propName[1024];
3109 strcpy(setName, "__ecereProp_");
3110 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3111 strcat(setName, "_Set_");
3112 FullClassNameCat(setName, prop->name, 0x1);
3113 strcpy(getName, "__ecereProp_");
3114 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3115 strcat(getName, "_Get_");
3116 FullClassNameCat(getName, prop->name, 0x1);
3117 strcpy(propName, "__ecereProp_");
3118 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3119 strcat(propName, "_");
3120 FullClassNameCat(propName, prop->name, 0x1);
3121 MangleClassName(getName);
3122 MangleClassName(setName);
3123 MangleClassName(propName);
3124 if(prop->_class->type == 1)
3125 DeclareStruct(prop->_class->fullName, 0x0);
3126 if(!symbol || curExternal->symbol->idCode < symbol->id)
3128 unsigned int imported = 0x0;
3129 unsigned int dllImport = 0x0;
3131 if(!symbol || symbol->_import)
3135 struct Symbol * classSym;
3137 if(!prop->_class->symbol)
3138 prop->_class->symbol = FindClass(prop->_class->fullName);
3139 classSym = prop->_class->symbol;
3140 if(classSym && !classSym->_import)
3142 struct ModuleImport * module;
3144 if(prop->_class->module)
3145 module = FindModule(prop->_class->module);
3147 module = mainModule;
3148 classSym->_import = __extension__ ({
3149 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3151 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3155 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3156 symbol->_import = (struct ClassImport *)__extension__ ({
3157 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3159 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3162 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3165 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3170 struct Context * context = SetupTemplatesContext(prop->_class);
3172 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3173 FinishTemplatesContext(context);
3177 if(!symbol->externalGet || symbol->externalGet->type == 0)
3179 struct Declaration * decl;
3180 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3181 struct Declarator * d;
3182 struct __ecereNameSpace__ecere__sys__OldList * params;
3183 struct Specifier * spec;
3184 struct External * external;
3185 struct Declarator * typeDecl;
3186 unsigned int simple = 0x0;
3188 specifiers = MkList();
3189 declarators = MkList();
3191 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3192 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3194 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3196 struct Context * context = SetupTemplatesContext(prop->_class);
3198 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3199 FinishTemplatesContext(context);
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)
3212 DeclareStruct(spec->name, 0x0);
3219 d = PlugDeclarator(typeDecl, d);
3222 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3223 specifiers = MkList();
3225 d = MkDeclaratorFunction(d, params);
3227 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3228 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3229 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3231 ListAdd(specifiers, MkSpecifier(VOID));
3232 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3233 decl = MkDeclaration(specifiers, declarators);
3234 external = MkExternalDeclaration(decl);
3235 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3236 external->symbol = symbol;
3237 symbol->externalGet = external;
3238 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3240 FreeDeclarator(typeDecl);
3244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3249 if(!symbol->externalSet || symbol->externalSet->type == 0)
3251 struct Declaration * decl;
3252 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3253 struct Declarator * d;
3254 struct __ecereNameSpace__ecere__sys__OldList * params;
3255 struct Specifier * spec;
3256 struct External * external;
3257 struct Declarator * typeDecl;
3259 declarators = MkList();
3261 if(!prop->conversion || prop->_class->type == 1)
3263 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3265 specifiers = MkList();
3267 struct Context * context = SetupTemplatesContext(prop->_class);
3269 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3270 FinishTemplatesContext(context);
3272 ListAdd(params, MkTypeName(specifiers, d));
3273 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3275 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3276 d = MkDeclaratorFunction(d, params);
3277 for(spec = (*specifiers).first; spec; spec = spec->next)
3281 if((!typeDecl || typeDecl->type == 1))
3283 struct Symbol * classSym = spec->symbol;
3285 symbol->_class = classSym->registered;
3286 if(classSym->registered && classSym->registered->type == 1)
3287 DeclareStruct(spec->name, 0x0);
3291 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3292 specifiers = MkList();
3294 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3295 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3297 if(!prop->conversion || prop->_class->type == 1)
3298 ListAdd(specifiers, MkSpecifier(VOID));
3300 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3301 decl = MkDeclaration(specifiers, declarators);
3302 external = MkExternalDeclaration(decl);
3303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3304 external->symbol = symbol;
3305 symbol->externalSet = external;
3306 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3310 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3313 if(!symbol->externalPtr)
3315 struct Declaration * decl;
3316 struct External * external;
3317 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3320 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3322 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3323 ListAdd(specifiers, MkSpecifierName("Property"));
3325 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3327 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3330 strcpy(propName, "__ecerePropM_");
3331 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3332 strcat(propName, "_");
3333 FullClassNameCat(propName, prop->name, 0x1);
3334 MangleClassName(propName);
3335 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3337 decl = MkDeclaration(specifiers, list);
3339 external = MkExternalDeclaration(decl);
3340 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3341 external->symbol = symbol;
3342 symbol->externalPtr = external;
3346 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3348 symbol->id = curExternal->symbol->idCode;
3352 struct Type * Dereference(struct Type * source)
3354 struct Type * type = (((void *)0));
3358 if(source->kind == 13 || source->kind == 12)
3360 type = source->type;
3361 source->type->refCount++;
3363 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3365 type = __extension__ ({
3366 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3368 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3371 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3377 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3382 static struct Type * Reference(struct Type * source)
3384 struct Type * type = (((void *)0));
3388 type = __extension__ ({
3389 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3391 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3398 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);
3400 extern void * memcpy(void * , const void * , size_t size);
3402 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3404 extern void FreeExpression(struct Expression * exp);
3406 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3408 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);
3410 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3412 extern struct Type * MkClassType(char * name);
3414 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);
3416 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)
3418 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3419 unsigned int found = 0x0;
3420 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3421 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3422 unsigned int freeType = 0x0;
3424 yylloc = member->loc;
3429 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3433 dataMember = *curMember;
3439 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3440 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3441 int _subMemberStackPos = 0;
3444 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3447 dataMember = thisMember;
3448 if(curMember && thisMember->memberAccess == 1)
3450 *curMember = thisMember;
3451 *curClass = thisMember->_class;
3452 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3453 *subMemberStackPos = _subMemberStackPos;
3459 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3460 if(method && method->type == 1)
3463 method = (((void *)0));
3468 struct Type * type = (((void *)0));
3472 if(!dataMember->dataType && dataMember->dataTypeString)
3474 struct Context * context = SetupTemplatesContext(_class);
3476 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3477 FinishTemplatesContext(context);
3479 type = dataMember->dataType;
3483 if(!method->dataType)
3484 ProcessMethodType(method);
3485 type = method->dataType;
3487 if(ident && ident->next)
3489 for(ident = ident->next; ident && type; ident = ident->next)
3493 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3495 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3497 type = dataMember->dataType;
3499 else if(type->kind == 9 || type->kind == 10)
3501 struct Type * memberType;
3503 for(memberType = type->members.first; memberType; memberType = memberType->next)
3505 if(!strcmp(memberType->name, ident->string))
3514 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3517 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3518 struct __ecereNameSpace__ecere__com__Class * sClass;
3520 for(sClass = _class; sClass; sClass = sClass->base)
3523 if(sClass->templateClass)
3524 sClass = sClass->templateClass;
3525 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3527 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3529 for(sClass = sClass->base; sClass; sClass = sClass->base)
3531 if(sClass->templateClass)
3532 sClass = sClass->templateClass;
3533 id += sClass->templateParams.count;
3544 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3546 if(arg.dataTypeString)
3548 type = ProcessTypeString(arg.dataTypeString, 0x0);
3550 if(type && _class->templateClass)
3551 type->passAsTemplate = 0x1;
3558 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3560 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3561 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3565 char templateString[1024];
3566 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3568 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3569 for(cClass = expClass; cClass; cClass = cClass->base)
3573 if(cClass->templateClass)
3574 cClass = cClass->templateClass;
3575 for(param = cClass->templateParams.first; param; param = param->next)
3578 struct __ecereNameSpace__ecere__com__Class * sClass;
3579 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3581 for(sClass = cClass->base; sClass; sClass = sClass->base)
3583 if(sClass->templateClass)
3584 sClass = sClass->templateClass;
3585 id += sClass->templateParams.count;
3587 arg = expClass->templateArgs[id];
3588 for(sClass = _class; sClass; sClass = sClass->base)
3590 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3592 struct __ecereNameSpace__ecere__com__Class * nextClass;
3594 if(sClass->templateClass)
3595 sClass = sClass->templateClass;
3596 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3598 if(nextClass->templateClass)
3599 nextClass = nextClass->templateClass;
3600 p += nextClass->templateParams.count;
3602 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3604 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3606 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3608 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3609 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3623 char expString[1024];
3624 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3625 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3626 struct Expression * exp;
3627 char * string = PrintHexUInt64(arg.expression.ui64);
3629 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3630 ProcessExpressionType(exp);
3631 ComputeExpression(exp);
3632 expString[0] = '\0';
3633 PrintExpression(exp, expString);
3634 strcat(argument, expString);
3635 FreeExpression(exp);
3640 strcat(argument, arg.member->name);
3645 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3646 strcat(argument, arg.dataTypeString);
3653 strcat(templateString, ", ");
3654 if(lastParam != p - 1)
3656 strcat(templateString, param->name);
3657 strcat(templateString, " = ");
3659 strcat(templateString, argument);
3668 int len = strlen(templateString);
3670 if(templateString[len - 1] == '<')
3674 if(templateString[len - 1] == '>')
3675 templateString[len++] = ' ';
3676 templateString[len++] = '>';
3678 templateString[len++] = '\0';
3681 struct Context * context = SetupTemplatesContext(_class);
3685 type = ProcessTypeString(templateString, 0x0);
3687 FinishTemplatesContext(context);
3690 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3692 ProcessExpressionType(member->initializer->exp);
3693 if(!member->initializer->exp->expType)
3697 char expString[10240];
3699 expString[0] = '\0';
3700 PrintExpression(member->initializer->exp, expString);
3701 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3702 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3705 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3707 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3710 else if(member->initializer)
3712 ProcessInitializer(member->initializer, type);
3719 if(_class && _class->type == 3)
3721 if(member->initializer)
3723 struct Type * type = MkClassType(_class->fullName);
3725 ProcessInitializer(member->initializer, type);
3731 if(member->initializer)
3733 ProcessInitializer(member->initializer, (((void *)0)));
3739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3743 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3745 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3749 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3754 extern struct Identifier * GetDeclId(struct Declarator * decl);
3756 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);
3758 extern void FreeSpecifier(struct Specifier * spec);
3760 static void ProcessFunction(struct FunctionDefinition * function);
3762 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3764 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3766 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3768 extern void FreeClassFunction(struct ClassFunction * func);
3770 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3772 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3774 void ProcessInstantiationType(struct Instantiation * inst)
3779 struct MembersInit * members;
3780 struct Symbol * classSym;
3781 struct __ecereNameSpace__ecere__com__Class * _class;
3783 classSym = inst->_class->symbol;
3784 _class = classSym ? classSym->registered : (((void *)0));
3785 if(!_class || _class->type != 5)
3786 DeclareStruct(inst->_class->name, 0x0);
3787 afterExternal = afterExternal ? afterExternal : curExternal;
3789 ProcessExpressionType(inst->exp);
3790 inst->isConstant = 0x1;
3793 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3794 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3795 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3796 int subMemberStackPos = 0;
3798 for(members = (*inst->members).first; members; members = members->next)
3800 switch(members->type)
3805 static unsigned int instMethodID = 0;
3806 struct External * external = curExternal;
3807 struct Context * context = curContext;
3808 struct Declarator * declarator = members->function->declarator;
3809 struct Identifier * nameID = GetDeclId(declarator);
3810 char * unmangled = nameID ? nameID->string : (((void *)0));
3811 struct Expression * exp;
3812 struct External * createdExternal = (((void *)0));
3818 strcpy(name, "__ecereInstMeth_");
3819 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3821 strcat(name, nameID->string);
3823 sprintf(number, "_%08d", instMethodID++);
3824 strcat(name, number);
3825 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3829 struct Symbol * symbol = declarator->symbol;
3830 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3832 if(method && method->type == 1)
3834 symbol->method = method;
3835 ProcessMethodType(method);
3836 if(!symbol->type->thisClass)
3838 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3840 if(!currentClass->symbol)
3841 currentClass->symbol = FindClass(currentClass->fullName);
3842 symbol->type->thisClass = currentClass->symbol;
3847 _class->symbol = FindClass(_class->fullName);
3848 symbol->type->thisClass = _class->symbol;
3851 DeclareType(symbol->type, 0x1, 0x1);
3855 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3858 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3861 FreeSpecifier(nameID->_class);
3862 nameID->_class = (((void *)0));
3866 struct Type * type = declarator->symbol->type;
3867 struct External * oldExternal = curExternal;
3869 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3871 struct External * externalDecl;
3873 externalDecl = MkExternalDeclaration((((void *)0)));
3874 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3875 if(createdExternal->function)
3877 ProcessFunction(createdExternal->function);
3879 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3881 externalDecl->declaration = decl;
3882 if(decl->symbol && !decl->symbol->pointerExternal)
3883 decl->symbol->pointerExternal = externalDecl;
3884 declarator->symbol->pointerExternal = externalDecl;
3891 curExternal = declarator->symbol->pointerExternal;
3892 ProcessFunction((struct FunctionDefinition *)members->function);
3894 curExternal = external;
3895 curContext = context;
3898 FreeClassFunction(members->function);
3899 exp = QMkExpId(name);
3901 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3902 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3908 if(members->dataMembers && classSym)
3910 struct MemberInit * member;
3911 struct Location oldyyloc = yylloc;
3913 for(member = (*members->dataMembers).first; member; member = member->next)
3915 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3916 if(member->initializer && !member->initializer->isConstant)
3917 inst->isConstant = 0x0;
3929 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3933 if(type->kind == 11)
3935 struct Type * param;
3939 for(param = type->params.first; param; param = param->next)
3940 DeclareType(param, declarePointers, 0x1);
3942 DeclareType(type->returnType, declarePointers, 0x1);
3944 else if(type->kind == 13 && declarePointers)
3945 DeclareType(type->type, declarePointers, 0x0);
3946 else if(type->kind == 8)
3948 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3949 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3951 else if(type->kind == 9 || type->kind == 10)
3953 struct Type * member;
3955 for(member = type->members.first; member; member = member->next)
3956 DeclareType(member, 0x0, 0x0);
3958 else if(type->kind == 12)
3959 DeclareType(type->arrayType, declarePointers, 0x0);
3963 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3965 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3967 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3969 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3970 struct __ecereNameSpace__ecere__com__Class * sClass;
3972 for(sClass = _class; sClass; sClass = sClass->base)
3975 if(sClass->templateClass)
3976 sClass = sClass->templateClass;
3977 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3979 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3981 for(sClass = sClass->base; sClass; sClass = sClass->base)
3983 if(sClass->templateClass)
3984 sClass = sClass->templateClass;
3985 id += sClass->templateParams.count;
3996 arg = &_class->templateArgs[id];
3997 if(arg && param->type == 0)
3998 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4003 extern struct Context * PushContext(void);
4005 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4007 struct TemplatedType
4010 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4011 struct __ecereNameSpace__ecere__sys__BTNode * left;
4012 struct __ecereNameSpace__ecere__sys__BTNode * right;
4014 struct TemplateParameter * param;
4015 } __attribute__ ((gcc_struct));
4017 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4019 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4021 struct Context * context = PushContext();
4023 context->templateTypesOnly = 0x1;
4024 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4026 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4028 for(; param; param = param->next)
4030 if(param->type == 0 && param->identifier)
4032 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4034 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4040 struct __ecereNameSpace__ecere__com__Class * sClass;
4042 for(sClass = _class; sClass; sClass = sClass->base)
4044 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4046 for(p = sClass->templateParams.first; p; p = p->next)
4050 struct TemplateParameter * param = p->param;
4051 struct TemplatedType * type;
4055 p->param = param = __extension__ ({
4056 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4058 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4061 type = __extension__ ({
4062 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4064 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4066 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4074 extern void PopContext(struct Context * ctx);
4076 extern void FreeContext(struct Context * context);
4078 void FinishTemplatesContext(struct Context * context)
4080 PopContext(context);
4081 FreeContext(context);
4082 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4085 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4087 if(!method->dataType)
4089 struct Context * context = SetupTemplatesContext(method->_class);
4091 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4092 FinishTemplatesContext(context);
4093 if(method->type != 1 && method->dataType)
4095 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4097 if(!method->_class->symbol)
4098 method->_class->symbol = FindClass(method->_class->fullName);
4099 method->dataType->thisClass = method->_class->symbol;
4105 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4109 struct Context * context = SetupTemplatesContext(prop->_class);
4111 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4112 FinishTemplatesContext(context);
4116 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4118 extern void FreeTypeName(struct TypeName * typeName);
4120 static void ProcessDeclarator(struct Declarator * decl);
4122 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4128 struct MethodImport * prev;
4129 struct MethodImport * next;
4131 unsigned int isVirtual;
4132 } __attribute__ ((gcc_struct));
4134 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4136 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4138 struct Symbol * symbol = method->symbol;
4140 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4142 unsigned int imported = 0x0;
4143 unsigned int dllImport = 0x0;
4145 if(!method->dataType)
4146 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4147 if(!symbol || symbol->_import || method->type == 1)
4149 if(!symbol || method->type == 1)
4151 struct Symbol * classSym;
4153 if(!method->_class->symbol)
4154 method->_class->symbol = FindClass(method->_class->fullName);
4155 classSym = method->_class->symbol;
4156 if(!classSym->_import)
4158 struct ModuleImport * module;
4160 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4161 module = FindModule(method->_class->module);
4163 module = mainModule;
4164 classSym->_import = __extension__ ({
4165 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4167 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4169 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4173 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4175 if(!symbol->_import)
4177 symbol->_import = (struct ClassImport *)__extension__ ({
4178 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4180 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4182 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4186 symbol->type = method->dataType;
4188 symbol->type->refCount++;
4191 if(!method->dataType->dllExport)
4194 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4198 if(method->type != 1 && method->dataType)
4199 DeclareType(method->dataType, 0x1, 0x1);
4200 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4202 struct Declaration * decl;
4203 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4204 struct Declarator * d;
4205 struct Declarator * funcDecl;
4206 struct External * external;
4208 specifiers = MkList();
4209 declarators = MkList();
4211 ListAdd(specifiers, MkSpecifier(EXTERN));
4212 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4213 ListAdd(specifiers, MkSpecifier(STATIC));
4214 if(method->type == 1)
4216 ListAdd(specifiers, MkSpecifier(INT));
4217 d = MkDeclaratorIdentifier(MkIdentifier(name));
4221 d = MkDeclaratorIdentifier(MkIdentifier(name));
4223 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4225 struct Context * context = SetupTemplatesContext(method->_class);
4227 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4228 FinishTemplatesContext(context);
4230 funcDecl = GetFuncDecl(d);
4233 struct Specifier * spec, * next;
4235 for(spec = (*specifiers).first; spec; spec = next)
4240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4241 FreeSpecifier(spec);
4245 if(method->dataType && !method->dataType->staticMethod)
4247 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4249 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4250 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")));
4251 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4252 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4254 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4256 struct TypeName * param = (*funcDecl->function.parameters).first;
4258 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4259 FreeTypeName(param);
4261 if(!funcDecl->function.parameters)
4262 funcDecl->function.parameters = MkList();
4263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4267 ProcessDeclarator(d);
4268 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4269 decl = MkDeclaration(specifiers, declarators);
4270 ReplaceThisClassSpecifiers(specifiers, method->_class);
4271 if(symbol->pointerExternal)
4273 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4276 *functionSymbol = *symbol;
4277 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4278 if(functionSymbol->type)
4279 functionSymbol->type->refCount++;
4281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4282 symbol->pointerExternal->symbol = functionSymbol;
4284 external = MkExternalDeclaration(decl);
4286 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4287 external->symbol = symbol;
4288 symbol->pointerExternal = external;
4292 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4294 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4298 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4300 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4302 unsigned int first = 0x1;
4304 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4306 char className[1024];
4308 strcpy(className, _class->fullName);
4309 for(param = _class->templateParams.first; param; param = param->next)
4313 strcat(className, "<");
4315 strcat(className, ", ");
4316 if(lastParam + 1 != p)
4318 strcat(className, param->name);
4319 strcat(className, " = ");
4321 strcat(className, param->name);
4329 int len = strlen(className);
4331 if(className[len - 1] == '>')
4332 className[len++] = ' ';
4333 className[len++] = '>';
4334 className[len++] = '\0';
4336 return __ecereNameSpace__ecere__sys__CopyString(className);
4339 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4342 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4344 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4346 unsigned int first = 0x1;
4348 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4350 char className[1024];
4352 strcpy(className, _class->fullName);
4353 for(param = _class->templateParams.first; param; param = param->next)
4357 strcat(className, "<");
4359 strcat(className, ", ");
4360 if(lastParam + 1 != p)
4362 strcat(className, param->name);
4363 strcat(className, " = ");
4365 strcat(className, param->name);
4373 int len = strlen(className);
4375 if(className[len - 1] == '>')
4376 className[len++] = ' ';
4377 className[len++] = '>';
4378 className[len++] = '\0';
4380 return MkClassType(className);
4384 return MkClassType(_class->fullName);
4388 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4390 if(specs != (((void *)0)) && _class)
4392 struct Specifier * spec;
4394 for(spec = specs->first; spec; spec = spec->next)
4396 if(spec->type == 0 && spec->specifier == THISCLASS)
4399 spec->name = ReplaceThisClass(_class);
4400 spec->symbol = FindClass(spec->name);
4406 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4408 struct __ecereNameSpace__ecere__com__GlobalFunction
4410 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4411 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4414 struct __ecereNameSpace__ecere__com__Instance * module;
4415 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4416 char * dataTypeString;
4417 struct Type * dataType;
4419 } __attribute__ ((gcc_struct));
4421 extern struct Context * globalContext;
4423 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4425 struct FunctionImport
4427 struct FunctionImport * prev;
4428 struct FunctionImport * next;
4430 } __attribute__ ((gcc_struct));
4432 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4434 struct Symbol * symbol = function->symbol;
4436 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4438 unsigned int imported = 0x0;
4439 unsigned int dllImport = 0x0;
4441 if(!function->dataType)
4443 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4444 if(!function->dataType->thisClass)
4445 function->dataType->staticMethod = 0x1;
4451 struct ModuleImport * module = FindModule(function->module);
4453 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4456 if(!function->dataType->dllExport)
4458 symbol->_import = (struct ClassImport *)__extension__ ({
4459 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4461 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4463 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4467 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4468 if(!symbol->type->thisClass)
4469 symbol->type->staticMethod = 0x1;
4472 imported = symbol->_import ? 0x1 : 0x0;
4473 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4476 DeclareType(function->dataType, 0x1, 0x1);
4479 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4481 struct Declaration * decl;
4482 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4483 struct Declarator * d;
4484 struct Declarator * funcDecl;
4485 struct External * external;
4487 specifiers = MkList();
4488 declarators = MkList();
4489 ListAdd(specifiers, MkSpecifier(EXTERN));
4490 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4492 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4493 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4494 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4496 struct Specifier * spec;
4498 for(spec = (*specifiers).first; spec; spec = spec->next)
4499 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4502 FreeSpecifier(spec);
4506 funcDecl = GetFuncDecl(d);
4507 if(funcDecl && !funcDecl->function.parameters)
4509 funcDecl->function.parameters = MkList();
4510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4512 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4514 struct Context * oldCtx = curContext;
4516 curContext = globalContext;
4517 decl = MkDeclaration(specifiers, declarators);
4518 curContext = oldCtx;
4520 if(symbol->pointerExternal)
4522 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4525 *functionSymbol = *symbol;
4526 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4527 if(functionSymbol->type)
4528 functionSymbol->type->refCount++;
4530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4531 symbol->pointerExternal->symbol = functionSymbol;
4533 external = MkExternalDeclaration(decl);
4535 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4536 external->symbol = symbol;
4537 symbol->pointerExternal = external;
4541 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4544 symbol->id = curExternal->symbol->idCode;
4547 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4550 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4555 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4556 struct __ecereNameSpace__ecere__sys__BTNode * left;
4557 struct __ecereNameSpace__ecere__sys__BTNode * right;
4559 struct __ecereNameSpace__ecere__com__Instance * module;
4560 char * dataTypeString;
4561 struct Type * dataType;
4564 } __attribute__ ((gcc_struct));
4566 void DeclareGlobalData(struct GlobalData * data)
4568 struct Symbol * symbol = data->symbol;
4570 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4575 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4578 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4579 DeclareType(data->dataType, 0x1, 0x1);
4582 if(!symbol->pointerExternal)
4584 struct Declaration * decl;
4585 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4586 struct Declarator * d;
4587 struct External * external;
4589 specifiers = MkList();
4590 declarators = MkList();
4591 ListAdd(specifiers, MkSpecifier(EXTERN));
4592 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4593 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4594 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4595 decl = MkDeclaration(specifiers, declarators);
4596 external = MkExternalDeclaration(decl);
4598 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4599 external->symbol = symbol;
4600 symbol->pointerExternal = external;
4604 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4607 symbol->id = curExternal->symbol->idCode;
4614 struct Conversion * prev, * next;
4615 struct __ecereNameSpace__ecere__com__Property * convert;
4617 struct Type * resultType;
4618 } __attribute__ ((gcc_struct));
4620 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4622 extern void Compiler_Warning(char * format, ...);
4624 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4626 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)
4630 if(source->kind == 20 && dest->kind != 20)
4632 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4637 if(dest->kind == 20 && source->kind != 20)
4639 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4644 if(dest->classObjectType == 2)
4646 if(source->classObjectType != 3)
4650 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4658 if(source->classObjectType == 3)
4660 if(dest->classObjectType == 3 && source->classObjectType != 2)
4663 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4665 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4668 if(dest->kind == 14 && source->kind != 0)
4670 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))
4672 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))
4674 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4676 if(source->_class->registered && source->_class->registered->type == 3)
4678 if(conversions != (((void *)0)))
4680 if(source->_class->registered == dest->_class->registered)
4685 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4687 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4689 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4691 if(sourceBase == destBase)
4695 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))
4699 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && ((source->_class && source->_class->registered && source->_class->registered->type != 4) || source->kind == 8))
4701 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4708 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4712 if(source->kind == 8)
4714 struct __ecereNameSpace__ecere__com__Class * _class;
4716 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4718 struct __ecereNameSpace__ecere__com__Property * convert;
4720 for(convert = _class->conversions.first; convert; convert = convert->next)
4722 if(convert->memberAccess == 1 || _class->module == privateModule)
4724 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4726 if(!convert->dataType)
4727 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4728 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4730 if(!conversions && !convert->Get)
4732 else if(conversions != (((void *)0)))
4734 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))
4738 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4740 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4751 struct __ecereNameSpace__ecere__com__Class * _class;
4753 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4755 struct __ecereNameSpace__ecere__com__Property * convert;
4757 for(convert = _class->conversions.first; convert; convert = convert->next)
4759 if(convert->memberAccess == 1 || _class->module == privateModule)
4761 if(!convert->dataType)
4762 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4763 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4765 if(!conversions && !convert->Set)
4767 else if(conversions != (((void *)0)))
4769 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))
4773 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4775 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4783 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4785 if(!dest->_class->registered->dataType)
4786 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4787 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4789 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4796 if(source->kind == 8)
4798 struct __ecereNameSpace__ecere__com__Class * _class;
4800 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4802 struct __ecereNameSpace__ecere__com__Property * convert;
4804 for(convert = _class->conversions.first; convert; convert = convert->next)
4806 if(convert->memberAccess == 1 || _class->module == privateModule)
4808 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4810 if(!convert->dataType)
4811 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4812 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4814 if(!conversions && !convert->Get)
4816 else if(conversions != (((void *)0)))
4818 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))
4822 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4824 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4832 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4834 if(!source->_class->registered->dataType)
4835 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4836 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4843 if(source->kind == 8 || source->kind == 19)
4845 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4847 else if(dest->kind == 7 && source->kind == 6)
4849 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4851 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4853 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4855 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4857 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4859 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || source->kind == 24 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
4861 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4863 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)))
4865 struct Type * paramSource, * paramDest;
4867 if(dest->kind == 16)
4868 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4869 if(source->kind == 16)
4870 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4871 if(dest->kind == 13 && dest->type->kind == 11)
4873 if(source->kind == 13 && source->type->kind == 11)
4874 source = source->type;
4875 if(dest->kind == 16)
4876 dest = dest->method->dataType;
4877 if(source->kind == 16)
4878 source = source->method->dataType;
4879 paramSource = source->params.first;
4880 if(paramSource && paramSource->kind == 0)
4881 paramSource = (((void *)0));
4882 paramDest = dest->params.first;
4883 if(paramDest && paramDest->kind == 0)
4884 paramDest = (((void *)0));
4885 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4887 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))))
4889 if(paramDest && paramDest->kind == 8)
4890 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4892 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4895 paramDest = paramDest->next;
4897 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4899 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4903 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4905 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4911 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4914 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4916 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4920 paramSource = paramSource->next;
4926 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4928 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4934 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4936 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4942 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4944 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4947 for(; paramDest; paramDest = paramDest->next)
4951 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4955 struct Type * paramDestType = paramDest;
4956 struct Type * paramSourceType = paramSource;
4957 struct Type * type = paramDestType;
4959 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4962 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4963 struct __ecereNameSpace__ecere__com__Class * sClass;
4965 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4968 if(sClass->templateClass)
4969 sClass = sClass->templateClass;
4970 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4972 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4974 for(sClass = sClass->base; sClass; sClass = sClass->base)
4976 if(sClass->templateClass)
4977 sClass = sClass->templateClass;
4978 id += sClass->templateParams.count;
4989 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4991 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4994 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)))
4999 PrintType(paramDest, type, 0x0, 0x1);
5000 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5001 if(paramDestType != paramDest)
5002 FreeType(paramDestType);
5005 if(paramDestType != paramDest)
5006 FreeType(paramDestType);
5008 paramSource = paramSource->next;
5012 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5017 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5021 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5023 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5030 static void FreeConvert(struct Conversion * convert)
5032 if(convert->resultType)
5033 FreeType(convert->resultType);
5036 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5038 struct __ecereNameSpace__ecere__com__BTNamedLink
5041 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5042 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5043 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5046 } __attribute__ ((gcc_struct));
5048 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5050 struct __ecereNameSpace__ecere__com__EnumClassData
5052 struct __ecereNameSpace__ecere__sys__OldList values;
5054 } __attribute__ ((gcc_struct));
5056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5058 struct __ecereNameSpace__ecere__sys__NamedLink
5060 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5061 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5064 } __attribute__ ((gcc_struct));
5066 extern void FreeExpContents(struct Expression * exp);
5068 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5070 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5072 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5074 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5076 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5078 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5080 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5082 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)))
5084 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5086 if(_class->type == 4)
5088 struct __ecereNameSpace__ecere__sys__OldList converts =
5092 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5096 _class->symbol = FindClass(_class->fullName);
5097 type->_class = _class->symbol;
5098 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5100 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5101 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5105 struct __ecereNameSpace__ecere__com__Class * baseClass;
5107 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5109 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5111 for(value = e->values.first; value; value = value->next)
5113 if(!strcmp(value->name, string))
5118 FreeExpContents(sourceExp);
5119 FreeType(sourceExp->expType);
5120 sourceExp->isConstant = 0x1;
5121 sourceExp->expType = MkClassType(baseClass->fullName);
5125 sourceExp->type = 2;
5126 if(!strcmp(baseClass->dataTypeString, "int"))
5127 sprintf(constant, "%d", (int)value->data);
5129 sprintf(constant, "0x%X", (int)value->data);
5130 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5132 while(converts.first)
5134 struct Conversion * convert = converts.first;
5136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5139 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5146 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5147 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5150 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)))
5151 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5156 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5158 struct __ecereNameSpace__ecere__com__SubModule
5160 struct __ecereNameSpace__ecere__com__SubModule * prev;
5161 struct __ecereNameSpace__ecere__com__SubModule * next;
5162 struct __ecereNameSpace__ecere__com__Instance * module;
5164 } __attribute__ ((gcc_struct));
5166 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5168 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5170 if(searchFor == searchIn)
5172 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5174 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5176 if(ModuleVisibility(subModule->module, searchFor))
5183 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5185 struct __ecereNameSpace__ecere__com__Application
5190 unsigned int isGUIApp;
5191 struct __ecereNameSpace__ecere__sys__OldList allModules;
5192 char * parsedCommand;
5193 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5194 } __attribute__ ((gcc_struct));
5196 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5198 struct __ecereNameSpace__ecere__com__Instance * module;
5200 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->systemNameSpace, sourceExp, dest, string, conversions))
5202 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->privateNameSpace, sourceExp, dest, string, conversions))
5204 if(MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5206 for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)mainModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
5208 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5214 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5216 void ReadString(char * output, char * string);
5218 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5220 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5222 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5224 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5226 struct Type * source = sourceExp->expType;
5227 struct Type * realDest = dest;
5228 struct Type * backupSourceExpType = (((void *)0));
5230 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5232 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5234 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5236 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5238 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5240 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5242 if(sourceBase == destBase)
5248 struct __ecereNameSpace__ecere__sys__OldList * specs;
5249 unsigned int flag = 0x0;
5250 long long value = (((int)0x7fffffff));
5254 if(sourceExp->type == 2)
5256 if(source->isSigned)
5257 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5259 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5261 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5263 if(source->isSigned)
5264 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5266 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5268 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5271 source = __extension__ ({
5272 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5274 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5279 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5281 if(_class && _class->type == 3)
5283 if(source->kind != 8)
5285 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5286 struct Type * tempDest, * tempSource;
5288 for(; _class->base->type != 1000; _class = _class->base)
5291 tempDest = tempType;
5294 _class->symbol = FindClass(_class->fullName);
5295 tempType->_class = _class->symbol;
5296 tempType->truth = dest->truth;
5297 if(tempType->_class)
5298 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5299 backupSourceExpType = sourceExp->expType;
5300 sourceExp->expType = dest;
5303 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5306 if(_class && _class->type == 2 && source->kind != 8)
5308 if(!dest->_class->registered->dataType)
5309 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5310 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5313 FreeType(sourceExp->expType);
5314 source = sourceExp->expType = MkClassType(dest->_class->string);
5318 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5320 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5321 struct Declarator * decl;
5324 ReadString(string, sourceExp->string);
5325 decl = SpecDeclFromString(string, specs, (((void *)0)));
5326 FreeExpContents(sourceExp);
5327 FreeType(sourceExp->expType);
5328 sourceExp->type = 26;
5329 sourceExp->_classExp.specifiers = specs;
5330 sourceExp->_classExp.decl = decl;
5331 sourceExp->expType = dest;
5335 if(backupSourceExpType)
5336 FreeType(backupSourceExpType);
5340 else if(source->kind == 8)
5342 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5344 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5348 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5349 struct Type * tempDest, * tempSource;
5351 if(!source->_class->registered->dataType)
5352 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5353 for(; _class->base->type != 1000; _class = _class->base)
5356 tempSource = tempType;
5358 tempType->_class = FindClass(_class->fullName);
5359 tempType->truth = source->truth;
5360 tempType->classObjectType = source->classObjectType;
5361 if(tempType->_class)
5362 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5363 if(conversions->last)
5365 ((struct Conversion *)conversions->last)->resultType = dest;
5368 FreeType(sourceExp->expType);
5369 sourceExp->expType = MkClassType(_class->fullName);
5370 sourceExp->expType->truth = source->truth;
5371 sourceExp->expType->classObjectType = source->classObjectType;
5372 if(!sourceExp->destType)
5374 FreeType(sourceExp->destType);
5375 sourceExp->destType = sourceExp->expType;
5376 if(sourceExp->expType)
5377 sourceExp->expType->refCount++;
5379 if(!_class->dataType)
5380 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5382 dest = MkClassType(source->_class->string);
5383 dest->truth = source->truth;
5384 dest->classObjectType = source->classObjectType;
5386 source = _class->dataType;
5388 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5394 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5403 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5405 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5407 if(_class->type == 0 || _class->type == 5)
5409 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5411 *newExp = *sourceExp;
5412 if(sourceExp->destType)
5413 sourceExp->destType->refCount++;
5414 if(sourceExp->expType)
5415 sourceExp->expType->refCount++;
5416 sourceExp->type = 11;
5417 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5418 sourceExp->cast.exp = newExp;
5419 FreeType(sourceExp->expType);
5420 sourceExp->expType = (((void *)0));
5421 ProcessExpressionType(sourceExp);
5424 FreeType(sourceExp->expType);
5425 sourceExp->expType = dest;
5430 if(backupSourceExpType)
5431 FreeType(backupSourceExpType);
5434 if(!_class->dataType)
5435 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5437 dest = _class->dataType;
5440 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24))
5442 specs = MkListOne(MkSpecifier(DOUBLE));
5444 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 7))
5446 specs = MkListOne(MkSpecifier(FLOAT));
5448 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5452 ListAdd(specs, MkSpecifier(UNSIGNED));
5453 ListAdd(specs, MkSpecifier(INT64));
5455 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5459 ListAdd(specs, MkSpecifier(UNSIGNED));
5460 ListAdd(specs, MkSpecifier(INT));
5462 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5466 ListAdd(specs, MkSpecifier(UNSIGNED));
5467 ListAdd(specs, MkSpecifier(SHORT));
5469 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5473 ListAdd(specs, MkSpecifier(UNSIGNED));
5474 ListAdd(specs, MkSpecifier(CHAR));
5480 if(backupSourceExpType)
5482 if(sourceExp->expType)
5483 FreeType(sourceExp->expType);
5484 sourceExp->expType = backupSourceExpType;
5489 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 == 24 || source->kind == 1))
5491 specs = MkListOne(MkSpecifier(DOUBLE));
5493 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5495 specs = MkListOne(MkSpecifier(FLOAT));
5497 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5500 ListAdd(specs, MkSpecifier(BOOL));
5502 else if(dest->kind == 1 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5506 ListAdd(specs, MkSpecifier(UNSIGNED));
5507 ListAdd(specs, MkSpecifier(CHAR));
5509 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 24 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5513 ListAdd(specs, MkSpecifier(UNSIGNED));
5514 ListAdd(specs, MkSpecifier(SHORT));
5516 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5520 ListAdd(specs, MkSpecifier(UNSIGNED));
5521 ListAdd(specs, MkSpecifier(INT));
5523 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5527 ListAdd(specs, MkSpecifier(UNSIGNED));
5528 ListAdd(specs, MkSpecifier(INT64));
5530 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5532 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5538 if(backupSourceExpType)
5540 if(sourceExp->expType)
5541 FreeType(sourceExp->expType);
5542 sourceExp->expType = backupSourceExpType;
5548 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5550 *newExp = *sourceExp;
5551 newExp->prev = (((void *)0));
5552 newExp->next = (((void *)0));
5553 if(sourceExp->destType)
5554 sourceExp->destType->refCount++;
5555 if(sourceExp->expType)
5556 sourceExp->expType->refCount++;
5557 sourceExp->type = 11;
5558 if(realDest->kind == 8)
5560 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5561 FreeList(specs, FreeSpecifier);
5564 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5565 if(newExp->type == 4)
5567 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5570 sourceExp->cast.exp = newExp;
5571 FreeType(sourceExp->expType);
5572 sourceExp->expType = (((void *)0));
5573 ProcessExpressionType(sourceExp);
5576 FreeList(specs, FreeSpecifier);
5579 if(backupSourceExpType)
5580 FreeType(backupSourceExpType);
5585 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5586 sourceExp = (*sourceExp->list).last;
5587 if(sourceExp->type == 0)
5589 struct Identifier * id = sourceExp->identifier;
5593 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5595 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5596 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5600 for(; _class && _class->type == 4; _class = _class->base)
5602 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5603 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5605 for(value = e->values.first; value; value = value->next)
5607 if(!strcmp(value->name, id->string))
5612 FreeExpContents(sourceExp);
5613 FreeType(sourceExp->expType);
5614 sourceExp->isConstant = 0x1;
5615 sourceExp->expType = MkClassType(_class->fullName);
5619 sourceExp->type = 2;
5620 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5621 sprintf(constant, "%d", (int)value->data);
5623 sprintf(constant, "0x%X", (int)value->data);
5624 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5632 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5639 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5641 int value2 = op2->i;
5644 exp->string = PrintInt(op1->i + value2);
5647 exp->expType = op1->type;
5649 op1->type->refCount++;
5654 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5656 unsigned int value2 = op2->ui;
5659 exp->string = PrintUInt(op1->ui + value2);
5662 exp->expType = op1->type;
5664 op1->type->refCount++;
5669 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 short value2 = op2->s;
5674 exp->string = PrintShort(op1->s + value2);
5677 exp->expType = op1->type;
5679 op1->type->refCount++;
5684 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 unsigned short value2 = op2->us;
5689 exp->string = PrintUShort(op1->us + value2);
5692 exp->expType = op1->type;
5694 op1->type->refCount++;
5699 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 char value2 = op2->c;
5704 exp->string = PrintChar(op1->c + value2);
5707 exp->expType = op1->type;
5709 op1->type->refCount++;
5714 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 unsigned char value2 = op2->uc;
5719 exp->string = PrintUChar(op1->uc + value2);
5722 exp->expType = op1->type;
5724 op1->type->refCount++;
5729 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 float value2 = op2->f;
5734 exp->string = PrintFloat(op1->f + value2);
5737 exp->expType = op1->type;
5739 op1->type->refCount++;
5744 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 double value2 = op2->d;
5749 exp->string = PrintDouble(op1->d + value2);
5752 exp->expType = op1->type;
5754 op1->type->refCount++;
5759 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5761 int value2 = op2->i;
5764 exp->string = PrintInt(op1->i - value2);
5767 exp->expType = op1->type;
5769 op1->type->refCount++;
5774 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 unsigned int value2 = op2->ui;
5779 exp->string = PrintUInt(op1->ui - value2);
5782 exp->expType = op1->type;
5784 op1->type->refCount++;
5789 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 short value2 = op2->s;
5794 exp->string = PrintShort(op1->s - value2);
5797 exp->expType = op1->type;
5799 op1->type->refCount++;
5804 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 unsigned short value2 = op2->us;
5809 exp->string = PrintUShort(op1->us - value2);
5812 exp->expType = op1->type;
5814 op1->type->refCount++;
5819 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 char value2 = op2->c;
5824 exp->string = PrintChar(op1->c - value2);
5827 exp->expType = op1->type;
5829 op1->type->refCount++;
5834 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 unsigned char value2 = op2->uc;
5839 exp->string = PrintUChar(op1->uc - value2);
5842 exp->expType = op1->type;
5844 op1->type->refCount++;
5849 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 float value2 = op2->f;
5854 exp->string = PrintFloat(op1->f - value2);
5857 exp->expType = op1->type;
5859 op1->type->refCount++;
5864 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 double value2 = op2->d;
5869 exp->string = PrintDouble(op1->d - value2);
5872 exp->expType = op1->type;
5874 op1->type->refCount++;
5879 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 int value2 = op2->i;
5884 exp->string = PrintInt(op1->i * value2);
5887 exp->expType = op1->type;
5889 op1->type->refCount++;
5894 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 unsigned int value2 = op2->ui;
5899 exp->string = PrintUInt(op1->ui * value2);
5902 exp->expType = op1->type;
5904 op1->type->refCount++;
5909 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 short value2 = op2->s;
5914 exp->string = PrintShort(op1->s * value2);
5917 exp->expType = op1->type;
5919 op1->type->refCount++;
5924 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 unsigned short value2 = op2->us;
5929 exp->string = PrintUShort(op1->us * value2);
5932 exp->expType = op1->type;
5934 op1->type->refCount++;
5939 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 char value2 = op2->c;
5944 exp->string = PrintChar(op1->c * value2);
5947 exp->expType = op1->type;
5949 op1->type->refCount++;
5954 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 unsigned char value2 = op2->uc;
5959 exp->string = PrintUChar(op1->uc * value2);
5962 exp->expType = op1->type;
5964 op1->type->refCount++;
5969 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 float value2 = op2->f;
5974 exp->string = PrintFloat(op1->f * value2);
5977 exp->expType = op1->type;
5979 op1->type->refCount++;
5984 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 double value2 = op2->d;
5989 exp->string = PrintDouble(op1->d * value2);
5992 exp->expType = op1->type;
5994 op1->type->refCount++;
5999 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 int value2 = op2->i;
6004 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6007 exp->expType = op1->type;
6009 op1->type->refCount++;
6014 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 unsigned int value2 = op2->ui;
6019 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6022 exp->expType = op1->type;
6024 op1->type->refCount++;
6029 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 short value2 = op2->s;
6034 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6037 exp->expType = op1->type;
6039 op1->type->refCount++;
6044 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6046 unsigned short value2 = op2->us;
6049 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6052 exp->expType = op1->type;
6054 op1->type->refCount++;
6059 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6061 char value2 = op2->c;
6064 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6067 exp->expType = op1->type;
6069 op1->type->refCount++;
6074 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6076 unsigned char value2 = op2->uc;
6079 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6082 exp->expType = op1->type;
6084 op1->type->refCount++;
6089 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6091 float value2 = op2->f;
6094 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6097 exp->expType = op1->type;
6099 op1->type->refCount++;
6104 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6106 double value2 = op2->d;
6109 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6112 exp->expType = op1->type;
6114 op1->type->refCount++;
6119 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6121 int value2 = op2->i;
6124 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6127 exp->expType = op1->type;
6129 op1->type->refCount++;
6134 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6136 unsigned int value2 = op2->ui;
6139 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6142 exp->expType = op1->type;
6144 op1->type->refCount++;
6149 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6151 short value2 = op2->s;
6154 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6157 exp->expType = op1->type;
6159 op1->type->refCount++;
6164 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6166 unsigned short value2 = op2->us;
6169 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6172 exp->expType = op1->type;
6174 op1->type->refCount++;
6179 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6181 char value2 = op2->c;
6184 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6187 exp->expType = op1->type;
6189 op1->type->refCount++;
6194 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6196 unsigned char value2 = op2->uc;
6199 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6202 exp->expType = op1->type;
6204 op1->type->refCount++;
6209 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6212 exp->string = PrintInt((-op1->i));
6215 exp->expType = op1->type;
6217 op1->type->refCount++;
6222 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6225 exp->string = PrintUInt((unsigned int)(-op1->ui));
6228 exp->expType = op1->type;
6230 op1->type->refCount++;
6235 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6238 exp->string = PrintShort((-op1->s));
6241 exp->expType = op1->type;
6243 op1->type->refCount++;
6248 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6251 exp->string = PrintUShort((unsigned short)(-op1->us));
6254 exp->expType = op1->type;
6256 op1->type->refCount++;
6261 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6264 exp->string = PrintChar((-op1->c));
6267 exp->expType = op1->type;
6269 op1->type->refCount++;
6274 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6277 exp->string = PrintUChar((unsigned char)(-op1->uc));
6280 exp->expType = op1->type;
6282 op1->type->refCount++;
6287 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6290 exp->string = PrintFloat((float)(-op1->f));
6293 exp->expType = op1->type;
6295 op1->type->refCount++;
6300 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6303 exp->string = PrintDouble((double)(-op1->d));
6306 exp->expType = op1->type;
6308 op1->type->refCount++;
6313 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6316 exp->string = PrintInt((++op1->i));
6319 exp->expType = op1->type;
6321 op1->type->refCount++;
6326 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6329 exp->string = PrintUInt((++op1->ui));
6332 exp->expType = op1->type;
6334 op1->type->refCount++;
6339 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6342 exp->string = PrintShort((++op1->s));
6345 exp->expType = op1->type;
6347 op1->type->refCount++;
6352 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6355 exp->string = PrintUShort((++op1->us));
6358 exp->expType = op1->type;
6360 op1->type->refCount++;
6365 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6368 exp->string = PrintChar((++op1->c));
6371 exp->expType = op1->type;
6373 op1->type->refCount++;
6378 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6381 exp->string = PrintUChar((++op1->uc));
6384 exp->expType = op1->type;
6386 op1->type->refCount++;
6391 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6394 exp->string = PrintFloat((float)(++op1->f));
6397 exp->expType = op1->type;
6399 op1->type->refCount++;
6404 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6407 exp->string = PrintDouble((double)(++op1->d));
6410 exp->expType = op1->type;
6412 op1->type->refCount++;
6417 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6420 exp->string = PrintInt((--op1->i));
6423 exp->expType = op1->type;
6425 op1->type->refCount++;
6430 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6433 exp->string = PrintUInt((--op1->ui));
6436 exp->expType = op1->type;
6438 op1->type->refCount++;
6443 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6446 exp->string = PrintShort((--op1->s));
6449 exp->expType = op1->type;
6451 op1->type->refCount++;
6456 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6459 exp->string = PrintUShort((--op1->us));
6462 exp->expType = op1->type;
6464 op1->type->refCount++;
6469 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6472 exp->string = PrintChar((--op1->c));
6475 exp->expType = op1->type;
6477 op1->type->refCount++;
6482 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6485 exp->string = PrintUChar((--op1->uc));
6488 exp->expType = op1->type;
6490 op1->type->refCount++;
6495 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6498 exp->string = PrintFloat((float)(--op1->f));
6501 exp->expType = op1->type;
6503 op1->type->refCount++;
6508 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6511 exp->string = PrintDouble((double)(--op1->d));
6514 exp->expType = op1->type;
6516 op1->type->refCount++;
6521 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6523 int value2 = op2->i;
6526 exp->string = PrintInt(op1->i = value2);
6529 exp->expType = op1->type;
6531 op1->type->refCount++;
6536 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6538 unsigned int value2 = op2->ui;
6541 exp->string = PrintUInt(op1->ui = value2);
6544 exp->expType = op1->type;
6546 op1->type->refCount++;
6551 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6553 short value2 = op2->s;
6556 exp->string = PrintShort(op1->s = value2);
6559 exp->expType = op1->type;
6561 op1->type->refCount++;
6566 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6568 unsigned short value2 = op2->us;
6571 exp->string = PrintUShort(op1->us = value2);
6574 exp->expType = op1->type;
6576 op1->type->refCount++;
6581 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6583 char value2 = op2->c;
6586 exp->string = PrintChar(op1->c = value2);
6589 exp->expType = op1->type;
6591 op1->type->refCount++;
6596 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6598 unsigned char value2 = op2->uc;
6601 exp->string = PrintUChar(op1->uc = value2);
6604 exp->expType = op1->type;
6606 op1->type->refCount++;
6611 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6613 float value2 = op2->f;
6616 exp->string = PrintFloat(op1->f = value2);
6619 exp->expType = op1->type;
6621 op1->type->refCount++;
6626 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6628 double value2 = op2->d;
6631 exp->string = PrintDouble(op1->d = value2);
6634 exp->expType = op1->type;
6636 op1->type->refCount++;
6641 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6643 int value2 = op2->i;
6646 exp->string = PrintInt(op1->i += value2);
6649 exp->expType = op1->type;
6651 op1->type->refCount++;
6656 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6658 unsigned int value2 = op2->ui;
6661 exp->string = PrintUInt(op1->ui += value2);
6664 exp->expType = op1->type;
6666 op1->type->refCount++;
6671 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6673 short value2 = op2->s;
6676 exp->string = PrintShort(op1->s += value2);
6679 exp->expType = op1->type;
6681 op1->type->refCount++;
6686 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6688 unsigned short value2 = op2->us;
6691 exp->string = PrintUShort(op1->us += value2);
6694 exp->expType = op1->type;
6696 op1->type->refCount++;
6701 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6703 char value2 = op2->c;
6706 exp->string = PrintChar(op1->c += value2);
6709 exp->expType = op1->type;
6711 op1->type->refCount++;
6716 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6718 unsigned char value2 = op2->uc;
6721 exp->string = PrintUChar(op1->uc += value2);
6724 exp->expType = op1->type;
6726 op1->type->refCount++;
6731 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6733 float value2 = op2->f;
6736 exp->string = PrintFloat(op1->f += value2);
6739 exp->expType = op1->type;
6741 op1->type->refCount++;
6746 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6748 double value2 = op2->d;
6751 exp->string = PrintDouble(op1->d += value2);
6754 exp->expType = op1->type;
6756 op1->type->refCount++;
6761 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6763 int value2 = op2->i;
6766 exp->string = PrintInt(op1->i -= value2);
6769 exp->expType = op1->type;
6771 op1->type->refCount++;
6776 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6778 unsigned int value2 = op2->ui;
6781 exp->string = PrintUInt(op1->ui -= value2);
6784 exp->expType = op1->type;
6786 op1->type->refCount++;
6791 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6793 short value2 = op2->s;
6796 exp->string = PrintShort(op1->s -= value2);
6799 exp->expType = op1->type;
6801 op1->type->refCount++;
6806 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6808 unsigned short value2 = op2->us;
6811 exp->string = PrintUShort(op1->us -= value2);
6814 exp->expType = op1->type;
6816 op1->type->refCount++;
6821 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6823 char value2 = op2->c;
6826 exp->string = PrintChar(op1->c -= value2);
6829 exp->expType = op1->type;
6831 op1->type->refCount++;
6836 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6838 unsigned char value2 = op2->uc;
6841 exp->string = PrintUChar(op1->uc -= value2);
6844 exp->expType = op1->type;
6846 op1->type->refCount++;
6851 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6853 float value2 = op2->f;
6856 exp->string = PrintFloat(op1->f -= value2);
6859 exp->expType = op1->type;
6861 op1->type->refCount++;
6866 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6868 double value2 = op2->d;
6871 exp->string = PrintDouble(op1->d -= value2);
6874 exp->expType = op1->type;
6876 op1->type->refCount++;
6881 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6883 int value2 = op2->i;
6886 exp->string = PrintInt(op1->i *= value2);
6889 exp->expType = op1->type;
6891 op1->type->refCount++;
6896 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6898 unsigned int value2 = op2->ui;
6901 exp->string = PrintUInt(op1->ui *= value2);
6904 exp->expType = op1->type;
6906 op1->type->refCount++;
6911 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6913 short value2 = op2->s;
6916 exp->string = PrintShort(op1->s *= value2);
6919 exp->expType = op1->type;
6921 op1->type->refCount++;
6926 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6928 unsigned short value2 = op2->us;
6931 exp->string = PrintUShort(op1->us *= value2);
6934 exp->expType = op1->type;
6936 op1->type->refCount++;
6941 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6943 char value2 = op2->c;
6946 exp->string = PrintChar(op1->c *= value2);
6949 exp->expType = op1->type;
6951 op1->type->refCount++;
6956 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6958 unsigned char value2 = op2->uc;
6961 exp->string = PrintUChar(op1->uc *= value2);
6964 exp->expType = op1->type;
6966 op1->type->refCount++;
6971 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6973 float value2 = op2->f;
6976 exp->string = PrintFloat(op1->f *= value2);
6979 exp->expType = op1->type;
6981 op1->type->refCount++;
6986 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6988 double value2 = op2->d;
6991 exp->string = PrintDouble(op1->d *= value2);
6994 exp->expType = op1->type;
6996 op1->type->refCount++;
7001 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7003 int value2 = op2->i;
7006 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7009 exp->expType = op1->type;
7011 op1->type->refCount++;
7016 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7018 unsigned int value2 = op2->ui;
7021 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7024 exp->expType = op1->type;
7026 op1->type->refCount++;
7031 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7033 short value2 = op2->s;
7036 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7039 exp->expType = op1->type;
7041 op1->type->refCount++;
7046 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7048 unsigned short value2 = op2->us;
7051 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7054 exp->expType = op1->type;
7056 op1->type->refCount++;
7061 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7063 char value2 = op2->c;
7066 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7069 exp->expType = op1->type;
7071 op1->type->refCount++;
7076 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7078 unsigned char value2 = op2->uc;
7081 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7084 exp->expType = op1->type;
7086 op1->type->refCount++;
7091 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7093 float value2 = op2->f;
7096 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7099 exp->expType = op1->type;
7101 op1->type->refCount++;
7106 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7108 double value2 = op2->d;
7111 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7114 exp->expType = op1->type;
7116 op1->type->refCount++;
7121 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7123 int value2 = op2->i;
7126 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7129 exp->expType = op1->type;
7131 op1->type->refCount++;
7136 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7138 unsigned int value2 = op2->ui;
7141 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7144 exp->expType = op1->type;
7146 op1->type->refCount++;
7151 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7153 short value2 = op2->s;
7156 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7159 exp->expType = op1->type;
7161 op1->type->refCount++;
7166 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7168 unsigned short value2 = op2->us;
7171 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7174 exp->expType = op1->type;
7176 op1->type->refCount++;
7181 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7183 char value2 = op2->c;
7186 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7189 exp->expType = op1->type;
7191 op1->type->refCount++;
7196 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7198 unsigned char value2 = op2->uc;
7201 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7204 exp->expType = op1->type;
7206 op1->type->refCount++;
7211 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7213 int value2 = op2->i;
7216 exp->string = PrintInt(op1->i & value2);
7219 exp->expType = op1->type;
7221 op1->type->refCount++;
7226 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7228 unsigned int value2 = op2->ui;
7231 exp->string = PrintUInt(op1->ui & value2);
7234 exp->expType = op1->type;
7236 op1->type->refCount++;
7241 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7243 short value2 = op2->s;
7246 exp->string = PrintShort(op1->s & value2);
7249 exp->expType = op1->type;
7251 op1->type->refCount++;
7256 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7258 unsigned short value2 = op2->us;
7261 exp->string = PrintUShort(op1->us & value2);
7264 exp->expType = op1->type;
7266 op1->type->refCount++;
7271 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7273 char value2 = op2->c;
7276 exp->string = PrintChar(op1->c & value2);
7279 exp->expType = op1->type;
7281 op1->type->refCount++;
7286 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7288 unsigned char value2 = op2->uc;
7291 exp->string = PrintUChar(op1->uc & value2);
7294 exp->expType = op1->type;
7296 op1->type->refCount++;
7301 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7303 int value2 = op2->i;
7306 exp->string = PrintInt(op1->i | value2);
7309 exp->expType = op1->type;
7311 op1->type->refCount++;
7316 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7318 unsigned int value2 = op2->ui;
7321 exp->string = PrintUInt(op1->ui | value2);
7324 exp->expType = op1->type;
7326 op1->type->refCount++;
7331 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7333 short value2 = op2->s;
7336 exp->string = PrintShort(op1->s | value2);
7339 exp->expType = op1->type;
7341 op1->type->refCount++;
7346 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7348 unsigned short value2 = op2->us;
7351 exp->string = PrintUShort(op1->us | value2);
7354 exp->expType = op1->type;
7356 op1->type->refCount++;
7361 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7363 char value2 = op2->c;
7366 exp->string = PrintChar(op1->c | value2);
7369 exp->expType = op1->type;
7371 op1->type->refCount++;
7376 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7378 unsigned char value2 = op2->uc;
7381 exp->string = PrintUChar(op1->uc | value2);
7384 exp->expType = op1->type;
7386 op1->type->refCount++;
7391 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7393 int value2 = op2->i;
7396 exp->string = PrintInt(op1->i ^ value2);
7399 exp->expType = op1->type;
7401 op1->type->refCount++;
7406 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7408 unsigned int value2 = op2->ui;
7411 exp->string = PrintUInt(op1->ui ^ value2);
7414 exp->expType = op1->type;
7416 op1->type->refCount++;
7421 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7423 short value2 = op2->s;
7426 exp->string = PrintShort(op1->s ^ value2);
7429 exp->expType = op1->type;
7431 op1->type->refCount++;
7436 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7438 unsigned short value2 = op2->us;
7441 exp->string = PrintUShort(op1->us ^ value2);
7444 exp->expType = op1->type;
7446 op1->type->refCount++;
7451 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7453 char value2 = op2->c;
7456 exp->string = PrintChar(op1->c ^ value2);
7459 exp->expType = op1->type;
7461 op1->type->refCount++;
7466 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7468 unsigned char value2 = op2->uc;
7471 exp->string = PrintUChar(op1->uc ^ value2);
7474 exp->expType = op1->type;
7476 op1->type->refCount++;
7481 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7483 int value2 = op2->i;
7486 exp->string = PrintInt(op1->i << value2);
7489 exp->expType = op1->type;
7491 op1->type->refCount++;
7496 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7498 unsigned int value2 = op2->ui;
7501 exp->string = PrintUInt(op1->ui << value2);
7504 exp->expType = op1->type;
7506 op1->type->refCount++;
7511 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7513 short value2 = op2->s;
7516 exp->string = PrintShort(op1->s << value2);
7519 exp->expType = op1->type;
7521 op1->type->refCount++;
7526 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7528 unsigned short value2 = op2->us;
7531 exp->string = PrintUShort(op1->us << value2);
7534 exp->expType = op1->type;
7536 op1->type->refCount++;
7541 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7543 char value2 = op2->c;
7546 exp->string = PrintChar(op1->c << value2);
7549 exp->expType = op1->type;
7551 op1->type->refCount++;
7556 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7558 unsigned char value2 = op2->uc;
7561 exp->string = PrintUChar(op1->uc << value2);
7564 exp->expType = op1->type;
7566 op1->type->refCount++;
7571 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7573 int value2 = op2->i;
7576 exp->string = PrintInt(op1->i >> value2);
7579 exp->expType = op1->type;
7581 op1->type->refCount++;
7586 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7588 unsigned int value2 = op2->ui;
7591 exp->string = PrintUInt(op1->ui >> value2);
7594 exp->expType = op1->type;
7596 op1->type->refCount++;
7601 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7603 short value2 = op2->s;
7606 exp->string = PrintShort(op1->s >> value2);
7609 exp->expType = op1->type;
7611 op1->type->refCount++;
7616 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7618 unsigned short value2 = op2->us;
7621 exp->string = PrintUShort(op1->us >> value2);
7624 exp->expType = op1->type;
7626 op1->type->refCount++;
7631 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7633 char value2 = op2->c;
7636 exp->string = PrintChar(op1->c >> value2);
7639 exp->expType = op1->type;
7641 op1->type->refCount++;
7646 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7648 unsigned char value2 = op2->uc;
7651 exp->string = PrintUChar(op1->uc >> value2);
7654 exp->expType = op1->type;
7656 op1->type->refCount++;
7661 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7664 exp->string = PrintInt((~op1->i));
7667 exp->expType = op1->type;
7669 op1->type->refCount++;
7674 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7677 exp->string = PrintUInt((unsigned int)(~op1->ui));
7680 exp->expType = op1->type;
7682 op1->type->refCount++;
7687 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7690 exp->string = PrintShort((short)(~op1->s));
7693 exp->expType = op1->type;
7695 op1->type->refCount++;
7700 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7703 exp->string = PrintUShort((unsigned short)(~op1->us));
7706 exp->expType = op1->type;
7708 op1->type->refCount++;
7713 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7716 exp->string = PrintChar((char)(~op1->c));
7719 exp->expType = op1->type;
7721 op1->type->refCount++;
7726 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7729 exp->string = PrintUChar((unsigned char)(~op1->uc));
7732 exp->expType = op1->type;
7734 op1->type->refCount++;
7739 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7741 int value2 = op2->i;
7744 exp->string = PrintInt(op1->i &= value2);
7747 exp->expType = op1->type;
7749 op1->type->refCount++;
7754 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7756 unsigned int value2 = op2->ui;
7759 exp->string = PrintUInt(op1->ui &= value2);
7762 exp->expType = op1->type;
7764 op1->type->refCount++;
7769 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 short value2 = op2->s;
7774 exp->string = PrintShort(op1->s &= value2);
7777 exp->expType = op1->type;
7779 op1->type->refCount++;
7784 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 unsigned short value2 = op2->us;
7789 exp->string = PrintUShort(op1->us &= value2);
7792 exp->expType = op1->type;
7794 op1->type->refCount++;
7799 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 char value2 = op2->c;
7804 exp->string = PrintChar(op1->c &= value2);
7807 exp->expType = op1->type;
7809 op1->type->refCount++;
7814 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 unsigned char value2 = op2->uc;
7819 exp->string = PrintUChar(op1->uc &= value2);
7822 exp->expType = op1->type;
7824 op1->type->refCount++;
7829 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 int value2 = op2->i;
7834 exp->string = PrintInt(op1->i |= value2);
7837 exp->expType = op1->type;
7839 op1->type->refCount++;
7844 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 unsigned int value2 = op2->ui;
7849 exp->string = PrintUInt(op1->ui |= value2);
7852 exp->expType = op1->type;
7854 op1->type->refCount++;
7859 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 short value2 = op2->s;
7864 exp->string = PrintShort(op1->s |= value2);
7867 exp->expType = op1->type;
7869 op1->type->refCount++;
7874 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7876 unsigned short value2 = op2->us;
7879 exp->string = PrintUShort(op1->us |= value2);
7882 exp->expType = op1->type;
7884 op1->type->refCount++;
7889 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7891 char value2 = op2->c;
7894 exp->string = PrintChar(op1->c |= value2);
7897 exp->expType = op1->type;
7899 op1->type->refCount++;
7904 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7906 unsigned char value2 = op2->uc;
7909 exp->string = PrintUChar(op1->uc |= value2);
7912 exp->expType = op1->type;
7914 op1->type->refCount++;
7919 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7921 int value2 = op2->i;
7924 exp->string = PrintInt(op1->i ^= value2);
7927 exp->expType = op1->type;
7929 op1->type->refCount++;
7934 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7936 unsigned int value2 = op2->ui;
7939 exp->string = PrintUInt(op1->ui ^= value2);
7942 exp->expType = op1->type;
7944 op1->type->refCount++;
7949 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7951 short value2 = op2->s;
7954 exp->string = PrintShort(op1->s ^= value2);
7957 exp->expType = op1->type;
7959 op1->type->refCount++;
7964 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7966 unsigned short value2 = op2->us;
7969 exp->string = PrintUShort(op1->us ^= value2);
7972 exp->expType = op1->type;
7974 op1->type->refCount++;
7979 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7981 char value2 = op2->c;
7984 exp->string = PrintChar(op1->c ^= value2);
7987 exp->expType = op1->type;
7989 op1->type->refCount++;
7994 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7996 unsigned char value2 = op2->uc;
7999 exp->string = PrintUChar(op1->uc ^= value2);
8002 exp->expType = op1->type;
8004 op1->type->refCount++;
8009 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8011 int value2 = op2->i;
8014 exp->string = PrintInt(op1->i <<= value2);
8017 exp->expType = op1->type;
8019 op1->type->refCount++;
8024 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8026 unsigned int value2 = op2->ui;
8029 exp->string = PrintUInt(op1->ui <<= value2);
8032 exp->expType = op1->type;
8034 op1->type->refCount++;
8039 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8041 short value2 = op2->s;
8044 exp->string = PrintShort(op1->s <<= value2);
8047 exp->expType = op1->type;
8049 op1->type->refCount++;
8054 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8056 unsigned short value2 = op2->us;
8059 exp->string = PrintUShort(op1->us <<= value2);
8062 exp->expType = op1->type;
8064 op1->type->refCount++;
8069 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8071 char value2 = op2->c;
8074 exp->string = PrintChar(op1->c <<= value2);
8077 exp->expType = op1->type;
8079 op1->type->refCount++;
8084 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8086 unsigned char value2 = op2->uc;
8089 exp->string = PrintUChar(op1->uc <<= value2);
8092 exp->expType = op1->type;
8094 op1->type->refCount++;
8099 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8101 int value2 = op2->i;
8104 exp->string = PrintInt(op1->i >>= value2);
8107 exp->expType = op1->type;
8109 op1->type->refCount++;
8114 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8116 unsigned int value2 = op2->ui;
8119 exp->string = PrintUInt(op1->ui >>= value2);
8122 exp->expType = op1->type;
8124 op1->type->refCount++;
8129 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8131 short value2 = op2->s;
8134 exp->string = PrintShort(op1->s >>= value2);
8137 exp->expType = op1->type;
8139 op1->type->refCount++;
8144 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8146 unsigned short value2 = op2->us;
8149 exp->string = PrintUShort(op1->us >>= value2);
8152 exp->expType = op1->type;
8154 op1->type->refCount++;
8159 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8161 char value2 = op2->c;
8164 exp->string = PrintChar(op1->c >>= value2);
8167 exp->expType = op1->type;
8169 op1->type->refCount++;
8174 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8176 unsigned char value2 = op2->uc;
8179 exp->string = PrintUChar(op1->uc >>= value2);
8182 exp->expType = op1->type;
8184 op1->type->refCount++;
8189 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8192 exp->string = PrintInt((int)(!op1->i));
8195 exp->expType = op1->type;
8197 op1->type->refCount++;
8202 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8205 exp->string = PrintUInt((unsigned int)(!op1->ui));
8208 exp->expType = op1->type;
8210 op1->type->refCount++;
8215 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8218 exp->string = PrintShort((short)(!op1->s));
8221 exp->expType = op1->type;
8223 op1->type->refCount++;
8228 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8231 exp->string = PrintUShort((unsigned short)(!op1->us));
8234 exp->expType = op1->type;
8236 op1->type->refCount++;
8241 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8244 exp->string = PrintChar((char)(!op1->c));
8247 exp->expType = op1->type;
8249 op1->type->refCount++;
8254 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8257 exp->string = PrintUChar((unsigned char)(!op1->uc));
8260 exp->expType = op1->type;
8262 op1->type->refCount++;
8267 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8269 int value2 = op2->i;
8272 exp->string = PrintInt(op1->i == value2);
8275 exp->expType = op1->type;
8277 op1->type->refCount++;
8282 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8284 unsigned int value2 = op2->ui;
8287 exp->string = PrintUInt(op1->ui == value2);
8290 exp->expType = op1->type;
8292 op1->type->refCount++;
8297 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8299 short value2 = op2->s;
8302 exp->string = PrintShort(op1->s == value2);
8305 exp->expType = op1->type;
8307 op1->type->refCount++;
8312 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8314 unsigned short value2 = op2->us;
8317 exp->string = PrintUShort(op1->us == value2);
8320 exp->expType = op1->type;
8322 op1->type->refCount++;
8327 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8329 char value2 = op2->c;
8332 exp->string = PrintChar(op1->c == value2);
8335 exp->expType = op1->type;
8337 op1->type->refCount++;
8342 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8344 unsigned char value2 = op2->uc;
8347 exp->string = PrintUChar(op1->uc == value2);
8350 exp->expType = op1->type;
8352 op1->type->refCount++;
8357 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8359 float value2 = op2->f;
8362 exp->string = PrintFloat(op1->f == value2);
8365 exp->expType = op1->type;
8367 op1->type->refCount++;
8372 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8374 double value2 = op2->d;
8377 exp->string = PrintDouble(op1->d == value2);
8380 exp->expType = op1->type;
8382 op1->type->refCount++;
8387 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8389 int value2 = op2->i;
8392 exp->string = PrintInt(op1->i != value2);
8395 exp->expType = op1->type;
8397 op1->type->refCount++;
8402 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8404 unsigned int value2 = op2->ui;
8407 exp->string = PrintUInt(op1->ui != value2);
8410 exp->expType = op1->type;
8412 op1->type->refCount++;
8417 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8419 short value2 = op2->s;
8422 exp->string = PrintShort(op1->s != value2);
8425 exp->expType = op1->type;
8427 op1->type->refCount++;
8432 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8434 unsigned short value2 = op2->us;
8437 exp->string = PrintUShort(op1->us != value2);
8440 exp->expType = op1->type;
8442 op1->type->refCount++;
8447 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8449 char value2 = op2->c;
8452 exp->string = PrintChar(op1->c != value2);
8455 exp->expType = op1->type;
8457 op1->type->refCount++;
8462 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8464 unsigned char value2 = op2->uc;
8467 exp->string = PrintUChar(op1->uc != value2);
8470 exp->expType = op1->type;
8472 op1->type->refCount++;
8477 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8479 float value2 = op2->f;
8482 exp->string = PrintFloat(op1->f != value2);
8485 exp->expType = op1->type;
8487 op1->type->refCount++;
8492 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8494 double value2 = op2->d;
8497 exp->string = PrintDouble(op1->d != value2);
8500 exp->expType = op1->type;
8502 op1->type->refCount++;
8507 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8509 int value2 = op2->i;
8512 exp->string = PrintInt(op1->i && value2);
8515 exp->expType = op1->type;
8517 op1->type->refCount++;
8522 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8524 unsigned int value2 = op2->ui;
8527 exp->string = PrintUInt(op1->ui && value2);
8530 exp->expType = op1->type;
8532 op1->type->refCount++;
8537 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8539 short value2 = op2->s;
8542 exp->string = PrintShort(op1->s && value2);
8545 exp->expType = op1->type;
8547 op1->type->refCount++;
8552 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8554 unsigned short value2 = op2->us;
8557 exp->string = PrintUShort(op1->us && value2);
8560 exp->expType = op1->type;
8562 op1->type->refCount++;
8567 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8569 char value2 = op2->c;
8572 exp->string = PrintChar(op1->c && value2);
8575 exp->expType = op1->type;
8577 op1->type->refCount++;
8582 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8584 unsigned char value2 = op2->uc;
8587 exp->string = PrintUChar(op1->uc && value2);
8590 exp->expType = op1->type;
8592 op1->type->refCount++;
8597 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8599 float value2 = op2->f;
8602 exp->string = PrintFloat(op1->f && value2);
8605 exp->expType = op1->type;
8607 op1->type->refCount++;
8612 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8614 double value2 = op2->d;
8617 exp->string = PrintDouble(op1->d && value2);
8620 exp->expType = op1->type;
8622 op1->type->refCount++;
8627 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8629 int value2 = op2->i;
8632 exp->string = PrintInt(op1->i || value2);
8635 exp->expType = op1->type;
8637 op1->type->refCount++;
8642 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8644 unsigned int value2 = op2->ui;
8647 exp->string = PrintUInt(op1->ui || value2);
8650 exp->expType = op1->type;
8652 op1->type->refCount++;
8657 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8659 short value2 = op2->s;
8662 exp->string = PrintShort(op1->s || value2);
8665 exp->expType = op1->type;
8667 op1->type->refCount++;
8672 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8674 unsigned short value2 = op2->us;
8677 exp->string = PrintUShort(op1->us || value2);
8680 exp->expType = op1->type;
8682 op1->type->refCount++;
8687 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8689 char value2 = op2->c;
8692 exp->string = PrintChar(op1->c || value2);
8695 exp->expType = op1->type;
8697 op1->type->refCount++;
8702 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8704 unsigned char value2 = op2->uc;
8707 exp->string = PrintUChar(op1->uc || value2);
8710 exp->expType = op1->type;
8712 op1->type->refCount++;
8717 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8719 float value2 = op2->f;
8722 exp->string = PrintFloat(op1->f || value2);
8725 exp->expType = op1->type;
8727 op1->type->refCount++;
8732 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 double value2 = op2->d;
8737 exp->string = PrintDouble(op1->d || value2);
8740 exp->expType = op1->type;
8742 op1->type->refCount++;
8747 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 int value2 = op2->i;
8752 exp->string = PrintInt(op1->i > value2);
8755 exp->expType = op1->type;
8757 op1->type->refCount++;
8762 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 unsigned int value2 = op2->ui;
8767 exp->string = PrintUInt(op1->ui > value2);
8770 exp->expType = op1->type;
8772 op1->type->refCount++;
8777 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 short value2 = op2->s;
8782 exp->string = PrintShort(op1->s > value2);
8785 exp->expType = op1->type;
8787 op1->type->refCount++;
8792 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 unsigned short value2 = op2->us;
8797 exp->string = PrintUShort(op1->us > value2);
8800 exp->expType = op1->type;
8802 op1->type->refCount++;
8807 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 char value2 = op2->c;
8812 exp->string = PrintChar(op1->c > value2);
8815 exp->expType = op1->type;
8817 op1->type->refCount++;
8822 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 unsigned char value2 = op2->uc;
8827 exp->string = PrintUChar(op1->uc > value2);
8830 exp->expType = op1->type;
8832 op1->type->refCount++;
8837 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 float value2 = op2->f;
8842 exp->string = PrintFloat(op1->f > value2);
8845 exp->expType = op1->type;
8847 op1->type->refCount++;
8852 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 double value2 = op2->d;
8857 exp->string = PrintDouble(op1->d > value2);
8860 exp->expType = op1->type;
8862 op1->type->refCount++;
8867 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 int value2 = op2->i;
8872 exp->string = PrintInt(op1->i < value2);
8875 exp->expType = op1->type;
8877 op1->type->refCount++;
8882 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 unsigned int value2 = op2->ui;
8887 exp->string = PrintUInt(op1->ui < value2);
8890 exp->expType = op1->type;
8892 op1->type->refCount++;
8897 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 short value2 = op2->s;
8902 exp->string = PrintShort(op1->s < value2);
8905 exp->expType = op1->type;
8907 op1->type->refCount++;
8912 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8914 unsigned short value2 = op2->us;
8917 exp->string = PrintUShort(op1->us < value2);
8920 exp->expType = op1->type;
8922 op1->type->refCount++;
8927 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8929 char value2 = op2->c;
8932 exp->string = PrintChar(op1->c < value2);
8935 exp->expType = op1->type;
8937 op1->type->refCount++;
8942 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8944 unsigned char value2 = op2->uc;
8947 exp->string = PrintUChar(op1->uc < value2);
8950 exp->expType = op1->type;
8952 op1->type->refCount++;
8957 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8959 float value2 = op2->f;
8962 exp->string = PrintFloat(op1->f < value2);
8965 exp->expType = op1->type;
8967 op1->type->refCount++;
8972 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8974 double value2 = op2->d;
8977 exp->string = PrintDouble(op1->d < value2);
8980 exp->expType = op1->type;
8982 op1->type->refCount++;
8987 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8989 int value2 = op2->i;
8992 exp->string = PrintInt(op1->i >= value2);
8995 exp->expType = op1->type;
8997 op1->type->refCount++;
9002 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9004 unsigned int value2 = op2->ui;
9007 exp->string = PrintUInt(op1->ui >= value2);
9010 exp->expType = op1->type;
9012 op1->type->refCount++;
9017 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9019 short value2 = op2->s;
9022 exp->string = PrintShort(op1->s >= value2);
9025 exp->expType = op1->type;
9027 op1->type->refCount++;
9032 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9034 unsigned short value2 = op2->us;
9037 exp->string = PrintUShort(op1->us >= value2);
9040 exp->expType = op1->type;
9042 op1->type->refCount++;
9047 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9049 char value2 = op2->c;
9052 exp->string = PrintChar(op1->c >= value2);
9055 exp->expType = op1->type;
9057 op1->type->refCount++;
9062 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9064 unsigned char value2 = op2->uc;
9067 exp->string = PrintUChar(op1->uc >= value2);
9070 exp->expType = op1->type;
9072 op1->type->refCount++;
9077 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9079 float value2 = op2->f;
9082 exp->string = PrintFloat(op1->f >= value2);
9085 exp->expType = op1->type;
9087 op1->type->refCount++;
9092 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9094 double value2 = op2->d;
9097 exp->string = PrintDouble(op1->d >= value2);
9100 exp->expType = op1->type;
9102 op1->type->refCount++;
9107 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9109 int value2 = op2->i;
9112 exp->string = PrintInt(op1->i <= value2);
9115 exp->expType = op1->type;
9117 op1->type->refCount++;
9122 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9124 unsigned int value2 = op2->ui;
9127 exp->string = PrintUInt(op1->ui <= value2);
9130 exp->expType = op1->type;
9132 op1->type->refCount++;
9137 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9139 short value2 = op2->s;
9142 exp->string = PrintShort(op1->s <= value2);
9145 exp->expType = op1->type;
9147 op1->type->refCount++;
9152 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9154 unsigned short value2 = op2->us;
9157 exp->string = PrintUShort(op1->us <= value2);
9160 exp->expType = op1->type;
9162 op1->type->refCount++;
9167 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9169 char value2 = op2->c;
9172 exp->string = PrintChar(op1->c <= value2);
9175 exp->expType = op1->type;
9177 op1->type->refCount++;
9182 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9184 unsigned char value2 = op2->uc;
9187 exp->string = PrintUChar(op1->uc <= value2);
9190 exp->expType = op1->type;
9192 op1->type->refCount++;
9197 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9199 float value2 = op2->f;
9202 exp->string = PrintFloat(op1->f <= value2);
9205 exp->expType = op1->type;
9207 op1->type->refCount++;
9212 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9214 double value2 = op2->d;
9217 exp->string = PrintDouble(op1->d <= value2);
9220 exp->expType = op1->type;
9222 op1->type->refCount++;
9227 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9230 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9233 exp->expType = op1->type;
9235 op1->type->refCount++;
9240 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9243 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9246 exp->expType = op1->type;
9248 op1->type->refCount++;
9253 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9256 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9259 exp->expType = op1->type;
9261 op1->type->refCount++;
9266 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9269 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9272 exp->expType = op1->type;
9274 op1->type->refCount++;
9279 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9282 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9285 exp->expType = op1->type;
9287 op1->type->refCount++;
9292 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9295 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9298 exp->expType = op1->type;
9300 op1->type->refCount++;
9305 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9308 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9311 exp->expType = op1->type;
9313 op1->type->refCount++;
9318 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9321 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9324 exp->expType = op1->type;
9326 op1->type->refCount++;
9331 struct OpTable intOps =
9333 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
9336 struct OpTable uintOps =
9338 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
9341 struct OpTable shortOps =
9343 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
9346 struct OpTable ushortOps =
9348 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
9351 struct OpTable floatOps =
9353 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
9356 struct OpTable doubleOps =
9358 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
9361 struct OpTable charOps =
9363 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
9366 struct OpTable ucharOps =
9368 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
9371 void ReadString(char * output, char * string)
9373 int len = strlen(string);
9375 unsigned int quoted = 0x0, escaped = 0x0;
9377 for(c = 0; c < len; c++)
9379 char ch = string[c];
9435 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9437 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9439 extern double strtod(char * , char * * );
9441 struct Operand GetOperand(struct Expression * exp)
9447 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
9450 struct Type * type = exp->expType;
9454 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9456 if(!type->_class->registered->dataType)
9457 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9458 type = type->_class->registered->dataType;
9460 op.kind = type->kind;
9461 op.type = exp->expType;
9462 if(exp->isConstant && exp->type == 2)
9469 if(exp->constant[0] == '\'')
9470 op.c = exp->constant[1];
9471 else if(type->isSigned)
9473 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9478 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9486 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9491 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9499 op.i = strtol(exp->constant, (((void *)0)), 0);
9504 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9512 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9517 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9525 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9530 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9538 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9543 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9549 op.f = (float)strtod(exp->constant, (((void *)0)));
9553 op.d = (double)strtod(exp->constant, (((void *)0)));
9559 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9569 int __ecereVMethodID_class_OnGetString;
9571 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9573 static void UnusedFunction()
9577 ((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);
9580 extern int __ecereVMethodID_class_OnGetString;
9582 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9584 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9586 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9588 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9589 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9592 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9593 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9595 void * ptr = inst->data + dataMember->offset + offset;
9596 char * result = (((void *)0));
9598 exp->loc = member->loc = inst->loc;
9599 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9600 if(!dataMember->dataType)
9601 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9602 type = dataMember->dataType;
9605 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9607 if(_class->type == 4)
9609 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9613 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9614 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9616 for(item = e->values.first; item; item = item->next)
9618 if((int)item->data == *(int *)ptr)
9620 result = item->name;
9626 exp->identifier = MkIdentifier(result);
9628 exp->destType = MkClassType(_class->fullName);
9629 ProcessExpressionType(exp);
9633 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9635 if(!_class->dataType)
9636 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9637 type = _class->dataType;
9646 FreeExpContents(exp);
9647 exp->constant = PrintFloat(*(float *)ptr);
9653 FreeExpContents(exp);
9654 exp->constant = PrintDouble(*(double *)ptr);
9660 FreeExpContents(exp);
9661 exp->constant = PrintInt(*(int *)ptr);
9667 FreeExpContents(exp);
9668 exp->constant = PrintInt64(*(long long *)ptr);
9674 FreeExpContents(exp);
9675 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9681 FreeExpContents(exp);
9682 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9687 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9690 ListAdd(memberList, member);
9692 if(parentDataMember->type == 1)
9697 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9699 void PopulateInstance(struct Instantiation * inst)
9701 struct Symbol * classSym = inst->_class->symbol;
9702 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9703 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9704 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9707 inst->members = MkListOne(MkMembersInitList(memberList));
9709 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
9710 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9712 if(!dataMember->isProperty)
9714 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9715 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9718 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9719 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9721 void * ptr = inst->data + dataMember->offset;
9722 char * result = (((void *)0));
9724 exp->loc = member->loc = inst->loc;
9725 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9726 if(!dataMember->dataType)
9727 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9728 type = dataMember->dataType;
9731 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9733 if(_class->type == 4)
9735 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9739 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9740 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9742 for(item = e->values.first; item; item = item->next)
9744 if((int)item->data == *(int *)ptr)
9746 result = item->name;
9753 exp->identifier = MkIdentifier(result);
9755 exp->destType = MkClassType(_class->fullName);
9756 ProcessExpressionType(exp);
9759 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9761 if(!_class->dataType)
9762 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9763 type = _class->dataType;
9772 exp->constant = PrintFloat(*(float *)ptr);
9778 exp->constant = PrintDouble(*(double *)ptr);
9784 exp->constant = PrintInt(*(int *)ptr);
9790 exp->constant = PrintInt64(*(long long *)ptr);
9796 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9801 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9804 ListAdd(memberList, member);
9810 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);
9812 extern void FreeInstance(struct Instantiation * inst);
9814 void ComputeInstantiation(struct Expression * exp)
9816 struct Instantiation * inst = exp->instance;
9817 struct MembersInit * members;
9818 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9819 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9820 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9821 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9822 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9823 int subMemberStackPos = 0;
9826 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9830 if(_class->type == 0 || _class->type == 5)
9832 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9833 if(_class->type == 0)
9834 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
9837 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9841 for(members = (*inst->members).first; members; members = members->next)
9843 switch(members->type)
9847 if(members->dataMembers)
9849 struct MemberInit * member;
9851 for(member = (*members->dataMembers).first; member; member = member->next)
9853 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9854 unsigned int found = 0x0;
9855 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9856 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9857 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9858 unsigned int dataMemberOffset;
9862 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9865 if(curMember->isProperty)
9866 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9869 dataMember = curMember;
9870 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9871 if(_class->type == 0)
9872 dataMemberOffset += _class->base->structSize;
9879 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9883 if(prop->memberAccess == 1)
9885 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9886 curClass = prop->_class;
9891 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9892 int _subMemberStackPos = 0;
9894 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9898 if(dataMember->memberAccess == 1)
9900 curMember = dataMember;
9901 curClass = dataMember->_class;
9902 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
9903 subMemberStackPos = _subMemberStackPos;
9908 if(found && member->initializer && member->initializer->type == 0)
9910 struct Expression * value = member->initializer->exp;
9911 struct Type * type = (((void *)0));
9912 unsigned int deepMember = 0x0;
9916 type = prop->dataType;
9920 if(!dataMember->dataType)
9921 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9922 type = dataMember->dataType;
9924 if(ident && ident->next)
9927 for(ident = ident->next; ident && type; ident = ident->next)
9931 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9933 type = prop->dataType;
9936 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9938 type = dataMember->dataType;
9941 else if(type->kind == 9 || type->kind == 10)
9943 struct Type * memberType;
9945 for(memberType = type->members.first; memberType; memberType = memberType->next)
9947 if(!strcmp(memberType->name, ident->string))
9958 FreeType(value->destType);
9959 value->destType = type;
9962 ComputeExpression(value);
9964 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9968 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9970 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9972 if(!_class->dataType)
9973 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9974 type = _class->dataType;
9979 void * ptr = inst->data + dataMemberOffset;
9981 if(value->type == 2)
9987 GetInt(value, (int *)ptr);
9992 GetInt64(value, (long long *)ptr);
9997 GetIntPtr(value, (intptr_t *)ptr);
10002 GetIntSize(value, (ssize_t *)ptr);
10007 GetFloat(value, (float *)ptr);
10012 GetDouble(value, (double *)ptr);
10017 else if(value->type == 1)
10019 if(type->kind == 8)
10021 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10023 if(_class->type == 1)
10025 ComputeTypeSize(type);
10026 if(value->instance->data)
10027 memcpy(ptr, value->instance->data, type->size);
10034 if(value->type == 1 && value->instance->data)
10036 if(type->kind == 8)
10038 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10040 if(_class && (_class->type != 0 || __ecereNameSpace__ecere__com__eClass_IsDerived(((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)value->instance->data))->_class, _class)))
10042 void (* Set)(void *, void *) = (void *)prop->Set;
10044 Set(inst->data, value->instance->data);
10045 PopulateInstance(inst);
10049 else if(value->type == 2)
10055 void (* Set)(void *, double) = (void *)prop->Set;
10057 Set(inst->data, strtod(value->constant, (((void *)0))));
10062 void (* Set)(void *, float) = (void *)prop->Set;
10064 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
10069 void (* Set)(void *, int) = (void *)prop->Set;
10071 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
10076 void (* Set)(void *, long long) = (void *)prop->Set;
10078 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10083 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10085 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10090 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10092 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10097 else if(value->type == 3)
10101 ReadString(temp, value->string);
10102 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10106 else if(!deepMember && type && _class->type == 3)
10110 if(value->type == 2)
10112 if(type->kind == 8)
10114 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10116 if(_class->type == 3)
10118 if(!_class->dataType)
10119 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10120 type = _class->dataType;
10128 float (* Set)(float) = (void *)prop->Set;
10130 GetFloat(member->initializer->exp, &fValue);
10131 exp->constant = PrintFloat(Set(fValue));
10138 double (* Set)(double) = (void *)prop->Set;
10140 GetDouble(member->initializer->exp, &dValue);
10141 exp->constant = PrintDouble(Set(dValue));
10149 else if(!deepMember && type && _class->type == 2)
10153 if(value->type == 1 && value->instance->data)
10155 unsigned int (* Set)(void *) = (void *)prop->Set;
10157 bits = Set(value->instance->data);
10159 else if(value->type == 2)
10163 else if(dataMember)
10165 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10166 struct Type * type;
10169 GetInt(value, &part);
10170 bits = (bits & ~bitMember->mask);
10171 if(!bitMember->dataType)
10172 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10173 type = bitMember->dataType;
10174 if(type->kind == 8 && type->_class && type->_class->registered)
10176 if(!type->_class->registered->dataType)
10177 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10178 type = type->_class->registered->dataType;
10185 bits |= ((char)part << bitMember->pos);
10187 bits |= ((unsigned char)part << bitMember->pos);
10191 bits |= ((short)part << bitMember->pos);
10193 bits |= ((unsigned short)part << bitMember->pos);
10198 bits |= (part << bitMember->pos);
10200 bits |= ((unsigned int)part << bitMember->pos);
10204 bits |= ((long long)part << bitMember->pos);
10206 bits |= ((uint64)part << bitMember->pos);
10211 bits |= ((intptr_t)part << bitMember->pos);
10215 bits |= ((uintptr_t)part << bitMember->pos);
10221 bits |= ((ssize_t)part << bitMember->pos);
10225 bits |= ((size_t)part << bitMember->pos);
10234 if(_class && _class->type == 3)
10236 ComputeExpression(member->initializer->exp);
10237 exp->constant = member->initializer->exp->constant;
10239 member->initializer->exp->constant = (((void *)0));
10249 if(_class && _class->type == 2)
10251 exp->constant = PrintHexUInt(bits);
10256 FreeInstance(inst);
10260 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10262 if(exp->op.op == SIZEOF)
10264 FreeExpContents(exp);
10266 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10276 struct Expression * exp2 = exp->op.exp2;
10278 exp->op.exp2 = (((void *)0));
10279 FreeExpContents(exp);
10280 FreeType(exp->expType);
10281 FreeType(exp->destType);
10283 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10289 FreeExpContents(exp);
10290 op1->ops.Neg(exp, op1);
10294 if(op1->ops.BitNot)
10296 FreeExpContents(exp);
10297 op1->ops.BitNot(exp, op1);
10303 FreeExpContents(exp);
10304 op1->ops.Not(exp, op1);
10316 FreeExpContents(exp);
10317 op1->ops.Add(exp, op1, op2);
10323 FreeExpContents(exp);
10324 op1->ops.Sub(exp, op1, op2);
10330 FreeExpContents(exp);
10331 op1->ops.Mul(exp, op1, op2);
10337 FreeExpContents(exp);
10338 op1->ops.Div(exp, op1, op2);
10344 FreeExpContents(exp);
10345 op1->ops.Mod(exp, op1, op2);
10351 if(op1->ops.BitAnd)
10353 FreeExpContents(exp);
10354 op1->ops.BitAnd(exp, op1, op2);
10361 FreeExpContents(exp);
10362 op1->ops.BitOr(exp, op1, op2);
10366 if(op1->ops.BitXor)
10368 FreeExpContents(exp);
10369 op1->ops.BitXor(exp, op1, op2);
10373 if(op1->ops.LShift)
10375 FreeExpContents(exp);
10376 op1->ops.LShift(exp, op1, op2);
10380 if(op1->ops.RShift)
10382 FreeExpContents(exp);
10383 op1->ops.RShift(exp, op1, op2);
10389 FreeExpContents(exp);
10390 op1->ops.Equ(exp, op1, op2);
10396 FreeExpContents(exp);
10397 op1->ops.Nqu(exp, op1, op2);
10403 FreeExpContents(exp);
10404 op1->ops.And(exp, op1, op2);
10410 FreeExpContents(exp);
10411 op1->ops.Or(exp, op1, op2);
10417 FreeExpContents(exp);
10418 op1->ops.Grt(exp, op1, op2);
10424 FreeExpContents(exp);
10425 op1->ops.Sma(exp, op1, op2);
10429 if(op1->ops.GrtEqu)
10431 FreeExpContents(exp);
10432 op1->ops.GrtEqu(exp, op1, op2);
10436 if(op1->ops.SmaEqu)
10438 FreeExpContents(exp);
10439 op1->ops.SmaEqu(exp, op1, op2);
10447 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
10449 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10451 void ComputeExpression(struct Expression * exp)
10453 char expString[10240];
10455 expString[0] = '\0';
10460 ComputeInstantiation(exp);
10465 struct Expression * exp1, * exp2 = (((void *)0));
10466 struct Operand op1 =
10470 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
10473 struct Operand op2 =
10477 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
10482 ComputeExpression(exp->op.exp2);
10485 ComputeExpression(exp->op.exp1);
10486 exp1 = exp->op.exp1;
10487 exp2 = exp->op.exp2;
10488 op1 = GetOperand(exp1);
10490 op1.type->refCount++;
10493 op2 = GetOperand(exp2);
10495 op2.type->refCount++;
10500 exp1 = exp->op.exp2;
10501 op1 = GetOperand(exp1);
10503 op1.type->refCount++;
10505 CallOperator(exp, exp1, exp2, &op1, &op2);
10507 FreeType(op1.type);
10509 FreeType(op2.type);
10515 struct Expression * e, * n;
10517 for(e = (*exp->list).first; e; e = n)
10522 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10524 ComputeExpression(e);
10525 FreeType(exp->expType);
10526 FreeType(exp->destType);
10528 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10529 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10540 struct Expression * memberExp = exp->member.exp;
10541 struct Identifier * memberID = exp->member.member;
10542 struct Type * type;
10544 ComputeExpression(exp->member.exp);
10545 type = exp->member.exp->expType;
10548 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)));
10549 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10550 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10551 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10553 if(type->kind == 19 && exp->member.exp->type == 26)
10554 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10558 struct Symbol * classSym;
10561 PrintTypeNoConst(type, string, 0x0, 0x1);
10562 classSym = FindClass(string);
10563 _class = classSym ? classSym->registered : (((void *)0));
10565 if(exp->member.member)
10567 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10569 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10571 if(!prop && !member && _class && exp->member.member)
10573 struct Symbol * classSym = FindClass(exp->member.member->string);
10575 convertTo = _class;
10576 _class = classSym ? classSym->registered : (((void *)0));
10577 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10583 struct Type * type = prop->dataType;
10585 if(_class->type == 3)
10587 if(type->kind == 8)
10589 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10591 if(_class->type == 3)
10593 if(!_class->dataType)
10594 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10595 type = _class->dataType;
10603 float (* Get)(float) = (void *)prop->Get;
10605 GetFloat(exp->member.exp, &value);
10606 exp->constant = PrintFloat(Get ? Get(value) : value);
10613 double (* Get)(double);
10615 GetDouble(exp->member.exp, &value);
10617 Get = (void *)prop->Set;
10619 Get = (void *)prop->Get;
10620 exp->constant = PrintDouble(Get ? Get(value) : value);
10630 struct Expression * value = exp->member.exp;
10631 struct Type * type;
10633 if(!prop->dataType)
10634 ProcessPropertyType(prop);
10635 type = prop->dataType;
10639 else if(_class->type == 1)
10645 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10647 if(propertyClass->type == 1 && value->type == 1)
10649 void (* Set)(void *, void *) = (void *)prop->Set;
10651 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10652 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10653 exp->instance->_class = MkSpecifierName(_class->fullName);
10654 exp->instance->loc = exp->loc;
10656 Set(exp->instance->data, value->instance->data);
10657 PopulateInstance(exp->instance);
10664 void (* Set)(void *, int) = (void *)prop->Set;
10666 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10667 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10668 exp->instance->_class = MkSpecifierName(_class->fullName);
10669 exp->instance->loc = exp->loc;
10671 GetInt(value, &intValue);
10672 Set(exp->instance->data, intValue);
10673 PopulateInstance(exp->instance);
10678 long long intValue;
10679 void (* Set)(void *, long long) = (void *)prop->Set;
10681 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10682 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10683 exp->instance->_class = MkSpecifierName(_class->fullName);
10684 exp->instance->loc = exp->loc;
10686 GetInt64(value, &intValue);
10687 Set(exp->instance->data, intValue);
10688 PopulateInstance(exp->instance);
10694 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10696 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10697 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10698 exp->instance->_class = MkSpecifierName(_class->fullName);
10699 exp->instance->loc = exp->loc;
10701 GetIntPtr(value, &intValue);
10702 Set(exp->instance->data, intValue);
10703 PopulateInstance(exp->instance);
10709 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10711 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10712 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10713 exp->instance->_class = MkSpecifierName(_class->fullName);
10714 exp->instance->loc = exp->loc;
10716 GetIntSize(value, &intValue);
10717 Set(exp->instance->data, intValue);
10718 PopulateInstance(exp->instance);
10723 double doubleValue;
10724 void (* Set)(void *, double) = (void *)prop->Set;
10726 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10727 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10728 exp->instance->_class = MkSpecifierName(_class->fullName);
10729 exp->instance->loc = exp->loc;
10731 GetDouble(value, &doubleValue);
10732 Set(exp->instance->data, doubleValue);
10733 PopulateInstance(exp->instance);
10738 else if(_class->type == 2)
10744 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10746 if(propertyClass->type == 1 && value->instance->data)
10748 unsigned int (* Set)(void *) = (void *)prop->Set;
10749 unsigned int bits = Set(value->instance->data);
10751 exp->constant = PrintHexUInt(bits);
10755 else if(_class->type == 2)
10757 unsigned int value;
10758 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10761 GetUInt(exp->member.exp, &value);
10763 exp->constant = PrintHexUInt(bits);
10772 if(_class->type == 2)
10774 unsigned int value;
10776 GetUInt(exp->member.exp, &value);
10781 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10783 if(_class->type == 1)
10785 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10787 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10788 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10789 exp->instance->_class = MkSpecifierName(_class->fullName);
10790 exp->instance->loc = exp->loc;
10792 Get(value, exp->instance->data);
10793 PopulateInstance(exp->instance);
10795 else if(_class->type == 2)
10797 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10798 uint64 bits = Get(value);
10800 exp->constant = PrintHexUInt64(bits);
10807 else if(_class->type == 1)
10809 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10815 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10817 if(_class->type == 1 && value)
10819 void (* Get)(void *, void *) = (void *)prop->Get;
10821 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10822 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10823 exp->instance->_class = MkSpecifierName(_class->fullName);
10824 exp->instance->loc = exp->loc;
10826 Get(value, exp->instance->data);
10827 PopulateInstance(exp->instance);
10838 exp->isConstant = 0x0;
10847 FreeExpression(memberExp);
10848 FreeIdentifier(memberID);
10854 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10856 FreeExpContents(exp);
10857 exp->constant = PrintUInt(ComputeTypeSize(type));
10864 struct Symbol * classSym = exp->_class->symbol;
10866 if(classSym && classSym->registered)
10868 if(classSym->registered->fixed)
10870 FreeSpecifier(exp->_class);
10871 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10876 char className[1024];
10878 strcpy(className, "__ecereClass_");
10879 FullClassNameCat(className, classSym->string, 0x1);
10880 MangleClassName(className);
10881 DeclareClass(classSym, className);
10882 FreeExpContents(exp);
10884 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10885 exp->member.member = MkIdentifier("structSize");
10892 struct Type * type;
10893 struct Expression * e = exp;
10895 if(exp->type == 11)
10898 ComputeExpression(exp->cast.exp);
10901 if(e && exp->expType)
10903 type = exp->expType;
10904 if(type->kind == 8)
10906 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10908 if(_class && (_class->type == 3 || _class->type == 2))
10910 if(!_class->dataType)
10911 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10912 type = _class->dataType;
10923 GetChar(e, &value);
10924 FreeExpContents(exp);
10925 exp->constant = PrintChar(value);
10930 unsigned char value;
10932 GetUChar(e, &value);
10933 FreeExpContents(exp);
10934 exp->constant = PrintUChar(value);
10943 GetShort(e, &value);
10944 FreeExpContents(exp);
10945 exp->constant = PrintShort(value);
10950 unsigned short value;
10952 GetUShort(e, &value);
10953 FreeExpContents(exp);
10954 exp->constant = PrintUShort(value);
10964 FreeExpContents(exp);
10965 exp->constant = PrintInt(value);
10970 unsigned int value;
10972 GetUInt(e, &value);
10973 FreeExpContents(exp);
10974 exp->constant = PrintUInt(value);
10983 GetInt64(e, &value);
10984 FreeExpContents(exp);
10985 exp->constant = PrintInt64(value);
10992 GetUInt64(e, &value);
10993 FreeExpContents(exp);
10994 exp->constant = PrintUInt64(value);
11003 GetIntPtr(e, &value);
11004 FreeExpContents(exp);
11005 exp->constant = PrintInt64((long long)value);
11012 GetUIntPtr(e, &value);
11013 FreeExpContents(exp);
11014 exp->constant = PrintUInt64((uint64)value);
11023 GetIntSize(e, &value);
11024 FreeExpContents(exp);
11025 exp->constant = PrintInt64((long long)value);
11032 GetUIntSize(e, &value);
11033 FreeExpContents(exp);
11034 exp->constant = PrintUInt64((uint64)value);
11042 GetFloat(e, &value);
11043 FreeExpContents(exp);
11044 exp->constant = PrintFloat(value);
11052 GetDouble(e, &value);
11053 FreeExpContents(exp);
11054 exp->constant = PrintDouble(value);
11064 struct Operand op1 =
11068 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
11071 struct Operand op2 =
11075 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
11078 struct Operand op3 =
11082 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
11087 ComputeExpression((*exp->cond.exp).last);
11088 if(exp->cond.elseExp)
11089 ComputeExpression(exp->cond.elseExp);
11091 ComputeExpression(exp->cond.cond);
11092 op1 = GetOperand(exp->cond.cond);
11094 op1.type->refCount++;
11095 op2 = GetOperand((*exp->cond.exp).last);
11097 op2.type->refCount++;
11098 op3 = GetOperand(exp->cond.elseExp);
11100 op3.type->refCount++;
11103 FreeExpContents(exp);
11104 op1.ops.Cond(exp, &op1, &op2, &op3);
11107 FreeType(op1.type);
11109 FreeType(op2.type);
11111 FreeType(op3.type);
11117 void ApplyAnyObjectLogic(struct Expression * e);
11119 extern void CopyTypeInto(struct Type * type, struct Type * src);
11121 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11123 unsigned int result = 0x1;
11127 struct __ecereNameSpace__ecere__sys__OldList converts =
11131 struct Conversion * convert;
11133 if(destType->kind == 0)
11135 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11139 for(convert = converts.first; convert; convert = convert->next)
11141 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11145 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11146 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11149 newExp->destType = (((void *)0));
11153 exp->addedThis = 0x1;
11154 exp->member.exp = newExp;
11155 FreeType(exp->member.exp->expType);
11156 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11157 exp->member.exp->expType->classObjectType = objectType;
11158 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11159 exp->member.memberType = 1;
11160 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11161 exp->needCast = 0x1;
11163 exp->expType->refCount++;
11164 ApplyAnyObjectLogic(exp->member.exp);
11170 exp->addedThis = 0x1;
11171 exp->member.exp = newExp;
11172 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11174 newExp->byReference = 0x1;
11176 FreeType(exp->member.exp->expType);
11177 exp->member.exp->expType = (((void *)0));
11178 if(convert->convert->dataType)
11180 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11181 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11182 exp->member.exp->expType->refCount = 1;
11183 exp->member.exp->expType->classObjectType = objectType;
11184 ApplyAnyObjectLogic(exp->member.exp);
11186 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11187 exp->member.memberType = 4;
11188 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11189 exp->needCast = 0x1;
11190 if(convert->resultType)
11191 convert->resultType->refCount++;
11197 FreeType(exp->expType);
11200 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11201 exp->needCast = 0x1;
11203 exp->expType->refCount++;
11207 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11208 exp->needCast = 0x1;
11209 if(convert->resultType)
11210 convert->resultType->refCount++;
11214 if(exp->isConstant && inCompiler)
11215 ComputeExpression(exp);
11216 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11218 if(!result && exp->expType && converts.count)
11220 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11222 if(!result && exp->expType && exp->destType)
11224 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))
11231 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11233 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11235 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11237 void CheckTemplateTypes(struct Expression * exp)
11239 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11241 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11242 struct Statement * compound;
11243 struct Context * context;
11247 exp->destType->refCount++;
11249 exp->expType->refCount++;
11250 newExp->prev = (((void *)0));
11251 newExp->next = (((void *)0));
11252 switch(exp->expType->kind)
11255 if(exp->destType->classObjectType)
11258 exp->destType->refCount--;
11260 exp->expType->refCount--;
11261 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11265 struct __ecereNameSpace__ecere__sys__OldList * specs;
11266 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11267 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11269 context = PushContext();
11270 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11271 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11272 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11274 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11275 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11276 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11277 exp->compound->compound.context = context;
11278 PopContext(context);
11283 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11284 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11288 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11290 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11291 struct Statement * compound;
11292 struct Context * context;
11296 exp->destType->refCount++;
11298 exp->expType->refCount++;
11299 newExp->prev = (((void *)0));
11300 newExp->next = (((void *)0));
11301 switch(exp->expType->kind)
11304 if(exp->destType->classObjectType)
11307 exp->destType->refCount--;
11309 exp->expType->refCount--;
11310 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11314 struct __ecereNameSpace__ecere__sys__OldList * specs;
11315 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11316 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11318 context = PushContext();
11319 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11320 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11321 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11323 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11324 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11325 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11326 exp->compound->compound.context = context;
11327 PopContext(context);
11332 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11335 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11336 ProcessExpressionType((*exp->list).first);
11342 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11343 newExp->needCast = 0x1;
11344 ProcessExpressionType((*exp->list).first);
11350 if(exp->expType->kind == 20)
11352 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11356 FreeType(exp->destType);
11357 FreeType(exp->expType);
11358 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11362 if(newExp->type == 8 && newExp->member.memberType == 3)
11366 exp->op.exp1 = (((void *)0));
11367 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11371 char typeString[1024];
11372 struct Declarator * decl;
11373 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11375 typeString[0] = '\0';
11376 PrintType(exp->expType, typeString, 0x0, 0x0);
11377 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11379 exp->cast.typeName = MkTypeName(specs, decl);
11380 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11381 exp->cast.exp->needCast = 0x1;
11389 extern int strncmp(const char * , const char * , size_t n);
11391 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11393 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11395 int nsLen = strlen(nameSpace);
11396 struct Symbol * symbol;
11398 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)))
11400 char * s = symbol->string;
11402 if(!strncmp(s, nameSpace, nsLen))
11407 for(c = strlen(s) - 1; c >= 0; c--)
11410 namePart = s + c + 1;
11411 if(!strcmp(namePart, name))
11419 return (((void *)0));
11422 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11425 char nameSpace[1024];
11427 unsigned int gotColon = 0x0;
11429 nameSpace[0] = '\0';
11430 for(c = strlen(name) - 1; c >= 0; c--)
11436 namePart = name + c + 1;
11437 while(c >= 0 && name[c] == ':')
11441 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11445 memcpy(nameSpace, name, c + 1);
11446 nameSpace[c + 1] = (char)0;
11447 return ScanWithNameSpace(tree, nameSpace, namePart);
11451 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11457 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11461 return ScanWithNameSpace(tree, "", namePart);
11463 return (((void *)0));
11466 static void ProcessDeclaration(struct Declaration * decl);
11468 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11470 struct Context * ctx;
11471 struct Symbol * symbol = (((void *)0));
11473 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11475 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11477 symbol = (((void *)0));
11480 char curName[1024];
11482 strcpy(curName, thisNameSpace);
11483 strcat(curName, "::");
11484 strcat(curName, name);
11485 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11488 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11491 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11492 if(symbol || ctx == endContext)
11495 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11497 if(symbol->pointerExternal->type == 0)
11499 struct FunctionDefinition * function = symbol->pointerExternal->function;
11500 struct Context * tmpContext = curContext;
11502 curContext = (((void *)0));
11503 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11504 curContext = tmpContext;
11505 symbol->pointerExternal->symbol = symbol;
11506 DeclareType(symbol->type, 0x1, 0x1);
11507 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11508 symbol->id = curExternal->symbol->idCode;
11510 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11512 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11513 symbol->id = curExternal->symbol->idCode;
11519 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11521 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11522 ListAdd(specs, MkSpecifier(UNSIGNED));
11527 if(type->_class->registered)
11529 if(!type->_class->registered->dataType)
11530 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11531 GetTypeSpecs(type->_class->registered->dataType, specs);
11536 ListAdd(specs, MkSpecifier(DOUBLE));
11539 ListAdd(specs, MkSpecifier(FLOAT));
11542 ListAdd(specs, MkSpecifier(CHAR));
11545 ListAdd(specs, MkSpecifier(_BOOL));
11548 ListAdd(specs, MkSpecifier(SHORT));
11551 ListAdd(specs, MkSpecifier(INT64));
11554 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11557 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11561 ListAdd(specs, MkSpecifier(INT));
11566 static void PrintArraySize(struct Type * arrayType, char * string)
11572 if(arrayType->enumClass)
11573 strcat(size, arrayType->enumClass->string);
11574 else if(arrayType->arraySizeExp)
11575 PrintExpression(arrayType->arraySizeExp, size);
11577 strcat(string, size);
11580 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
11584 if(printConst && type->constant)
11585 strcat(string, "const ");
11590 struct Symbol * c = type->_class;
11592 if(type->classObjectType == 2)
11593 strcat(string, "typed_object");
11594 else if(type->classObjectType == 3)
11595 strcat(string, "any_object");
11599 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
11601 if(type->byReference)
11602 strcat(string, " &");
11606 strcat(string, "void");
11609 strcat(string, type->isSigned ? "int" : "uint");
11612 strcat(string, type->isSigned ? "int64" : "uint64");
11615 strcat(string, type->isSigned ? "intptr" : "uintptr");
11618 strcat(string, type->isSigned ? "intsize" : "uintsize");
11621 strcat(string, type->isSigned ? "char" : "byte");
11624 strcat(string, "_Bool");
11627 strcat(string, type->isSigned ? "short" : "uint16");
11630 strcat(string, "float");
11633 strcat(string, "double");
11638 strcat(string, "struct ");
11639 strcat(string, type->enumName);
11641 else if(type->typeName)
11642 strcat(string, type->typeName);
11645 struct Type * member;
11647 strcat(string, "struct { ");
11648 for(member = type->members.first; member; member = member->next)
11650 PrintType(member, string, 0x1, fullName);
11651 strcat(string, "; ");
11653 strcat(string, "}");
11659 strcat(string, "union ");
11660 strcat(string, type->enumName);
11662 else if(type->typeName)
11663 strcat(string, type->typeName);
11666 strcat(string, "union ");
11667 strcat(string, "(unnamed)");
11673 strcat(string, "enum ");
11674 strcat(string, type->enumName);
11676 else if(type->typeName)
11677 strcat(string, type->typeName);
11679 strcat(string, "int");
11682 strcat(string, "...");
11685 strcat(string, "subclass(");
11686 strcat(string, type->_class ? type->_class->string : "int");
11687 strcat(string, ")");
11690 strcat(string, type->templateParameter->identifier->string);
11693 strcat(string, "thisclass");
11696 strcat(string, "__builtin_va_list");
11702 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11704 static void PrintName(struct Type * type, char * string, unsigned int fullName)
11706 if(type->name && type->name[0])
11709 strcat(string, type->name);
11712 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11718 strcat(string, name);
11723 static void PrintAttribs(struct Type * type, char * string)
11727 if(type->dllExport)
11728 strcat(string, "dllexport ");
11729 if(type->attrStdcall)
11730 strcat(string, "stdcall ");
11734 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
11736 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11738 struct Type * attrType = (((void *)0));
11740 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
11741 PrintAttribs(type, string);
11742 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
11743 strcat(string, " const");
11744 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
11745 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11746 strcat(string, " (");
11747 if(type->kind == 13)
11749 if(type->type->kind == 11 || type->type->kind == 16)
11750 PrintAttribs(type->type, string);
11752 if(type->kind == 13)
11754 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
11755 strcat(string, "*");
11757 strcat(string, " *");
11759 if(printConst && type->constant && type->kind == 13)
11760 strcat(string, " const");
11763 PrintTypeSpecs(type, string, fullName, printConst);
11766 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
11768 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11769 strcat(string, ")");
11770 if(type->kind == 12)
11771 PrintArraySize(type, string);
11772 else if(type->kind == 11)
11774 struct Type * param;
11776 strcat(string, "(");
11777 for(param = type->params.first; param; param = param->next)
11779 PrintType(param, string, 0x1, fullName);
11781 strcat(string, ", ");
11783 strcat(string, ")");
11785 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11786 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
11789 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
11791 PrePrintType(type, string, fullName, (((void *)0)), printConst);
11792 if(type->thisClass || (printName && type->name && type->name[0]))
11793 strcat(string, " ");
11794 if((type->thisClass || type->staticMethod))
11796 struct Symbol * _class = type->thisClass;
11798 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
11800 if(type->classObjectType == 1)
11801 strcat(string, "class");
11803 strcat(string, type->byReference ? "typed_object&" : "typed_object");
11805 else if(_class && _class->string)
11807 char * s = _class->string;
11813 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
11819 strcat(string, name);
11822 strcat(string, "::");
11824 if(printName && type->name)
11825 PrintName(type, string, fullName);
11826 PostPrintType(type, string, fullName);
11827 if(type->bitFieldCount)
11831 sprintf(count, ":%d", type->bitFieldCount);
11832 strcat(string, count);
11836 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11838 _PrintType(type, string, printName, fullName, 0x1);
11841 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11843 _PrintType(type, string, printName, fullName, 0x0);
11846 static struct Type * FindMember(struct Type * type, char * string)
11848 struct Type * memberType;
11850 for(memberType = type->members.first; memberType; memberType = memberType->next)
11852 if(!memberType->name)
11854 struct Type * subType = FindMember(memberType, string);
11859 else if(!strcmp(memberType->name, string))
11862 return (((void *)0));
11865 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11867 struct Type * memberType;
11869 for(memberType = type->members.first; memberType; memberType = memberType->next)
11871 if(!memberType->name)
11873 struct Type * subType = FindMember(memberType, string);
11877 *offset += memberType->offset;
11881 else if(!strcmp(memberType->name, string))
11883 *offset += memberType->offset;
11887 return (((void *)0));
11890 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11892 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11894 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
11896 struct Expression * ParseExpressionString(char * expression)
11898 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11899 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
11900 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
11902 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
11903 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11904 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
11905 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
11907 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
11908 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11910 parsedExpression = (((void *)0));
11912 expression_yyparse();
11913 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11914 return parsedExpression;
11917 extern char * QMkString(char * source);
11919 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11921 struct Identifier * id = exp->identifier;
11922 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11923 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11924 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11925 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11927 if(_class && _class->type == 4)
11929 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11930 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11934 struct __ecereNameSpace__ecere__com__Class * baseClass;
11936 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11938 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11940 for(value = e->values.first; value; value = value->next)
11942 if(!strcmp(value->name, id->string))
11947 char constant[256];
11949 FreeExpContents(exp);
11951 exp->isConstant = 0x1;
11952 if(!strcmp(baseClass->dataTypeString, "int"))
11953 sprintf(constant, "%d", (int)value->data);
11955 sprintf(constant, "0x%X", (int)value->data);
11956 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11957 exp->expType = MkClassType(baseClass->fullName);
11965 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11967 ProcessMethodType(method);
11968 exp->expType = __extension__ ({
11969 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11971 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
11975 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11977 if(!prop->dataType)
11978 ProcessPropertyType(prop);
11979 exp->expType = prop->dataType;
11981 prop->dataType->refCount++;
11984 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11986 if(!member->dataType)
11987 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11988 exp->expType = member->dataType;
11989 if(member->dataType)
11990 member->dataType->refCount++;
11993 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11995 if(!classProp->dataType)
11996 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11997 if(classProp->constant)
11999 FreeExpContents(exp);
12000 exp->isConstant = 0x1;
12001 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
12004 exp->constant = QMkString((char *)classProp->Get(_class));
12008 char constant[256];
12011 sprintf(constant, "%d", (int)classProp->Get(_class));
12012 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12018 exp->expType = classProp->dataType;
12019 if(classProp->dataType)
12020 classProp->dataType->refCount++;
12026 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
12028 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
12029 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
12030 struct __ecereNameSpace__ecere__com__NameSpace * child;
12034 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)))
12036 data = ScanGlobalData(child, name);
12044 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
12046 extern char * strncpy(char * , const char * , size_t n);
12048 static struct GlobalData * FindGlobalData(char * name)
12051 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12053 nameSpace = globalData;
12054 for(c = 0; name[c]; c++)
12056 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
12058 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
12059 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
12061 strncpy(spaceName, name + start, c - start);
12062 spaceName[c - start] = '\0';
12063 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
12064 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
12066 return (((void *)0));
12067 nameSpace = newSpace;
12075 return ScanGlobalData(nameSpace, name + start);
12077 return (((void *)0));
12080 static int definedExpStackPos;
12082 static void * definedExpStack[512];
12084 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
12086 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
12088 FreeExpContents(checkedExp);
12089 FreeType(checkedExp->expType);
12090 FreeType(checkedExp->destType);
12091 *checkedExp = *newExp;
12092 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12093 checkedExp->prev = prev;
12094 checkedExp->next = next;
12097 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
12099 extern int printf(char * , ...);
12101 void __ecereMethod_Expression_Clear();
12103 void ApplyAnyObjectLogic(struct Expression * e)
12105 struct Type * destType = e->destType;
12107 if(destType && (destType->classObjectType == 3))
12109 if(e && e->expType)
12111 struct Type * type = e->expType;
12112 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
12114 if(type->kind == 8 && type->_class && type->_class->registered)
12116 _class = type->_class->registered;
12118 else if(type->kind == 19)
12120 _class = FindClass("ecere::com::Class")->registered;
12124 char string[1024] = "";
12125 struct Symbol * classSym;
12127 PrintTypeNoConst(type, string, 0x0, 0x1);
12128 classSym = FindClass(string);
12130 _class = classSym->registered;
12132 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "uintptr") && strcmp(_class->fullName, "intptr")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 22 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
12134 if(!_class || strcmp(_class->fullName, "char *"))
12136 struct Expression * checkedExp = e, * newExp;
12138 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12140 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12142 if(checkedExp->type == 25)
12144 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12147 checkedExp = (*checkedExp->list).last;
12149 else if(checkedExp->type == 11)
12150 checkedExp = checkedExp->cast.exp;
12152 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12154 newExp = checkedExp->op.exp2;
12155 checkedExp->op.exp2 = (((void *)0));
12156 FreeExpContents(checkedExp);
12157 if(e->expType && e->expType->passAsTemplate)
12161 ComputeTypeSize(e->expType);
12162 sprintf(size, "%d", e->expType->size);
12163 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))))));
12165 ReplaceExpContents(checkedExp, newExp);
12166 e->byReference = 0x1;
12168 else if(!e->byReference || (_class && _class->type == 5))
12170 struct Expression * checkedExp, * newExp;
12173 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;
12175 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12177 struct Context * context = PushContext();
12178 struct Declarator * decl;
12179 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12180 char typeString[1024];
12181 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12183 typeString[0] = '\0';
12185 newExp->prev = (((void *)0));
12186 newExp->next = (((void *)0));
12187 newExp->expType = (((void *)0));
12188 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
12189 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12190 newExp->destType = ProcessType(specs, decl);
12191 curContext = context;
12195 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12198 sprintf(name, "__internalValue%03X", internalValueCounter++);
12199 if(!curCompound->compound.declarations)
12200 curCompound->compound.declarations = MkList();
12201 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12202 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12203 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12204 e->compound = MkCompoundStmt((((void *)0)), stmts);
12207 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12209 struct Type * type = e->destType;
12211 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12212 CopyTypeInto(e->destType, type);
12213 e->destType->refCount = 1;
12214 e->destType->classObjectType = 0;
12217 e->compound->compound.context = context;
12218 PopContext(context);
12219 curContext = context->parent;
12223 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12225 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12227 if(checkedExp->type == 25)
12229 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12232 checkedExp = (*checkedExp->list).last;
12234 else if(checkedExp->type == 11)
12235 checkedExp = checkedExp->cast.exp;
12238 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12240 *operand = *checkedExp;
12241 checkedExp->destType = (((void *)0));
12242 checkedExp->expType = (((void *)0));
12243 __ecereMethod_Expression_Clear(checkedExp);
12244 checkedExp->type = 4;
12245 checkedExp->op.op = '&';
12246 checkedExp->op.exp1 = (((void *)0));
12247 checkedExp->op.exp2 = operand;
12256 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))))
12258 if(e->expType->classObjectType && destType && destType->classObjectType)
12264 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12267 thisExp->prev = (((void *)0));
12268 thisExp->next = (((void *)0));
12269 __ecereMethod_Expression_Clear(e);
12271 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12272 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12273 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12275 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12276 CopyTypeInto(e->expType, thisExp->expType);
12277 e->expType->byReference = 0x0;
12278 e->expType->refCount = 1;
12279 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))
12281 e->expType->classObjectType = 0;
12286 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12288 if(destType->kind == 14)
12290 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12292 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12294 unsigned int byReference = e->expType->byReference;
12295 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12296 struct Declarator * decl;
12297 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12298 char typeString[1024];
12299 struct Type * type;
12300 int backupClassObjectType;
12301 unsigned int backupByReference;
12303 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12307 backupClassObjectType = type->classObjectType;
12308 backupByReference = type->byReference;
12309 type->classObjectType = 0;
12310 type->byReference = 0x0;
12311 typeString[0] = '\0';
12312 PrintType(type, typeString, 0x0, 0x1);
12313 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12314 type->classObjectType = backupClassObjectType;
12315 type->byReference = backupByReference;
12317 thisExp->prev = (((void *)0));
12318 thisExp->next = (((void *)0));
12319 __ecereMethod_Expression_Clear(e);
12320 if((type->kind == 8 && type->_class && type->_class->registered && (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 != 22 && type->kind != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
12324 e->op.exp1 = (((void *)0));
12325 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12326 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12327 CopyTypeInto(e->expType, type);
12328 e->expType->byReference = 0x0;
12329 e->expType->refCount = 1;
12334 e->cast.typeName = MkTypeName(specs, decl);
12335 e->cast.exp = thisExp;
12336 e->byReference = 0x1;
12340 e->destType = destType;
12341 destType->refCount++;
12346 extern char * strstr(const char * , const char * );
12348 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12350 struct __ecereNameSpace__ecere__com__DefinedExpression
12352 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12353 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12356 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12357 } __attribute__ ((gcc_struct));
12359 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12361 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12363 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12365 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12367 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12369 extern struct Expression * CopyExpression(struct Expression * exp);
12371 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12373 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12375 static void ProcessStatement(struct Statement * stmt);
12377 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12379 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12381 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12383 extern char * sourceFile;
12385 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12387 void ProcessExpressionType(struct Expression * exp)
12389 unsigned int unresolved = 0x0;
12390 struct Location oldyylloc = yylloc;
12391 unsigned int notByReference = 0x0;
12393 if(!exp || exp->expType)
12400 struct Identifier * id = exp->identifier;
12404 if(id->_class && id->_class->name)
12406 id->classSym = id->_class->symbol;
12408 if(strstr(id->string, "__ecereClass") == id->string)
12410 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12413 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12415 ReplaceClassMembers(exp, thisClass);
12418 ProcessExpressionType(exp);
12421 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12426 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12430 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12436 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12439 ProcessExpressionType(exp);
12443 else if(currentClass && !id->_class)
12445 if(ResolveIdWithClass(exp, currentClass, 0x1))
12448 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12453 struct Type * type = symbol->type;
12454 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12456 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12458 struct Context * context = SetupTemplatesContext(_class);
12460 type = ReplaceThisClassType(_class);
12461 FinishTemplatesContext(context);
12463 type->refCount = 0;
12465 FreeSpecifier(id->_class);
12466 id->_class = (((void *)0));
12467 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12468 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12469 id->classSym = (((void *)0));
12470 exp->expType = type;
12473 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12474 exp->isConstant = 0x1;
12475 if(symbol->isParam || !strcmp(id->string, "this"))
12477 if(_class && _class->type == 1 && !type->declaredWithStruct)
12478 exp->byReference = 0x1;
12480 if(symbol->isIterator)
12482 if(symbol->isIterator == 3)
12485 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12486 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12487 exp->expType = (((void *)0));
12488 ProcessExpressionType(exp);
12490 else if(symbol->isIterator != 4)
12493 exp->member.exp = MkExpIdentifier(exp->identifier);
12494 exp->member.exp->expType = exp->expType;
12495 exp->member.member = MkIdentifier("data");
12496 exp->expType = (((void *)0));
12497 ProcessExpressionType(exp);
12504 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12506 if(thisNameSpace && !(id->_class && !id->_class->name))
12510 strcpy(name, thisNameSpace);
12511 strcat(name, "::");
12512 strcat(name, id->string);
12513 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12516 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12521 for(c = 0; c < definedExpStackPos; c++)
12522 if(definedExpStack[c] == definedExp)
12524 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12526 struct Location backupYylloc = yylloc;
12528 definedExpStack[definedExpStackPos++] = definedExp;
12529 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12530 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
12531 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12533 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12534 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12535 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12536 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12538 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12539 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12541 parsedExpression = (((void *)0));
12543 expression_yyparse();
12544 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12545 yylloc = backupYylloc;
12546 if(parsedExpression)
12548 FreeIdentifier(id);
12550 exp->list = MkListOne(parsedExpression);
12551 parsedExpression->loc = yylloc;
12552 ProcessExpressionType(exp);
12553 definedExpStackPos--;
12556 definedExpStackPos--;
12562 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12568 struct GlobalData * data = (((void *)0));
12570 if(thisNameSpace && !(id->_class && !id->_class->name))
12574 strcpy(name, thisNameSpace);
12575 strcat(name, "::");
12576 strcat(name, id->string);
12577 data = FindGlobalData(name);
12580 data = FindGlobalData(id->string);
12583 DeclareGlobalData(data);
12584 exp->expType = data->dataType;
12586 data->dataType->refCount++;
12587 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12588 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12589 FreeSpecifier(id->_class);
12590 id->_class = (((void *)0));
12595 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12597 if(thisNameSpace && !(id->_class && !id->_class->name))
12601 strcpy(name, thisNameSpace);
12602 strcat(name, "::");
12603 strcat(name, id->string);
12604 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12607 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12612 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12613 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12615 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12616 strcpy(name, "__ecereFunction_");
12617 FullClassNameCat(name, id->string, 0x0);
12618 if(DeclareFunction(function, name))
12620 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12621 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12623 exp->expType = function->dataType;
12624 if(function->dataType)
12625 function->dataType->refCount++;
12626 FreeSpecifier(id->_class);
12627 id->_class = (((void *)0));
12639 struct __ecereNameSpace__ecere__com__Class * _class;
12641 if(!exp->instance->_class)
12643 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12645 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12648 ProcessInstantiationType(exp->instance);
12649 exp->isConstant = exp->instance->isConstant;
12650 if(exp->instance->_class)
12652 exp->expType = MkClassType(exp->instance->_class->name);
12660 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12662 exp->expType = type;
12663 if(exp->constant[0] == '\'')
12665 if((int)((unsigned char *)exp->constant)[1] > 127)
12668 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12671 ch = exp->constant[1];
12672 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12673 exp->constant = PrintUInt(ch);
12675 type->_class = FindClass("unichar");
12676 type->isSigned = 0x0;
12681 type->isSigned = 0x1;
12684 else if(strchr(exp->constant, '.'))
12686 char ch = exp->constant[strlen(exp->constant) - 1];
12692 type->isSigned = 0x1;
12696 if(exp->constant[0] == '0' && exp->constant[1])
12697 type->isSigned = 0x0;
12698 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12699 type->isSigned = 0x0;
12700 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12701 type->isSigned = 0x0;
12703 type->isSigned = 0x1;
12706 exp->isConstant = 0x1;
12707 if(exp->destType && exp->destType->kind == 7)
12709 else if(exp->destType && exp->destType->kind == 6)
12711 else if(exp->destType && exp->destType->kind == 4)
12718 exp->isConstant = 0x1;
12719 exp->expType = __extension__ ({
12720 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12722 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
12723 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12725 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
12726 }), __ecereInstance2;
12732 ProcessExpressionType(exp->_new.size);
12733 exp->expType = __extension__ ({
12734 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12736 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
12738 DeclareType(exp->expType->type, 0x0, 0x0);
12742 ProcessExpressionType(exp->_renew.size);
12743 ProcessExpressionType(exp->_renew.exp);
12744 exp->expType = __extension__ ({
12745 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12747 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
12749 DeclareType(exp->expType->type, 0x0, 0x0);
12753 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12754 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12755 unsigned int useDestType = 0x0, useSideType = 0x0;
12756 struct Location oldyylloc = yylloc;
12757 unsigned int useSideUnit = 0x0;
12758 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
12800 if(exp->op.op != '*' || exp->op.exp1)
12807 if(exp->op.op == '&')
12809 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12811 struct Identifier * id = exp->op.exp2->identifier;
12812 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12814 if(symbol && symbol->isIterator == 2)
12817 exp->member.exp = exp->op.exp2;
12818 exp->member.member = MkIdentifier("key");
12819 exp->expType = (((void *)0));
12820 exp->op.exp2->expType = symbol->type;
12821 symbol->type->refCount++;
12822 ProcessExpressionType(exp);
12830 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))
12832 if(exp->op.exp1->destType)
12833 FreeType(exp->op.exp1->destType);
12834 exp->op.exp1->destType = exp->destType;
12836 exp->destType->refCount++;
12840 if(exp->op.exp1->destType)
12841 FreeType(exp->op.exp1->destType);
12842 exp->op.exp1->destType = dummy;
12845 if(exp->op.exp1->destType && exp->op.op != '=')
12846 exp->op.exp1->destType->count++;
12847 ProcessExpressionType(exp->op.exp1);
12848 if(exp->op.exp1->destType && exp->op.op != '=')
12849 exp->op.exp1->destType->count--;
12850 if(exp->op.exp1->destType == dummy)
12853 exp->op.exp1->destType = (((void *)0));
12855 type1 = exp->op.exp1->expType;
12859 char expString[10240];
12861 expString[0] = '\0';
12862 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12866 exp->op.exp2->destType = exp->op.exp1->expType;
12867 if(exp->op.exp1->expType)
12868 exp->op.exp1->expType->refCount++;
12872 exp->op.exp2->destType = exp->destType;
12874 exp->destType->refCount++;
12878 exp->expType = type1;
12883 PrintExpression(exp->op.exp2, expString);
12884 if(type1 && type1->kind == 13)
12886 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)
12887 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12888 else if(exp->op.op == '=')
12890 if(exp->op.exp2->destType)
12891 FreeType(exp->op.exp2->destType);
12892 exp->op.exp2->destType = type1;
12899 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)
12903 if(exp->op.exp2->destType)
12904 FreeType(exp->op.exp2->destType);
12905 exp->op.exp2->destType = type1;
12912 exp->expType = type1;
12914 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)))
12916 if(exp->op.exp2->destType)
12917 FreeType(exp->op.exp2->destType);
12918 exp->op.exp2->destType = exp->destType;
12920 exp->destType->refCount++;
12924 if(exp->op.exp2->destType)
12925 FreeType(exp->op.exp2->destType);
12926 exp->op.exp2->destType = dummy;
12929 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12931 FreeType(exp->op.exp2->destType);
12932 exp->op.exp2->destType = type1;
12935 if(exp->op.exp2->destType && exp->op.op != '=')
12936 exp->op.exp2->destType->count++;
12937 ProcessExpressionType(exp->op.exp2);
12938 if(exp->op.exp2->destType && exp->op.op != '=')
12939 exp->op.exp2->destType->count--;
12940 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12942 if(exp->op.exp2->expType->kind == 23 || 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)
12944 if(exp->op.op != '=' && type1->type->kind == 0)
12945 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12947 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)))
12949 if(exp->op.op == ADD_ASSIGN)
12950 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12952 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))
12954 if(exp->op.op == ADD_ASSIGN)
12955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12957 else if(inCompiler)
12959 char type1String[1024];
12960 char type2String[1024];
12962 type1String[0] = '\0';
12963 type2String[0] = '\0';
12964 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12965 PrintType(type1, type2String, 0x0, 0x1);
12966 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12967 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12970 if(exp->op.exp2->destType == dummy)
12973 exp->op.exp2->destType = (((void *)0));
12975 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
12977 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12978 type2->refCount = 1;
12979 CopyTypeInto(type2, exp->op.exp2->expType);
12980 type2->isSigned = 0x1;
12982 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
12984 type2 = __extension__ ({
12985 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12987 __ecereInstance1->kind = 3, __ecereInstance1;
12989 type2->refCount = 1;
12990 type2->isSigned = 0x1;
12993 type2 = exp->op.exp2->expType;
12996 if(exp->op.op == SIZEOF)
12998 exp->expType = __extension__ ({
12999 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13001 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13003 exp->isConstant = 0x1;
13005 else if(exp->op.op == '*' && !exp->op.exp1)
13007 exp->expType = Dereference(type2);
13008 if(type2 && type2->kind == 8)
13009 notByReference = 0x1;
13011 else if(exp->op.op == '&' && !exp->op.exp1)
13012 exp->expType = Reference(type2);
13019 if(exp->op.exp1->destType)
13020 FreeType(exp->op.exp1->destType);
13021 exp->op.exp1->destType = MkClassType("bool");
13022 exp->op.exp1->destType->truth = 0x1;
13023 if(!exp->op.exp1->expType)
13024 ProcessExpressionType(exp->op.exp1);
13026 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13027 FreeType(exp->op.exp1->expType);
13028 exp->op.exp1->expType = MkClassType("bool");
13029 exp->op.exp1->expType->truth = 0x1;
13033 if(exp->op.exp2->destType)
13034 FreeType(exp->op.exp2->destType);
13035 exp->op.exp2->destType = MkClassType("bool");
13036 exp->op.exp2->destType->truth = 0x1;
13037 if(!exp->op.exp2->expType)
13038 ProcessExpressionType(exp->op.exp2);
13040 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13041 FreeType(exp->op.exp2->expType);
13042 exp->op.exp2->expType = MkClassType("bool");
13043 exp->op.exp2->expType->truth = 0x1;
13046 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")))))
13048 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
13050 if(exp->op.exp2->destType)
13051 FreeType(exp->op.exp2->destType);
13052 exp->op.exp2->destType = type1;
13054 if(exp->op.exp1->destType)
13055 FreeType(exp->op.exp1->destType);
13056 exp->op.exp1->destType = type2;
13058 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)
13059 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);
13060 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
13062 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13066 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13068 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
13069 ProcessExpressionType(exp->op.exp1);
13070 if(type2->kind != 13)
13072 ProcessExpressionType(classExp);
13073 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"))))))));
13074 if(!exp->op.exp2->expType)
13075 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
13076 ProcessExpressionType(exp->op.exp2);
13080 if(!boolResult && ((type1->kind == 13 || type1->kind == 12 || (type1->kind == 8 && !strcmp(type1->_class->string, "String"))) && (type2->kind == 23 || type2->kind == 22 || type2->kind == 4 || type2->kind == 3 || type2->kind == 2 || type2->kind == 1)))
13082 if(type1->kind != 8 && type1->type->kind == 0)
13083 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13084 exp->expType = type1;
13088 else if(!boolResult && ((type2->kind == 13 || type2->kind == 12 || (type2->kind == 8 && !strcmp(type2->_class->string, "String"))) && (type1->kind == 23 || type1->kind == 22 || type1->kind == 4 || type1->kind == 3 || type1->kind == 2 || type1->kind == 1)))
13090 if(type2->kind != 8 && type2->type->kind == 0)
13091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13092 exp->expType = type2;
13096 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))
13098 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
13102 unsigned int success = 0x0;
13104 if(type1->kind == 13 && type2->kind == 13)
13106 if(exp->op.op == '+')
13107 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
13108 else if(exp->op.op == '-')
13110 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
13112 exp->expType = __extension__ ({
13113 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13115 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
13118 if(type1->type->kind == 20)
13120 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13124 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13126 ProcessExpressionType(classExp);
13128 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")))))));
13129 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
13137 if(!success && exp->op.exp1->type == 2)
13139 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13142 FreeType(exp->expType);
13143 exp->expType = exp->op.exp1->destType;
13144 if(exp->op.exp1->destType)
13145 exp->op.exp1->destType->refCount++;
13148 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13151 FreeType(exp->expType);
13152 exp->expType = exp->op.exp2->destType;
13153 if(exp->op.exp2->destType)
13154 exp->op.exp2->destType->refCount++;
13160 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13163 FreeType(exp->expType);
13164 exp->expType = exp->op.exp2->destType;
13165 if(exp->op.exp2->destType)
13166 exp->op.exp2->destType->refCount++;
13169 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13172 FreeType(exp->expType);
13173 exp->expType = exp->op.exp1->destType;
13174 if(exp->op.exp1->destType)
13175 exp->op.exp1->destType->refCount++;
13181 char expString1[10240];
13182 char expString2[10240];
13186 expString1[0] = '\0';
13187 expString2[0] = '\0';
13192 PrintExpression(exp->op.exp1, expString1);
13193 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13194 PrintExpression(exp->op.exp2, expString2);
13195 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13196 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
13197 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
13199 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
13203 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13205 if(exp->op.exp1->destType)
13206 FreeType(exp->op.exp1->destType);
13207 exp->op.exp1->destType = type2->_class->registered->dataType;
13208 if(type2->_class->registered->dataType)
13209 type2->_class->registered->dataType->refCount++;
13210 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13211 exp->expType = type2;
13215 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13217 if(exp->op.exp2->destType)
13218 FreeType(exp->op.exp2->destType);
13219 exp->op.exp2->destType = type1->_class->registered->dataType;
13220 if(type1->_class->registered->dataType)
13221 type1->_class->registered->dataType->refCount++;
13222 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13223 exp->expType = type1;
13229 unsigned int valid = 0x0;
13231 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13233 if(exp->op.exp2->destType)
13234 FreeType(exp->op.exp2->destType);
13235 if(!type1->_class->registered->dataType)
13236 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13237 exp->op.exp2->destType = type1->_class->registered->dataType;
13238 exp->op.exp2->destType->refCount++;
13239 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13240 type2 = exp->op.exp2->destType;
13241 exp->expType = type2;
13244 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13246 if(exp->op.exp1->destType)
13247 FreeType(exp->op.exp1->destType);
13248 if(!type2->_class->registered->dataType)
13249 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13250 exp->op.exp1->destType = type2->_class->registered->dataType;
13251 exp->op.exp1->destType->refCount++;
13252 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13253 type1 = exp->op.exp1->destType;
13254 exp->expType = type1;
13257 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13259 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13261 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13264 FreeType(exp->expType);
13265 exp->expType = exp->op.exp1->expType;
13266 if(exp->op.exp2->expType)
13267 exp->op.exp1->expType->refCount++;
13271 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13273 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13276 FreeType(exp->expType);
13277 exp->expType = exp->op.exp2->expType;
13278 if(exp->op.exp2->expType)
13279 exp->op.exp2->expType->refCount++;
13286 if(exp->op.exp2->destType)
13287 FreeType(exp->op.exp2->destType);
13288 exp->op.exp2->destType = type1;
13290 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13293 FreeType(exp->expType);
13294 exp->expType = exp->op.exp2->destType;
13295 if(exp->op.exp2->destType)
13296 exp->op.exp2->destType->refCount++;
13298 else if(type1 && type2)
13300 char expString1[10240];
13301 char expString2[10240];
13302 char type1String[1024];
13303 char type2String[1024];
13305 expString1[0] = '\0';
13306 expString2[0] = '\0';
13307 type1String[0] = '\0';
13308 type2String[0] = '\0';
13311 PrintExpression(exp->op.exp1, expString1);
13312 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13313 PrintExpression(exp->op.exp2, expString2);
13314 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13315 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13316 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13318 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13319 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13321 exp->expType = exp->op.exp1->expType;
13322 if(exp->op.exp1->expType)
13323 exp->op.exp1->expType->refCount++;
13325 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13327 exp->expType = exp->op.exp2->expType;
13328 if(exp->op.exp2->expType)
13329 exp->op.exp2->expType->refCount++;
13336 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13338 struct Type * oldType = exp->op.exp1->expType;
13340 exp->op.exp1->expType = (((void *)0));
13341 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13344 exp->op.exp1->expType = oldType;
13346 if(exp->op.exp1->destType)
13347 FreeType(exp->op.exp1->destType);
13348 exp->op.exp1->destType = type2;
13350 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13353 FreeType(exp->expType);
13354 exp->expType = exp->op.exp1->destType;
13355 if(exp->op.exp1->destType)
13356 exp->op.exp1->destType->refCount++;
13360 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13362 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13364 if(exp->op.exp1->destType)
13365 FreeType(exp->op.exp1->destType);
13366 exp->op.exp1->destType = type2->_class->registered->dataType;
13367 if(type2->_class->registered->dataType)
13368 type2->_class->registered->dataType->refCount++;
13369 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13371 if(exp->op.op == '!')
13373 exp->expType = MkClassType("bool");
13374 exp->expType->truth = 0x1;
13378 exp->expType = type2;
13383 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13385 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13387 if(exp->op.exp2->destType)
13388 FreeType(exp->op.exp2->destType);
13389 exp->op.exp2->destType = type1->_class->registered->dataType;
13390 if(type1->_class->registered->dataType)
13391 type1->_class->registered->dataType->refCount++;
13392 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13394 exp->expType = type1;
13400 if(exp->op.exp1 && !exp->op.exp1->expType)
13402 char expString[10000];
13404 expString[0] = '\0';
13407 PrintExpression(exp->op.exp1, expString);
13408 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13411 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13413 if(exp->op.exp2 && !exp->op.exp2->expType)
13415 char expString[10240];
13417 expString[0] = '\0';
13420 PrintExpression(exp->op.exp2, expString);
13421 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13424 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13428 FreeType(exp->expType);
13429 exp->expType = MkClassType("bool");
13430 exp->expType->truth = 0x1;
13432 if(exp->op.op != SIZEOF)
13433 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13434 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13436 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13438 yylloc = oldyylloc;
13445 struct Expression * e;
13447 exp->isConstant = 0x1;
13448 for(e = (*exp->list).first; e; e = e->next)
13450 unsigned int inced = 0x0;
13454 FreeType(e->destType);
13455 e->destType = exp->destType;
13458 exp->destType->refCount++;
13459 e->destType->count++;
13463 ProcessExpressionType(e);
13465 exp->destType->count--;
13466 if(!exp->expType && !e->next)
13468 exp->expType = e->expType;
13470 e->expType->refCount++;
13473 exp->isConstant = 0x0;
13475 e = (*exp->list).first;
13476 if(!e->next && e->type == 8)
13478 struct Expression * next = exp->next, * prev = exp->prev;
13480 FreeType(exp->expType);
13481 FreeType(exp->destType);
13482 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13486 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13487 ProcessExpressionType(exp);
13493 struct Expression * e;
13495 exp->isConstant = 0x1;
13496 ProcessExpressionType(exp->index.exp);
13497 if(!exp->index.exp->isConstant)
13498 exp->isConstant = 0x0;
13499 if(exp->index.exp->expType)
13501 struct Type * source = exp->index.exp->expType;
13503 if(source->kind == 8 && source->_class && source->_class->registered)
13505 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13506 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
13508 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
13510 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13511 if(exp->index.index && (*exp->index.index).last)
13513 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13518 for(e = (*exp->index.index).first; e; e = e->next)
13520 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13523 FreeType(e->destType);
13524 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13526 ProcessExpressionType(e);
13531 exp->isConstant = 0x0;
13534 exp->expType = Dereference(exp->index.exp->expType);
13536 DeclareType(exp->expType, 0x0, 0x0);
13541 struct Expression * e;
13542 struct Type * functionType;
13543 struct Type * methodType = (((void *)0));
13549 PrintExpression(exp->call.exp, name);
13550 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13552 PrintExpression(exp->call.exp, name);
13555 if(exp->call.exp->type == 0)
13557 struct Expression * idExp = exp->call.exp;
13558 struct Identifier * id = idExp->identifier;
13560 if(!strcmp(id->string, "__builtin_frame_address"))
13562 exp->expType = ProcessTypeString("void *", 0x1);
13563 if(exp->call.arguments && (*exp->call.arguments).first)
13564 ProcessExpressionType((*exp->call.arguments).first);
13567 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13569 exp->expType = ProcessTypeString("int", 0x1);
13570 if(exp->call.arguments && (*exp->call.arguments).first)
13571 ProcessExpressionType((*exp->call.arguments).first);
13574 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13576 struct Expression * a = (((void *)0));
13577 struct Expression * b = (((void *)0));
13578 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13580 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13582 a = (*exp->call.arguments).first;
13583 b = (*exp->call.arguments).last;
13587 else if((*exp->call.arguments).count == 1)
13589 a = (*exp->call.arguments).first;
13594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13595 idExp->identifier = (((void *)0));
13596 FreeExpContents(exp);
13597 ProcessExpressionType(a);
13599 ProcessExpressionType(b);
13601 exp->list = MkList();
13602 if(a->expType && (!b || b->expType))
13604 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13608 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13609 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13610 struct Declaration * decl;
13611 char temp1[1024], temp2[1024];
13613 GetTypeSpecs(a->expType, specs);
13614 if(a && !a->isConstant && a->type != 0)
13616 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13617 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13618 tempExp1 = QMkExpId(temp1);
13619 tempExp1->expType = a->expType;
13621 a->expType->refCount++;
13622 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13624 if(b && !b->isConstant && b->type != 0)
13626 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13627 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13628 tempExp2 = QMkExpId(temp2);
13629 tempExp2->expType = b->expType;
13631 b->expType->refCount++;
13632 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13634 decl = MkDeclaration(specs, decls);
13635 if(!curCompound->compound.declarations)
13636 curCompound->compound.declarations = MkList();
13637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13641 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13643 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13645 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13646 exp->expType = a->expType;
13648 a->expType->refCount++;
13650 else if(!strcmp(id->string, "Abs"))
13652 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13653 exp->expType = a->expType;
13655 a->expType->refCount++;
13657 else if(!strcmp(id->string, "Sgn"))
13659 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"))))));
13660 exp->expType = ProcessTypeString("int", 0x0);
13662 FreeExpression(tempExp1);
13664 FreeExpression(tempExp2);
13665 FreeIdentifier(id);
13671 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13673 if(!exp->call.exp->destType)
13675 exp->call.exp->destType = dummy;
13678 ProcessExpressionType(exp->call.exp);
13679 if(exp->call.exp->destType == dummy)
13682 exp->call.exp->destType = (((void *)0));
13686 functionType = exp->call.exp->expType;
13687 if(functionType && functionType->kind == 16)
13689 methodType = functionType;
13690 functionType = methodType->method->dataType;
13691 if(exp->call.exp->expType->usedClass)
13693 char typeString[1024];
13695 typeString[0] = '\0';
13697 struct Symbol * back = functionType->thisClass;
13699 functionType->thisClass = (((void *)0));
13700 PrintType(functionType, typeString, 0x1, 0x1);
13701 functionType->thisClass = back;
13703 if(strstr(typeString, "thisclass"))
13705 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13706 struct Declarator * decl;
13709 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13711 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13712 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13713 thisClassParams = 0x0;
13714 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13716 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13718 thisClass = exp->call.exp->expType->usedClass;
13719 ProcessDeclarator(decl);
13720 thisClass = backupThisClass;
13722 thisClassParams = 0x1;
13723 functionType = ProcessType(specs, decl);
13724 functionType->refCount = 0;
13725 FinishTemplatesContext(context);
13727 FreeList(specs, FreeSpecifier);
13728 FreeDeclarator(decl);
13732 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13734 struct Type * type = functionType->type;
13736 if(!functionType->refCount)
13738 functionType->type = (((void *)0));
13739 FreeType(functionType);
13741 functionType = type;
13743 if(functionType && functionType->kind != 11)
13745 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13747 else if(functionType)
13749 unsigned int emptyParams = 0x0, noParams = 0x0;
13750 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13751 struct Type * type = functionType->params.first;
13752 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13754 struct Location oldyylloc = yylloc;
13758 if(functionType->extraParam && e && functionType->thisClass)
13760 e->destType = MkClassType(functionType->thisClass->string);
13763 if(!functionType->staticMethod && !functionType->extraParam)
13765 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13767 type = MkClassType(memberExp->member.exp->expType->_class->string);
13770 e->destType = type;
13772 type = functionType->params.first;
13775 type->refCount = 0;
13777 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13779 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13780 type->byReference = functionType->byReference;
13781 type->typedByReference = functionType->typedByReference;
13784 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
13786 e->destType = type;
13788 type = functionType->params.first;
13791 type->refCount = 0;
13794 if(type && type->kind == 0)
13797 if(!type->refCount)
13799 type = (((void *)0));
13801 for(; e; e = e->next)
13803 if(!type && !emptyParams)
13806 if(methodType && methodType->methodClass)
13807 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);
13809 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);
13812 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13814 struct Type * templatedType = (((void *)0));
13815 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13816 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13819 if(_class && _class->templateArgs)
13821 struct __ecereNameSpace__ecere__com__Class * sClass;
13823 for(sClass = _class; sClass; sClass = sClass->base)
13825 if(sClass->templateClass)
13826 sClass = sClass->templateClass;
13828 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13830 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13832 struct __ecereNameSpace__ecere__com__Class * nextClass;
13834 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13836 if(nextClass->templateClass)
13837 nextClass = nextClass->templateClass;
13838 id += nextClass->templateParams.count;
13848 if(curParam && _class->templateArgs[id].dataTypeString)
13850 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13853 struct Context * context = SetupTemplatesContext(_class);
13855 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13856 FinishTemplatesContext(context);
13858 e->destType = templatedType;
13861 templatedType->passAsTemplate = 0x1;
13866 e->destType = type;
13873 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13875 e->destType = type->prev;
13876 e->destType->refCount++;
13880 e->destType = type;
13885 if(type && type->kind != 14)
13887 struct Type * next = type->next;
13889 if(!type->refCount)
13894 if(type && type->kind != 14)
13896 if(methodType && methodType->methodClass)
13897 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);
13899 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);
13901 yylloc = oldyylloc;
13902 if(type && !type->refCount)
13907 functionType = __extension__ ({
13908 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13910 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
13912 if(exp->call.exp->type == 0)
13914 char * string = exp->call.exp->identifier->string;
13918 struct Symbol * symbol;
13919 struct Location oldyylloc = yylloc;
13921 yylloc = exp->call.exp->identifier->loc;
13922 if(strstr(string, "__builtin_") == string)
13926 functionType->returnType = exp->destType;
13927 exp->destType->refCount++;
13931 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13932 symbol = __extension__ ({
13933 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
13935 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
13937 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13938 if(strstr(symbol->string, "::"))
13939 globalContext->hasNameSpace = 0x1;
13940 yylloc = oldyylloc;
13943 else if(exp->call.exp->type == 8)
13947 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13948 if(!functionType->returnType)
13950 functionType->returnType = __extension__ ({
13951 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13953 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13957 if(functionType && functionType->kind == 11)
13959 exp->expType = functionType->returnType;
13960 if(functionType->returnType)
13961 functionType->returnType->refCount++;
13962 if(!functionType->refCount)
13963 FreeType(functionType);
13965 if(exp->call.arguments)
13967 for(e = (*exp->call.arguments).first; e; e = e->next)
13969 struct Type * destType = e->destType;
13971 ProcessExpressionType(e);
13978 struct Type * type;
13979 struct Location oldyylloc = yylloc;
13980 unsigned int thisPtr;
13981 struct Expression * checkExp = exp->member.exp;
13985 if(checkExp->type == 11)
13986 checkExp = checkExp->cast.exp;
13987 else if(checkExp->type == 5)
13988 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
13992 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
13993 exp->thisPtr = thisPtr;
13994 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13996 exp->member.member->classSym = exp->member.member->_class->symbol;
13998 ProcessExpressionType(exp->member.exp);
13999 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)
14001 exp->isConstant = 0x0;
14004 exp->isConstant = exp->member.exp->isConstant;
14005 type = exp->member.exp->expType;
14007 if(type && (type->kind == 20))
14009 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14010 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
14014 for(param = _class->templateParams.first; param; param = param->next)
14016 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
14020 if(param && param->defaultArg.member)
14022 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
14026 struct Expression * expMember = exp->member.exp;
14027 struct Declarator * decl;
14028 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14029 char thisClassTypeString[1024];
14031 FreeIdentifier(exp->member.member);
14032 ProcessExpressionType(argExp);
14034 char * colon = strstr(param->defaultArg.memberString, "::");
14038 char className[1024];
14039 struct __ecereNameSpace__ecere__com__Class * sClass;
14041 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
14042 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
14045 strcpy(thisClassTypeString, _class->fullName);
14047 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
14048 exp->expType = ProcessType(specs, decl);
14049 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
14051 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14052 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14054 int paramCount = 0;
14055 int lastParam = -1;
14056 char templateString[1024];
14057 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14059 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14060 for(cClass = expClass; cClass; cClass = cClass->base)
14064 for(param = cClass->templateParams.first; param; param = param->next)
14067 struct __ecereNameSpace__ecere__com__Class * sClass;
14068 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14070 for(sClass = cClass->base; sClass; sClass = sClass->base)
14071 id += sClass->templateParams.count;
14072 arg = expClass->templateArgs[id];
14073 for(sClass = _class; sClass; sClass = sClass->base)
14075 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
14077 struct __ecereNameSpace__ecere__com__Class * nextClass;
14079 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14080 p += nextClass->templateParams.count;
14081 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
14083 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
14085 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14087 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
14088 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
14095 char argument[256];
14097 argument[0] = '\0';
14098 switch(param->type)
14102 char expString[1024];
14103 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14104 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14105 struct Expression * exp;
14106 char * string = PrintHexUInt64(arg.expression.ui64);
14108 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14109 ProcessExpressionType(exp);
14110 ComputeExpression(exp);
14111 expString[0] = '\0';
14112 PrintExpression(exp, expString);
14113 strcat(argument, expString);
14114 FreeExpression(exp);
14119 strcat(argument, arg.member->name);
14124 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14126 if(!strcmp(arg.dataTypeString, "thisclass"))
14127 strcat(argument, thisClassTypeString);
14129 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';
14160 struct Context * context = SetupTemplatesContext(_class);
14162 FreeType(exp->expType);
14163 exp->expType = ProcessTypeString(templateString, 0x0);
14164 FinishTemplatesContext(context);
14168 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")))))))));
14171 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
14173 type = ProcessTemplateParameterType(type->templateParameter);
14176 if(type && (type->kind == 20))
14178 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15 || type->kind == 4 || type->kind == 2 || type->kind == 5 || type->kind == 1 || type->kind == 24 || type->kind == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
14180 struct Identifier * id = exp->member.member;
14181 int typeKind = type->kind;
14182 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));
14184 if(typeKind == 19 && exp->member.exp->type == 26)
14186 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14191 if(typeKind == 3 || typeKind == 15)
14192 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
14195 if(type->kind == 8 && type->_class && type->_class->registered)
14197 _class = type->_class->registered;
14199 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
14201 _class = FindClass("char *")->registered;
14203 else if(type->kind == 13)
14205 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
14206 FreeType(exp->expType);
14207 exp->expType = ProcessTypeString("uintptr", 0x0);
14208 exp->byReference = 0x1;
14212 char string[1024] = "";
14213 struct Symbol * classSym;
14215 PrintTypeNoConst(type, string, 0x0, 0x1);
14216 classSym = FindClass(string);
14218 _class = classSym->registered;
14224 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14225 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
14226 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14227 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
14228 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
14230 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
14231 exp->member.memberType = 1;
14232 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
14233 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
14236 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
14238 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14239 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
14241 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14243 member = (((void *)0));
14245 if(!member && !prop)
14246 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14247 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
14248 exp->member.thisPtr = 0x1;
14254 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
14255 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14256 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
14258 if(!prop && !member)
14260 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
14263 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14264 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14265 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14270 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
14271 prop = (((void *)0));
14273 member = (((void *)0));
14277 if(!prop && !member && !method)
14278 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
14279 if(!prop && !member && !method)
14283 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14286 exp->member.memberType = 5;
14287 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14291 char structName[1024];
14292 struct Identifier * id = exp->member.member;
14293 struct Expression * classExp = exp->member.exp;
14296 FreeType(classExp->expType);
14297 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14298 strcpy(structName, "__ecereClassData_");
14299 FullClassNameCat(structName, type->_class->string, 0x0);
14301 exp->member.member = id;
14302 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"))))))));
14304 ProcessExpressionType(exp);
14310 struct Symbol * classSym = FindClass(id->string);
14314 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14317 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14323 exp->member.memberType = 1;
14324 if(!prop->dataType)
14325 ProcessPropertyType(prop);
14326 exp->expType = prop->dataType;
14328 prop->dataType->refCount++;
14332 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14334 FreeExpContents(exp);
14336 exp->identifier = MkIdentifier("class");
14337 ProcessExpressionType(exp);
14340 exp->member.memberType = 3;
14341 DeclareStruct(_class->fullName, 0x0);
14342 if(!member->dataType)
14344 struct Context * context = SetupTemplatesContext(_class);
14346 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14347 FinishTemplatesContext(context);
14349 exp->expType = member->dataType;
14350 if(member->dataType)
14351 member->dataType->refCount++;
14353 else if(revConvert)
14355 exp->member.memberType = 4;
14356 exp->expType = MkClassType(revConvert->_class->fullName);
14361 exp->member.memberType = 2;
14363 if(!method->dataType)
14364 ProcessMethodType(method);
14365 exp->expType = __extension__ ({
14366 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14368 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
14370 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14371 exp->expType->usedClass = _class;
14373 else if(!classProp)
14375 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14377 FreeExpContents(exp);
14379 exp->identifier = MkIdentifier("class");
14380 ProcessExpressionType(exp);
14383 yylloc = exp->member.member->loc;
14384 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14386 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14388 if(_class && exp->expType)
14390 struct __ecereNameSpace__ecere__com__Class * tClass;
14393 while(tClass && !tClass->templateClass)
14394 tClass = tClass->base;
14395 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14398 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14399 struct __ecereNameSpace__ecere__com__Class * sClass;
14401 for(sClass = tClass; sClass; sClass = sClass->base)
14404 if(sClass->templateClass)
14405 sClass = sClass->templateClass;
14406 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14408 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14410 for(sClass = sClass->base; sClass; sClass = sClass->base)
14411 id += sClass->templateParams.count;
14419 if(curParam && tClass->templateArgs[id].dataTypeString)
14421 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14422 struct Context * context = SetupTemplatesContext(tClass);
14424 FreeType(exp->expType);
14425 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14428 if(exp->expType->kind == 21)
14430 FreeType(exp->expType);
14431 exp->expType = ReplaceThisClassType(_class);
14433 if(tClass->templateClass)
14434 exp->expType->passAsTemplate = 0x1;
14437 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14438 if(exp->destType->kind == 21)
14440 FreeType(exp->destType);
14441 exp->destType = ReplaceThisClassType(_class);
14445 FinishTemplatesContext(context);
14448 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14451 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14452 struct __ecereNameSpace__ecere__com__Class * sClass;
14454 for(sClass = tClass; sClass; sClass = sClass->base)
14457 if(sClass->templateClass)
14458 sClass = sClass->templateClass;
14459 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14461 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14463 for(sClass = sClass->base; sClass; sClass = sClass->base)
14464 id += sClass->templateParams.count;
14474 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14475 struct Context * context = SetupTemplatesContext(tClass);
14476 struct Type * basicType;
14478 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14481 if(basicType->kind == 21)
14483 FreeType(basicType);
14484 basicType = ReplaceThisClassType(_class);
14486 FreeType(exp->expType);
14487 exp->expType = __extension__ ({
14488 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14490 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
14494 exp->destType = exp->expType;
14495 exp->destType->refCount++;
14498 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14499 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14500 struct Declarator * decl;
14502 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14505 exp->destType->refCount++;
14507 exp->expType->refCount++;
14509 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14510 exp->cast.exp = newExp;
14513 FinishTemplatesContext(context);
14516 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14518 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14522 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14525 int paramCount = 0;
14526 int lastParam = -1;
14527 char templateString[1024];
14528 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14530 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14531 while(cClass != expClass)
14533 struct __ecereNameSpace__ecere__com__Class * sClass;
14535 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14538 for(param = cClass->templateParams.first; param; param = param->next)
14540 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14543 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14544 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14546 while(cClassCur != tClass && !paramCur)
14548 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14550 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14552 cClassCur = sClassCur;
14553 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14555 if(!strcmp(paramCur->name, param->name))
14562 if(paramCur && paramCur->type == 0)
14563 arg = tClass->templateArgs[cp];
14565 arg = expClass->templateArgs[p];
14567 char argument[256];
14569 argument[0] = '\0';
14570 switch(param->type)
14574 char expString[1024];
14575 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14576 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14577 struct Expression * exp;
14578 char * string = PrintHexUInt64(arg.expression.ui64);
14580 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14581 ProcessExpressionType(exp);
14582 ComputeExpression(exp);
14583 expString[0] = '\0';
14584 PrintExpression(exp, expString);
14585 strcat(argument, expString);
14586 FreeExpression(exp);
14591 strcat(argument, arg.member->name);
14596 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14597 strcat(argument, arg.dataTypeString);
14604 strcat(templateString, ", ");
14605 if(lastParam != p - 1)
14607 strcat(templateString, param->name);
14608 strcat(templateString, " = ");
14610 strcat(templateString, argument);
14619 int len = strlen(templateString);
14621 if(templateString[len - 1] == '>')
14622 templateString[len++] = ' ';
14623 templateString[len++] = '>';
14624 templateString[len++] = '\0';
14626 FreeType(exp->expType);
14628 struct Context * context = SetupTemplatesContext(tClass);
14630 exp->expType = ProcessTypeString(templateString, 0x0);
14631 FinishTemplatesContext(context);
14638 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)");
14640 else if(type && (type->kind == 9 || type->kind == 10))
14642 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14646 exp->expType = memberType;
14648 memberType->refCount++;
14653 char expString[10240];
14655 expString[0] = '\0';
14658 PrintExpression(exp, expString);
14659 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14661 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14663 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14665 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14667 struct Identifier * id = exp->member.member;
14668 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));
14672 FreeType(exp->expType);
14673 exp->expType = ReplaceThisClassType(_class);
14677 yylloc = oldyylloc;
14682 struct Type * destType = exp->destType;
14684 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14686 exp->member.member->classSym = exp->member.member->_class->symbol;
14688 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14692 ProcessExpressionType(exp);
14699 struct Symbol * classSym = exp->_class->symbol;
14701 if(classSym && classSym->registered)
14703 if(classSym->registered->type == 5)
14708 DeclareStruct(classSym->string, 0x0);
14709 FreeSpecifier(exp->_class);
14711 FullClassNameCat(name, classSym->string, 0x0);
14712 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14716 if(classSym->registered->fixed)
14718 FreeSpecifier(exp->_class);
14719 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14724 char className[1024];
14726 strcpy(className, "__ecereClass_");
14727 FullClassNameCat(className, classSym->string, 0x1);
14728 MangleClassName(className);
14729 DeclareClass(classSym, className);
14730 FreeExpContents(exp);
14732 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14733 exp->member.member = MkIdentifier("structSize");
14737 exp->expType = __extension__ ({
14738 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14740 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14746 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14748 exp->expType = __extension__ ({
14749 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14751 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14753 exp->isConstant = 0x1;
14754 DeclareType(type, 0x0, 0x0);
14760 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14763 FreeType(exp->cast.exp->destType);
14764 exp->cast.exp->destType = type;
14766 ProcessExpressionType(exp->cast.exp);
14768 exp->expType = type;
14769 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14771 void * prev = exp->prev, * next = exp->next;
14772 struct Type * expType = exp->cast.exp->destType;
14773 struct Expression * castExp = exp->cast.exp;
14774 struct Type * destType = exp->destType;
14777 expType->refCount++;
14778 FreeType(exp->expType);
14779 FreeTypeName(exp->cast.typeName);
14781 FreeType(exp->expType);
14782 FreeType(exp->destType);
14783 exp->expType = expType;
14784 exp->destType = destType;
14785 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14791 exp->isConstant = exp->cast.exp->isConstant;
14797 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14799 exp->expType = type;
14804 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14806 ProcessExpressionType(exp->vaArg.exp);
14807 exp->expType = type;
14812 struct Expression * e;
14814 exp->isConstant = 0x1;
14815 FreeType(exp->cond.cond->destType);
14816 exp->cond.cond->destType = MkClassType("bool");
14817 exp->cond.cond->destType->truth = 0x1;
14818 ProcessExpressionType(exp->cond.cond);
14819 if(!exp->cond.cond->isConstant)
14820 exp->isConstant = 0x0;
14821 for(e = (*exp->cond.exp).first; e; e = e->next)
14825 FreeType(e->destType);
14826 e->destType = exp->destType;
14828 e->destType->refCount++;
14830 ProcessExpressionType(e);
14833 exp->expType = e->expType;
14835 e->expType->refCount++;
14838 exp->isConstant = 0x0;
14840 FreeType(exp->cond.elseExp->destType);
14841 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14842 if(exp->cond.elseExp->destType)
14843 exp->cond.elseExp->destType->refCount++;
14844 ProcessExpressionType(exp->cond.elseExp);
14845 if(!exp->cond.elseExp->isConstant)
14846 exp->isConstant = 0x0;
14851 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14853 struct Statement * last = (*exp->compound->compound.statements).last;
14855 if(last->type == 3 && last->expressions && (*last->expressions).last)
14857 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14859 exp->destType->refCount++;
14861 ProcessStatement(exp->compound);
14862 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
14864 exp->expType->refCount++;
14870 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14872 if(spec && spec->type == 1)
14874 exp->expType = MkClassType(spec->name);
14875 exp->expType->kind = 19;
14876 exp->byReference = 0x1;
14880 exp->expType = MkClassType("ecere::com::Class");
14881 exp->byReference = 0x1;
14887 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14891 struct Identifier * id = exp->classData.id;
14892 char structName[1024];
14893 struct Expression * classExp;
14895 strcpy(structName, "__ecereClassData_");
14896 FullClassNameCat(structName, _class->fullName, 0x0);
14898 exp->member.member = id;
14899 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14900 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14902 classExp = MkExpIdentifier(MkIdentifier("class"));
14903 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"))))))));
14904 ProcessExpressionType(exp);
14911 struct Type * type = (((void *)0));
14912 char * typeString = (((void *)0));
14913 char typeStringBuf[1024];
14915 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))
14917 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14919 typeString = templateClass->templateArgs[2].dataTypeString;
14923 struct Expression * e;
14925 for(e = (*exp->list).first; e; e = e->next)
14927 ProcessExpressionType(e);
14937 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14941 e->expType = (((void *)0));
14942 e = (*exp->list).first;
14943 ProcessExpressionType(e);
14946 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14948 FreeType(e->expType);
14949 e->expType = (((void *)0));
14951 type = (((void *)0));
14959 FreeType(e->expType);
14960 e->expType = (((void *)0));
14966 typeStringBuf[0] = '\0';
14967 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
14968 typeString = typeStringBuf;
14970 type = (((void *)0));
14975 char templateString[1024];
14976 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14977 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14978 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14979 struct Expression * expExt;
14980 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14982 sprintf(templateString, "Container<%s>", typeString);
14985 struct Expression * e;
14987 type = ProcessTypeString(typeString, 0x0);
14988 while(e = (*exp->list).first)
14990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14991 e->destType = type;
14993 ProcessExpressionType(e);
14994 ListAdd(initializers, MkInitializerAssignment(e));
14997 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14999 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
15000 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
15001 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
15002 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
15003 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
15004 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
15005 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
15006 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
15007 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
15008 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
15009 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15011 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
15013 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
15014 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
15015 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
15016 exp->expType = ProcessTypeString(templateString, 0x0);
15018 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
15019 ProcessExpressionType(expExt);
15023 exp->expType = ProcessTypeString("Container", 0x0);
15024 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15029 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
15031 FreeType(exp->expType);
15032 exp->expType = ReplaceThisClassType(thisClass);
15034 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
15036 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
15040 if(exp->expType->kind != 15)
15042 struct Type * member;
15043 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
15045 FreeType(exp->expType);
15046 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15047 exp->expType->kind = symbol->type->kind;
15048 exp->expType->refCount++;
15049 exp->expType->enumName = enumName;
15050 exp->expType->members = symbol->type->members;
15051 for(member = symbol->type->members.first; member; member = member->next)
15052 member->refCount++;
15056 struct __ecereNameSpace__ecere__sys__NamedLink * member;
15058 for(member = symbol->type->members.first; member; member = member->next)
15060 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
15062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
15068 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
15070 else if(exp->destType && !exp->destType->keepCast)
15072 if(!CheckExpressionType(exp, exp->destType, 0x0))
15074 if(!exp->destType->count || unresolved)
15079 if(exp->destType->kind != 14)
15086 char expString[10240];
15088 expString[0] = '\0';
15089 PrintType(exp->destType, type2, 0x0, 0x1);
15092 PrintExpression(exp, expString);
15093 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
15097 else if(exp->type != 16)
15098 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
15103 char expString[10240];
15105 expString[0] = '\0';
15108 PrintExpression(exp, expString);
15109 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15112 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
15113 else if(exp->type != 16)
15114 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15126 PrintType(exp->expType, type1, 0x0, 0x1);
15127 PrintType(exp->destType, type2, 0x0, 0x1);
15129 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)))
15133 char expString[10240];
15135 expString[0] = '\0';
15138 PrintExpression(exp, expString);
15139 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15141 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
15142 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
15143 FreeType(exp->expType);
15144 exp->destType->refCount++;
15145 exp->expType = exp->destType;
15150 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
15152 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15153 char typeString[1024];
15154 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15155 struct Declarator * decl;
15157 typeString[0] = '\0';
15160 exp->expType->refCount++;
15162 exp->expType->refCount++;
15164 newExp->destType = exp->expType;
15165 PrintType(exp->expType, typeString, 0x0, 0x0);
15166 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15167 exp->cast.typeName = MkTypeName(specs, decl);
15168 exp->cast.exp = newExp;
15171 else if(unresolved)
15173 if(exp->identifier->_class && exp->identifier->_class->name)
15174 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
15175 else if(exp->identifier->string && exp->identifier->string[0])
15176 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
15178 else if(!exp->expType && exp->type != 16)
15180 char expString[10240];
15182 expString[0] = '\0';
15185 PrintExpression(exp, expString);
15186 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15188 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15191 ApplyAnyObjectLogic(exp);
15192 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1)))
15194 exp->byReference = 0x1;
15196 yylloc = oldyylloc;
15199 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)
15203 *curMember = (*curMember)->next;
15204 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
15206 *curMember = subMemberStack[--(*subMemberStackPos)];
15207 *curMember = (*curMember)->next;
15209 while((*curMember) && (*curMember)->isProperty)
15210 *curMember = (*curMember)->next;
15211 if(subMemberStackPos)
15213 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15215 subMemberStack[(*subMemberStackPos)++] = *curMember;
15216 *curMember = (*curMember)->members.first;
15217 while(*curMember && (*curMember)->isProperty)
15218 *curMember = (*curMember)->next;
15226 if(subMemberStackPos && *subMemberStackPos)
15228 *curMember = subMemberStack[--(*subMemberStackPos)];
15229 *curMember = (*curMember)->next;
15233 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
15235 if(*curClass == _class)
15237 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
15239 *curMember = (*curClass)->membersAndProperties.first;
15241 while((*curMember) && (*curMember)->isProperty)
15242 *curMember = (*curMember)->next;
15243 if(subMemberStackPos)
15245 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15247 subMemberStack[(*subMemberStackPos)++] = *curMember;
15248 *curMember = (*curMember)->members.first;
15249 while(*curMember && (*curMember)->isProperty)
15250 *curMember = (*curMember)->next;
15257 static void ProcessInitializer(struct Initializer * init, struct Type * type)
15262 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
15264 if(init->exp && !init->exp->destType)
15266 FreeType(init->exp->destType);
15267 init->exp->destType = type;
15273 ProcessExpressionType(init->exp);
15274 init->isConstant = init->exp->isConstant;
15280 struct Expression * exp = init->exp;
15281 struct Instantiation * inst = exp->instance;
15282 struct MembersInit * members;
15285 init->list = MkList();
15288 for(members = (*inst->members).first; members; members = members->next)
15290 if(members->type == 0)
15292 struct MemberInit * member;
15294 for(member = (*members->dataMembers).first; member; member = member->next)
15296 ListAdd(init->list, member->initializer);
15297 member->initializer = (((void *)0));
15302 FreeExpression(exp);
15306 struct Initializer * i;
15307 struct Type * initializerType = (((void *)0));
15308 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15309 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15310 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15311 int subMemberStackPos = 0;
15313 if(type && type->kind == 12)
15314 initializerType = Dereference(type);
15315 else if(type && (type->kind == 9 || type->kind == 10))
15316 initializerType = type->members.first;
15317 for(i = (*init->list).first; i; i = i->next)
15319 if(type && type->kind == 8 && type->_class && type->_class->registered)
15321 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15324 if(!curMember->dataType)
15325 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15326 initializerType = curMember->dataType;
15329 ProcessInitializer(i, initializerType);
15330 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15331 initializerType = initializerType->next;
15333 init->isConstant = 0x0;
15335 if(type && type->kind == 12)
15336 FreeType(initializerType);
15337 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15339 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15346 extern struct Symbol * FindType(struct Context * ctx, char * name);
15348 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15350 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15356 if(spec->specifier == THISCLASS)
15361 spec->name = ReplaceThisClass(thisClass);
15362 spec->symbol = FindClass(spec->name);
15363 ProcessSpecifier(spec, declareStruct);
15370 struct Symbol * symbol = FindType(curContext, spec->name);
15373 DeclareType(symbol->type, 0x1, 0x1);
15374 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15375 DeclareStruct(spec->name, 0x0);
15380 struct Enumerator * e;
15384 for(e = (*spec->list).first; e; e = e->next)
15387 ProcessExpressionType(e->exp);
15395 if(spec->definitions)
15397 struct ClassDef * def;
15398 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15400 ProcessClass(spec->definitions, symbol);
15407 static void ProcessDeclarator(struct Declarator * decl)
15412 if(decl->identifier->classSym)
15414 FreeSpecifier(decl->identifier->_class);
15415 decl->identifier->_class = (((void *)0));
15419 if(decl->array.exp)
15420 ProcessExpressionType(decl->array.exp);
15427 if(decl->declarator)
15428 ProcessDeclarator(decl->declarator);
15429 if(decl->type == 4)
15431 struct Identifier * id = GetDeclId(decl);
15433 if(id && id->_class)
15435 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15437 if(!decl->function.parameters)
15438 decl->function.parameters = MkList();
15439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15440 id->_class = (((void *)0));
15442 if(decl->function.parameters)
15444 struct TypeName * param;
15446 for(param = (*decl->function.parameters).first; param; param = param->next)
15448 if(param->qualifiers && (*param->qualifiers).first)
15450 struct Specifier * spec = (*param->qualifiers).first;
15452 if(spec && spec->specifier == TYPED_OBJECT)
15454 struct Declarator * d = param->declarator;
15455 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);
15457 FreeList(param->qualifiers, FreeSpecifier);
15458 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15459 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15460 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15463 else if(spec && spec->specifier == ANY_OBJECT)
15465 struct Declarator * d = param->declarator;
15467 FreeList(param->qualifiers, FreeSpecifier);
15468 param->qualifiers = MkListOne(MkSpecifier(VOID));
15469 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15471 else if(spec->specifier == THISCLASS)
15476 spec->name = ReplaceThisClass(thisClass);
15477 spec->symbol = FindClass(spec->name);
15478 ProcessSpecifier(spec, 0x0);
15482 if(param->declarator)
15483 ProcessDeclarator(param->declarator);
15491 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15493 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15495 static void ProcessDeclaration(struct Declaration * decl)
15497 yylloc = decl->loc;
15502 unsigned int declareStruct = 0x0;
15504 if(decl->declarators)
15506 struct InitDeclarator * d;
15508 for(d = (*decl->declarators).first; d; d = d->next)
15510 struct Type * type, * subType;
15512 ProcessDeclarator(d->declarator);
15513 type = ProcessType(decl->specifiers, d->declarator);
15516 ProcessInitializer(d->initializer, type);
15517 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15519 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15521 struct Instantiation * inst = d->initializer->exp->instance;
15523 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15524 d->initializer->exp->instance = (((void *)0));
15525 if(decl->specifiers)
15526 FreeList(decl->specifiers, FreeSpecifier);
15527 FreeList(decl->declarators, FreeInitDeclarator);
15534 for(subType = type; subType; )
15536 if(subType->kind == 8)
15538 declareStruct = 0x1;
15541 else if(subType->kind == 13)
15543 else if(subType->kind == 12)
15544 subType = subType->arrayType;
15553 if(decl->specifiers)
15555 struct Specifier * s;
15557 for(s = (*decl->specifiers).first; s; s = s->next)
15559 ProcessSpecifier(s, declareStruct);
15566 ProcessInstantiationType(decl->inst);
15571 struct Specifier * spec;
15572 struct Declarator * d;
15573 unsigned int declareStruct = 0x0;
15575 if(decl->declarators)
15577 for(d = (*decl->declarators).first; d; d = d->next)
15579 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15580 struct Type * subType;
15582 ProcessDeclarator(d);
15583 for(subType = type; subType; )
15585 if(subType->kind == 8)
15587 declareStruct = 0x1;
15590 else if(subType->kind == 13)
15592 else if(subType->kind == 12)
15593 subType = subType->arrayType;
15600 if(decl->specifiers)
15602 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15603 ProcessSpecifier(spec, declareStruct);
15610 static struct FunctionDefinition * curFunction;
15612 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15614 char propName[1024], propNameM[1024];
15615 char getName[1024], setName[1024];
15616 struct __ecereNameSpace__ecere__sys__OldList * args;
15618 DeclareProperty(prop, setName, getName);
15619 strcpy(propName, "__ecereProp_");
15620 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15621 strcat(propName, "_");
15622 FullClassNameCat(propName, prop->name, 0x1);
15623 MangleClassName(propName);
15624 strcpy(propNameM, "__ecerePropM_");
15625 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15626 strcat(propNameM, "_");
15627 FullClassNameCat(propNameM, prop->name, 0x1);
15628 MangleClassName(propNameM);
15629 if(prop->isWatchable)
15632 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15633 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15634 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15636 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15637 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15638 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15642 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15643 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15644 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15646 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15647 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15648 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15650 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15651 curFunction->propSet->fireWatchersDone = 0x1;
15654 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15656 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15658 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15660 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15662 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15664 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15666 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15668 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15670 static void ProcessStatement(struct Statement * stmt)
15672 yylloc = stmt->loc;
15676 ProcessStatement(stmt->labeled.stmt);
15679 if(stmt->caseStmt.exp)
15681 FreeType(stmt->caseStmt.exp->destType);
15682 stmt->caseStmt.exp->destType = curSwitchType;
15684 curSwitchType->refCount++;
15685 ProcessExpressionType(stmt->caseStmt.exp);
15686 ComputeExpression(stmt->caseStmt.exp);
15688 if(stmt->caseStmt.stmt)
15689 ProcessStatement(stmt->caseStmt.stmt);
15693 if(stmt->compound.context)
15695 struct Declaration * decl;
15696 struct Statement * s;
15697 struct Statement * prevCompound = curCompound;
15698 struct Context * prevContext = curContext;
15700 if(!stmt->compound.isSwitch)
15702 curCompound = stmt;
15703 curContext = stmt->compound.context;
15705 if(stmt->compound.declarations)
15707 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15708 ProcessDeclaration(decl);
15710 if(stmt->compound.statements)
15712 for(s = (*stmt->compound.statements).first; s; s = s->next)
15713 ProcessStatement(s);
15715 curContext = prevContext;
15716 curCompound = prevCompound;
15722 struct Expression * exp;
15724 if(stmt->expressions)
15726 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15727 ProcessExpressionType(exp);
15733 struct Expression * exp;
15735 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15736 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15737 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15738 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15740 ProcessExpressionType(exp);
15742 if(stmt->ifStmt.stmt)
15743 ProcessStatement(stmt->ifStmt.stmt);
15744 if(stmt->ifStmt.elseStmt)
15745 ProcessStatement(stmt->ifStmt.elseStmt);
15750 struct Type * oldSwitchType = curSwitchType;
15752 if(stmt->switchStmt.exp)
15754 struct Expression * exp;
15756 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15760 ProcessExpressionType(exp);
15763 curSwitchType = exp->expType;
15766 ProcessStatement(stmt->switchStmt.stmt);
15767 curSwitchType = oldSwitchType;
15772 if(stmt->whileStmt.exp)
15774 struct Expression * exp;
15776 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15777 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15778 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15779 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15781 ProcessExpressionType(exp);
15784 if(stmt->whileStmt.stmt)
15785 ProcessStatement(stmt->whileStmt.stmt);
15790 if(stmt->doWhile.exp)
15792 struct Expression * exp;
15794 if((*stmt->doWhile.exp).last)
15796 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15797 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15798 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15800 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15802 ProcessExpressionType(exp);
15805 if(stmt->doWhile.stmt)
15806 ProcessStatement(stmt->doWhile.stmt);
15811 struct Expression * exp;
15813 if(stmt->forStmt.init)
15814 ProcessStatement(stmt->forStmt.init);
15815 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15817 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15818 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15819 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15821 if(stmt->forStmt.check)
15822 ProcessStatement(stmt->forStmt.check);
15823 if(stmt->forStmt.increment)
15825 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15826 ProcessExpressionType(exp);
15828 if(stmt->forStmt.stmt)
15829 ProcessStatement(stmt->forStmt.stmt);
15834 struct Identifier * id = stmt->forEachStmt.id;
15835 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15836 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15837 struct Statement * block = stmt->forEachStmt.stmt;
15838 char iteratorType[1024];
15839 struct Type * source;
15840 struct Expression * e;
15841 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));
15842 struct Expression * arrayExp;
15843 char * typeString = (((void *)0));
15844 int builtinCount = 0;
15846 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15850 FreeType(e->destType);
15851 e->destType = ProcessTypeString("Container", 0x0);
15853 if(!isBuiltin || e->next)
15854 ProcessExpressionType(e);
15856 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15857 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15859 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15860 struct Symbol * symbol;
15861 struct Expression * expIt = (((void *)0));
15862 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15863 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15864 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15865 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15868 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15869 stmt->compound.context->parent = curContext;
15870 curContext = stmt->compound.context;
15871 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15873 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15874 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15876 isCustomAVLTree = 0x1;
15877 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15879 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15882 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15884 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15886 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15889 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15893 struct Declarator * decl;
15894 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15896 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15897 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15898 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15902 struct Type * type = (((void *)0));
15903 char typeStringBuf[1024];
15905 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15906 if(((struct Expression *)(*exp).last)->type == 11)
15908 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15911 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15913 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)
15915 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15917 typeString = templateClass->templateArgs[2].dataTypeString;
15919 else if(arrayExp->list)
15921 struct Expression * e;
15923 for(e = (*arrayExp->list).first; e; e = e->next)
15925 ProcessExpressionType(e);
15935 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15939 e->expType = (((void *)0));
15940 e = (*arrayExp->list).first;
15941 ProcessExpressionType(e);
15944 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15946 FreeType(e->expType);
15947 e->expType = (((void *)0));
15949 type = (((void *)0));
15957 FreeType(e->expType);
15958 e->expType = (((void *)0));
15964 typeStringBuf[0] = '\0';
15965 PrintType(type, typeStringBuf, 0x0, 0x1);
15966 typeString = typeStringBuf;
15972 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15973 struct Declarator * decl;
15974 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15978 struct Expression * e;
15980 builtinCount = (*arrayExp->list).count;
15981 type = ProcessTypeString(typeString, 0x0);
15982 while(e = (*arrayExp->list).first)
15984 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15985 e->destType = type;
15987 ProcessExpressionType(e);
15988 ListAdd(initializers, MkInitializerAssignment(e));
15991 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15993 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15994 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15995 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15996 FreeList(exp, FreeExpression);
16000 arrayExp->expType = ProcessTypeString("Container", 0x0);
16001 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
16004 else if(isLinkList && !isList)
16006 struct Declarator * decl;
16007 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16009 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
16010 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16011 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
16013 else if(_class->templateArgs)
16016 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
16018 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
16019 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
16021 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
16024 switch(block->type)
16027 if(block->compound.context)
16028 block->compound.context->parent = stmt->compound.context;
16031 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
16032 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
16033 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
16034 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
16037 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
16038 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
16041 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
16042 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
16045 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
16046 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
16049 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
16050 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
16053 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
16054 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
16060 block = MkIfStmt(filter, block, (((void *)0)));
16064 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));
16065 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
16066 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
16067 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
16073 sprintf(count, "%d", builtinCount);
16074 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));
16075 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
16076 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
16077 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
16079 else if(isLinkList && !isList)
16081 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
16082 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
16084 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
16086 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));
16090 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16091 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
16093 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));
16095 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
16096 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
16097 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
16101 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
16103 ProcessExpressionType(expIt);
16104 if((*stmt->compound.declarations).first)
16105 ProcessDeclaration((*stmt->compound.declarations).first);
16107 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
16108 ProcessStatement(stmt);
16109 curContext = stmt->compound.context->parent;
16114 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
16126 struct Expression * exp;
16128 if(stmt->expressions)
16130 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16134 if(curFunction && !curFunction->type)
16135 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
16136 FreeType(exp->destType);
16137 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
16139 exp->destType->refCount++;
16141 ProcessExpressionType(exp);
16148 ProcessDeclaration(stmt->decl);
16153 struct AsmField * field;
16155 if(stmt->asmStmt.inputFields)
16157 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
16158 if(field->expression)
16159 ProcessExpressionType(field->expression);
16161 if(stmt->asmStmt.outputFields)
16163 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
16164 if(field->expression)
16165 ProcessExpressionType(field->expression);
16167 if(stmt->asmStmt.clobberedFields)
16169 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
16171 if(field->expression)
16172 ProcessExpressionType(field->expression);
16179 struct PropertyWatch * propWatch;
16180 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16181 struct Expression * object = stmt->_watch.object;
16182 struct Expression * watcher = stmt->_watch.watcher;
16185 ProcessExpressionType(watcher);
16187 ProcessExpressionType(object);
16190 if(watcher || thisClass)
16192 struct External * external = curExternal;
16193 struct Context * context = curContext;
16196 stmt->expressions = MkList();
16197 curExternal = external->prev;
16198 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16200 struct ClassFunction * func;
16201 char watcherName[1024];
16202 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
16203 struct External * createdExternal;
16204 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
16206 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
16207 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
16208 if(propWatch->deleteWatch)
16209 strcat(watcherName, "_delete");
16212 struct Identifier * propID;
16214 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16216 strcat(watcherName, "_");
16217 strcat(watcherName, propID->string);
16220 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
16222 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
16223 ProcessClassFunctionBody(func, propWatch->compound);
16224 propWatch->compound = (((void *)0));
16225 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
16226 createdExternal->symbol->idCode = external->symbol->idCode;
16227 curExternal = createdExternal;
16228 ProcessFunction(createdExternal->function);
16230 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
16232 externalDecl->declaration = decl;
16233 if(decl->symbol && !decl->symbol->pointerExternal)
16234 decl->symbol->pointerExternal = externalDecl;
16236 if(propWatch->deleteWatch)
16238 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16240 ListAdd(args, CopyExpression(object));
16241 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16242 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16243 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
16247 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
16248 struct Identifier * propID;
16250 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16252 char propName[1024];
16253 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16257 char getName[1024], setName[1024];
16258 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16260 DeclareProperty(prop, setName, getName);
16261 strcpy(propName, "__ecereProp_");
16262 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16263 strcat(propName, "_");
16264 FullClassNameCat(propName, prop->name, 0x1);
16265 ListAdd(args, CopyExpression(object));
16266 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16267 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16268 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16269 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
16272 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16277 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
16279 curExternal = external;
16280 curContext = context;
16282 FreeExpression(watcher);
16284 FreeExpression(object);
16285 FreeList(watches, FreePropertyWatch);
16288 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
16292 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16294 ProcessStatement(propWatch->compound);
16301 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16302 struct Expression * object = stmt->_watch.object;
16303 struct __ecereNameSpace__ecere__com__Class * _class;
16306 ProcessExpressionType(object);
16309 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
16312 struct Identifier * propID;
16315 stmt->expressions = MkList();
16316 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16318 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
16325 for(propID = (*watches).first; propID; propID = propID->next)
16327 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16331 CreateFireWatcher(prop, object, stmt);
16334 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16339 struct __ecereNameSpace__ecere__com__Property * prop;
16340 struct __ecereNameSpace__ecere__com__Class * base;
16342 for(base = _class; base; base = base->base)
16344 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16346 if(prop->isProperty && prop->isWatchable)
16348 CreateFireWatcher(prop, object, stmt);
16354 FreeExpression(object);
16355 FreeList(watches, FreeIdentifier);
16358 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16364 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16365 struct Expression * object = stmt->_watch.object;
16366 struct Expression * watcher = stmt->_watch.watcher;
16367 struct __ecereNameSpace__ecere__com__Class * _class;
16370 ProcessExpressionType(object);
16372 ProcessExpressionType(watcher);
16375 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16376 if(watcher || thisClass)
16380 struct Identifier * propID;
16383 stmt->expressions = MkList();
16386 struct __ecereNameSpace__ecere__sys__OldList * args;
16389 ListAdd(args, CopyExpression(object));
16390 ListAdd(args, MkExpConstant("0"));
16391 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16392 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16396 for(propID = (*watches).first; propID; propID = propID->next)
16398 char propName[1024];
16399 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16403 char getName[1024], setName[1024];
16404 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16406 DeclareProperty(prop, setName, getName);
16407 strcpy(propName, "__ecereProp_");
16408 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16409 strcat(propName, "_");
16410 FullClassNameCat(propName, prop->name, 0x1);
16411 MangleClassName(propName);
16412 ListAdd(args, CopyExpression(object));
16413 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16414 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16415 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16418 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16422 FreeExpression(object);
16424 FreeExpression(watcher);
16425 FreeList(watches, FreeIdentifier);
16428 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16431 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16438 extern struct Expression * QBrackets(struct Expression * exp);
16440 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16442 extern struct Declarator * QMkPtrDecl(char * id);
16444 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16446 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16448 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16450 static void ProcessFunction(struct FunctionDefinition * function)
16452 struct Identifier * id = GetDeclId(function->declarator);
16453 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16454 struct Type * type = symbol ? symbol->type : (((void *)0));
16455 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16456 struct Context * oldTopContext = topContext;
16458 yylloc = function->loc;
16459 if(type && type->thisClass)
16461 struct Symbol * classSym = type->thisClass;
16462 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16463 char className[1024];
16464 char structName[1024];
16465 struct Declarator * funcDecl;
16466 struct Symbol * thisSymbol;
16467 unsigned int typedObject = 0x0;
16469 if(_class && !_class->base)
16471 _class = currentClass;
16472 if(_class && !_class->symbol)
16473 _class->symbol = FindClass(_class->fullName);
16474 classSym = _class ? _class->symbol : (((void *)0));
16477 thisClass = _class;
16478 if(inCompiler && _class)
16480 if(type->kind == 11)
16482 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16484 struct Type * param = symbol->type->params.first;
16486 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16489 if(type->classObjectType != 1)
16491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16492 symbol->type->staticMethod = 0x1;
16493 symbol->type->thisClass = (((void *)0));
16494 symbol->type->extraParam = 0x0;
16497 strcpy(className, "__ecereClass_");
16498 FullClassNameCat(className, _class->fullName, 0x1);
16499 MangleClassName(className);
16500 structName[0] = (char)0;
16501 FullClassNameCat(structName, _class->fullName, 0x0);
16502 funcDecl = GetFuncDecl(function->declarator);
16505 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16507 struct TypeName * param = (*funcDecl->function.parameters).first;
16509 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16512 FreeTypeName(param);
16515 if(!function->propertyNoThis)
16517 struct TypeName * thisParam;
16519 if(type->classObjectType != 1)
16521 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16522 if(!funcDecl->function.parameters)
16523 funcDecl->function.parameters = MkList();
16524 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16528 if(type->classObjectType != 1)
16530 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16531 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16533 thisParam = __extension__ ({
16534 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
16536 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
16538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16542 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16544 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16546 funcDecl = GetFuncDecl(initDecl->declarator);
16549 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16551 struct TypeName * param = (*funcDecl->function.parameters).first;
16553 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16556 FreeTypeName(param);
16559 if(type->classObjectType != 1)
16561 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16563 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16565 if(!funcDecl->function.parameters)
16566 funcDecl->function.parameters = MkList();
16567 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16575 if(type->classObjectType != 1)
16577 thisSymbol = __extension__ ({
16578 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16580 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
16582 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16583 if(typedObject && thisSymbol->type)
16585 thisSymbol->type->classObjectType = 2;
16586 thisSymbol->type->byReference = type->byReference;
16587 thisSymbol->type->typedByReference = type->byReference;
16591 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16593 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16596 struct __ecereNameSpace__ecere__com__Class * base;
16598 for(base = _class; base && base->type != 1000; base = base->next)
16600 for(member = base->membersAndProperties.first; member; member = member->next)
16601 if(!member->isProperty)
16607 for(member = _class->membersAndProperties.first; member; member = member->next)
16608 if(!member->isProperty)
16612 char pointerName[1024];
16613 struct Declaration * decl;
16614 struct Initializer * initializer;
16615 struct Expression * exp, * bytePtr;
16617 strcpy(pointerName, "__ecerePointer_");
16618 FullClassNameCat(pointerName, _class->fullName, 0x0);
16620 char className[1024];
16622 strcpy(className, "__ecereClass_");
16623 FullClassNameCat(className, classSym->string, 0x1);
16624 MangleClassName(className);
16625 DeclareClass(classSym, className);
16627 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16632 sprintf(string, "%d", _class->offset);
16633 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16637 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16639 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16640 exp->expType = __extension__ ({
16641 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16643 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
16644 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16646 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
16647 }), __ecereInstance2;
16651 yylloc = function->body->loc;
16652 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16654 struct Context * prevContext = curContext;
16656 curContext = function->body->compound.context;
16657 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16658 curContext = prevContext;
16660 decl->symbol = (((void *)0));
16661 if(!function->body->compound.declarations)
16662 function->body->compound.declarations = MkList();
16663 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16669 thisClass = (((void *)0));
16672 FreeSpecifier(id->_class);
16673 id->_class = (((void *)0));
16674 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16676 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16678 id = GetDeclId(initDecl->declarator);
16679 FreeSpecifier(id->_class);
16680 id->_class = (((void *)0));
16684 topContext = function->body->compound.context;
16686 struct FunctionDefinition * oldFunction = curFunction;
16688 curFunction = function;
16690 ProcessStatement(function->body);
16691 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16693 struct Statement * prevCompound = curCompound;
16694 struct Context * prevContext = curContext;
16695 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16697 if(!function->body->compound.statements)
16698 function->body->compound.statements = MkList();
16699 ListAdd(function->body->compound.statements, fireWatchers);
16700 curCompound = function->body;
16701 curContext = function->body->compound.context;
16702 ProcessStatement(fireWatchers);
16703 curContext = prevContext;
16704 curCompound = prevCompound;
16706 curFunction = oldFunction;
16708 if(function->declarator)
16710 ProcessDeclarator(function->declarator);
16712 topContext = oldTopContext;
16713 thisClass = oldThisClass;
16716 extern void FreeSymbol(struct Symbol * symbol);
16718 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16720 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16722 struct ClassDef * def;
16723 struct External * external = curExternal;
16724 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16726 for(def = definitions->first; def; def = def->next)
16730 if(def->function->declarator)
16731 curExternal = def->function->declarator->symbol->pointerExternal;
16733 curExternal = external;
16734 ProcessFunction((struct FunctionDefinition *)def->function);
16736 else if(def->type == 2)
16738 if(def->decl->type == 2)
16740 thisClass = regClass;
16741 ProcessInstantiationType(def->decl->inst);
16742 thisClass = (((void *)0));
16746 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16749 thisClass = regClass;
16750 ProcessDeclaration(def->decl);
16751 thisClass = backThisClass;
16754 else if(def->type == 1 && def->defProperties)
16756 struct MemberInit * defProperty;
16757 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);
16759 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16760 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16762 thisClass = regClass;
16763 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16764 thisClass = (((void *)0));
16766 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16767 FreeSymbol(thisSymbol);
16769 else if(def->type == 3 && def->propertyDef)
16771 struct PropertyDef * prop = def->propertyDef;
16773 thisClass = regClass;
16778 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16780 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16782 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16783 ProcessStatement(prop->setStmt);
16789 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16791 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16793 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16794 ProcessStatement(prop->getStmt);
16796 if(prop->issetStmt)
16800 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16802 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16804 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16805 ProcessStatement(prop->issetStmt);
16807 thisClass = (((void *)0));
16809 else if(def->type == 4 && def->propertyWatch)
16811 struct PropertyWatch * propertyWatch = def->propertyWatch;
16813 thisClass = regClass;
16814 if(propertyWatch->compound)
16816 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);
16818 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16819 curExternal = (((void *)0));
16820 ProcessStatement(propertyWatch->compound);
16822 thisClass = (((void *)0));
16827 void DeclareFunctionUtil(char * s)
16829 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16836 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16837 strcpy(name, "__ecereFunction_");
16838 FullClassNameCat(name, s, 0x0);
16839 DeclareFunction(function, name);
16843 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16845 void ComputeDataTypes()
16847 struct External * external;
16848 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16849 struct External * after = (((void *)0));
16851 currentClass = (((void *)0));
16852 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16853 for(external = (*ast).first; external; external = external->next)
16855 if(external->type == 1)
16857 struct Declaration * decl = external->declaration;
16861 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16865 struct InitDeclarator * initDecl = (*decls).first;
16869 struct Declarator * declarator = initDecl->declarator;
16871 if(declarator && declarator->type == 1)
16873 struct Identifier * id = declarator->identifier;
16875 if(id && id->string)
16877 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16879 external->symbol->id = -1001, external->symbol->idCode = -1001;
16889 temp->symbol = __extension__ ({
16890 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16892 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
16894 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16895 curExternal = temp;
16896 DeclareFunctionUtil("eSystem_New");
16897 DeclareFunctionUtil("eSystem_New0");
16898 DeclareFunctionUtil("eSystem_Renew");
16899 DeclareFunctionUtil("eSystem_Renew0");
16900 DeclareFunctionUtil("eClass_GetProperty");
16901 DeclareStruct("ecere::com::Class", 0x0);
16902 DeclareStruct("ecere::com::Instance", 0x0);
16903 DeclareStruct("ecere::com::Property", 0x0);
16904 DeclareStruct("ecere::com::DataMember", 0x0);
16905 DeclareStruct("ecere::com::Method", 0x0);
16906 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16907 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16908 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16909 for(external = (*ast).first; external; external = external->next)
16911 afterExternal = curExternal = external;
16912 if(external->type == 0)
16914 currentClass = external->function->_class;
16915 ProcessFunction(external->function);
16917 else if(external->type == 1)
16919 currentClass = (((void *)0));
16920 ProcessDeclaration(external->declaration);
16922 else if(external->type == 2)
16924 struct ClassDefinition * _class = external->_class;
16926 currentClass = external->symbol->registered;
16927 if(_class->definitions)
16929 ProcessClass(_class->definitions, _class->symbol);
16933 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16934 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16937 else if(external->type == 4)
16939 thisNameSpace = external->id->string;
16942 currentClass = (((void *)0));
16943 thisNameSpace = (((void *)0));
16944 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16945 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16948 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);
16950 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* Constructor)(void * ), void (* Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16952 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16954 struct __ecereNameSpace__ecere__com__Class * class;
16956 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16957 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16958 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16959 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16960 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16961 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16962 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16963 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16964 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16965 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16966 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16967 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16968 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16969 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16970 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16971 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16972 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16973 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16974 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16975 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16976 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16977 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16978 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16979 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16980 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16981 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16982 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16983 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16984 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16985 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16986 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16987 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16988 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16989 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16990 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16991 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("AddMembers", "int AddMembers(ecere::sys::OldList * declarations, ecere::com::Class _class, bool isMember, uint * retSize, ecere::com::Class topClass, bool * addedPadding)", AddMembers, module, 2);
16992 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16993 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16994 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16995 __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);
16996 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16997 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16998 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16999 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
17000 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
17001 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
17002 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
17003 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
17004 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
17005 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
17006 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
17007 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
17008 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
17009 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
17010 __ecereClass_Conversion = class;
17011 __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);
17012 __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);
17013 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
17014 __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);
17015 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
17016 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
17017 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
17018 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
17019 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
17020 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
17021 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
17022 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
17023 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
17024 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
17025 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
17026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
17027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
17028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
17029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
17030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
17031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
17032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
17035 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)