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 Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 int value2 = op2->i;
5674 exp->string = PrintInt64(op1->i + value2);
5677 exp->expType = op1->type;
5679 op1->type->refCount++;
5684 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 unsigned int value2 = op2->ui;
5689 exp->string = PrintUInt64(op1->ui + value2);
5692 exp->expType = op1->type;
5694 op1->type->refCount++;
5699 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 short value2 = op2->s;
5704 exp->string = PrintShort(op1->s + value2);
5707 exp->expType = op1->type;
5709 op1->type->refCount++;
5714 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 unsigned short value2 = op2->us;
5719 exp->string = PrintUShort(op1->us + value2);
5722 exp->expType = op1->type;
5724 op1->type->refCount++;
5729 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 char value2 = op2->c;
5734 exp->string = PrintChar(op1->c + value2);
5737 exp->expType = op1->type;
5739 op1->type->refCount++;
5744 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 unsigned char value2 = op2->uc;
5749 exp->string = PrintUChar(op1->uc + value2);
5752 exp->expType = op1->type;
5754 op1->type->refCount++;
5759 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5761 float value2 = op2->f;
5764 exp->string = PrintFloat(op1->f + value2);
5767 exp->expType = op1->type;
5769 op1->type->refCount++;
5774 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 double value2 = op2->d;
5779 exp->string = PrintDouble(op1->d + value2);
5782 exp->expType = op1->type;
5784 op1->type->refCount++;
5789 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 int value2 = op2->i;
5794 exp->string = PrintInt(op1->i - value2);
5797 exp->expType = op1->type;
5799 op1->type->refCount++;
5804 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 unsigned int value2 = op2->ui;
5809 exp->string = PrintUInt(op1->ui - value2);
5812 exp->expType = op1->type;
5814 op1->type->refCount++;
5819 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 int value2 = op2->i;
5824 exp->string = PrintInt64(op1->i - value2);
5827 exp->expType = op1->type;
5829 op1->type->refCount++;
5834 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 unsigned int value2 = op2->ui;
5839 exp->string = PrintUInt64(op1->ui - value2);
5842 exp->expType = op1->type;
5844 op1->type->refCount++;
5849 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 short value2 = op2->s;
5854 exp->string = PrintShort(op1->s - value2);
5857 exp->expType = op1->type;
5859 op1->type->refCount++;
5864 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 unsigned short value2 = op2->us;
5869 exp->string = PrintUShort(op1->us - value2);
5872 exp->expType = op1->type;
5874 op1->type->refCount++;
5879 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 char value2 = op2->c;
5884 exp->string = PrintChar(op1->c - value2);
5887 exp->expType = op1->type;
5889 op1->type->refCount++;
5894 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 unsigned char value2 = op2->uc;
5899 exp->string = PrintUChar(op1->uc - value2);
5902 exp->expType = op1->type;
5904 op1->type->refCount++;
5909 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 float value2 = op2->f;
5914 exp->string = PrintFloat(op1->f - value2);
5917 exp->expType = op1->type;
5919 op1->type->refCount++;
5924 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 double value2 = op2->d;
5929 exp->string = PrintDouble(op1->d - value2);
5932 exp->expType = op1->type;
5934 op1->type->refCount++;
5939 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 int value2 = op2->i;
5944 exp->string = PrintInt(op1->i * value2);
5947 exp->expType = op1->type;
5949 op1->type->refCount++;
5954 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 unsigned int value2 = op2->ui;
5959 exp->string = PrintUInt(op1->ui * value2);
5962 exp->expType = op1->type;
5964 op1->type->refCount++;
5969 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 int value2 = op2->i;
5974 exp->string = PrintInt64(op1->i * value2);
5977 exp->expType = op1->type;
5979 op1->type->refCount++;
5984 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 unsigned int value2 = op2->ui;
5989 exp->string = PrintUInt64(op1->ui * value2);
5992 exp->expType = op1->type;
5994 op1->type->refCount++;
5999 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 short value2 = op2->s;
6004 exp->string = PrintShort(op1->s * value2);
6007 exp->expType = op1->type;
6009 op1->type->refCount++;
6014 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 unsigned short value2 = op2->us;
6019 exp->string = PrintUShort(op1->us * value2);
6022 exp->expType = op1->type;
6024 op1->type->refCount++;
6029 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 char value2 = op2->c;
6034 exp->string = PrintChar(op1->c * value2);
6037 exp->expType = op1->type;
6039 op1->type->refCount++;
6044 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6046 unsigned char value2 = op2->uc;
6049 exp->string = PrintUChar(op1->uc * value2);
6052 exp->expType = op1->type;
6054 op1->type->refCount++;
6059 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6061 float value2 = op2->f;
6064 exp->string = PrintFloat(op1->f * value2);
6067 exp->expType = op1->type;
6069 op1->type->refCount++;
6074 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6076 double value2 = op2->d;
6079 exp->string = PrintDouble(op1->d * value2);
6082 exp->expType = op1->type;
6084 op1->type->refCount++;
6089 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6091 int value2 = op2->i;
6094 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6097 exp->expType = op1->type;
6099 op1->type->refCount++;
6104 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6106 unsigned int value2 = op2->ui;
6109 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6112 exp->expType = op1->type;
6114 op1->type->refCount++;
6119 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6121 int value2 = op2->i;
6124 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6127 exp->expType = op1->type;
6129 op1->type->refCount++;
6134 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6136 unsigned int value2 = op2->ui;
6139 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
6142 exp->expType = op1->type;
6144 op1->type->refCount++;
6149 static unsigned int ShortDiv(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 UShortDiv(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 CharDiv(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 UCharDiv(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 FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6211 float value2 = op2->f;
6214 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6217 exp->expType = op1->type;
6219 op1->type->refCount++;
6224 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6226 double value2 = op2->d;
6229 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6241 int value2 = op2->i;
6244 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6247 exp->expType = op1->type;
6249 op1->type->refCount++;
6254 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6256 unsigned int value2 = op2->ui;
6259 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6262 exp->expType = op1->type;
6264 op1->type->refCount++;
6269 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6271 int value2 = op2->i;
6274 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6277 exp->expType = op1->type;
6279 op1->type->refCount++;
6284 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6286 unsigned int value2 = op2->ui;
6289 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6292 exp->expType = op1->type;
6294 op1->type->refCount++;
6299 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6301 short value2 = op2->s;
6304 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6307 exp->expType = op1->type;
6309 op1->type->refCount++;
6314 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6316 unsigned short value2 = op2->us;
6319 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6322 exp->expType = op1->type;
6324 op1->type->refCount++;
6329 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6331 char value2 = op2->c;
6334 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6337 exp->expType = op1->type;
6339 op1->type->refCount++;
6344 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6346 unsigned char value2 = op2->uc;
6349 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6352 exp->expType = op1->type;
6354 op1->type->refCount++;
6359 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6362 exp->string = PrintInt((-op1->i));
6365 exp->expType = op1->type;
6367 op1->type->refCount++;
6372 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6375 exp->string = PrintUInt((unsigned int)(-op1->ui));
6378 exp->expType = op1->type;
6380 op1->type->refCount++;
6385 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6388 exp->string = PrintInt64((-op1->i));
6391 exp->expType = op1->type;
6393 op1->type->refCount++;
6398 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6401 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6404 exp->expType = op1->type;
6406 op1->type->refCount++;
6411 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6414 exp->string = PrintShort((-op1->s));
6417 exp->expType = op1->type;
6419 op1->type->refCount++;
6424 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6427 exp->string = PrintUShort((unsigned short)(-op1->us));
6430 exp->expType = op1->type;
6432 op1->type->refCount++;
6437 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6440 exp->string = PrintChar((-op1->c));
6443 exp->expType = op1->type;
6445 op1->type->refCount++;
6450 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6453 exp->string = PrintUChar((unsigned char)(-op1->uc));
6456 exp->expType = op1->type;
6458 op1->type->refCount++;
6463 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6466 exp->string = PrintFloat((float)(-op1->f));
6469 exp->expType = op1->type;
6471 op1->type->refCount++;
6476 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6479 exp->string = PrintDouble((double)(-op1->d));
6482 exp->expType = op1->type;
6484 op1->type->refCount++;
6489 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6492 exp->string = PrintInt((++op1->i));
6495 exp->expType = op1->type;
6497 op1->type->refCount++;
6502 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6505 exp->string = PrintUInt((++op1->ui));
6508 exp->expType = op1->type;
6510 op1->type->refCount++;
6515 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6518 exp->string = PrintInt64((++op1->i));
6521 exp->expType = op1->type;
6523 op1->type->refCount++;
6528 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6531 exp->string = PrintUInt64((++op1->ui));
6534 exp->expType = op1->type;
6536 op1->type->refCount++;
6541 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6544 exp->string = PrintShort((++op1->s));
6547 exp->expType = op1->type;
6549 op1->type->refCount++;
6554 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6557 exp->string = PrintUShort((++op1->us));
6560 exp->expType = op1->type;
6562 op1->type->refCount++;
6567 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6570 exp->string = PrintChar((++op1->c));
6573 exp->expType = op1->type;
6575 op1->type->refCount++;
6580 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6583 exp->string = PrintUChar((++op1->uc));
6586 exp->expType = op1->type;
6588 op1->type->refCount++;
6593 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6596 exp->string = PrintFloat((float)(++op1->f));
6599 exp->expType = op1->type;
6601 op1->type->refCount++;
6606 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6609 exp->string = PrintDouble((double)(++op1->d));
6612 exp->expType = op1->type;
6614 op1->type->refCount++;
6619 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6622 exp->string = PrintInt((--op1->i));
6625 exp->expType = op1->type;
6627 op1->type->refCount++;
6632 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6635 exp->string = PrintUInt((--op1->ui));
6638 exp->expType = op1->type;
6640 op1->type->refCount++;
6645 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6648 exp->string = PrintInt64((--op1->i));
6651 exp->expType = op1->type;
6653 op1->type->refCount++;
6658 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6661 exp->string = PrintUInt64((--op1->ui));
6664 exp->expType = op1->type;
6666 op1->type->refCount++;
6671 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6674 exp->string = PrintShort((--op1->s));
6677 exp->expType = op1->type;
6679 op1->type->refCount++;
6684 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6687 exp->string = PrintUShort((--op1->us));
6690 exp->expType = op1->type;
6692 op1->type->refCount++;
6697 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6700 exp->string = PrintChar((--op1->c));
6703 exp->expType = op1->type;
6705 op1->type->refCount++;
6710 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6713 exp->string = PrintUChar((--op1->uc));
6716 exp->expType = op1->type;
6718 op1->type->refCount++;
6723 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6726 exp->string = PrintFloat((float)(--op1->f));
6729 exp->expType = op1->type;
6731 op1->type->refCount++;
6736 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6739 exp->string = PrintDouble((double)(--op1->d));
6742 exp->expType = op1->type;
6744 op1->type->refCount++;
6749 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6751 int value2 = op2->i;
6754 exp->string = PrintInt(op1->i = value2);
6757 exp->expType = op1->type;
6759 op1->type->refCount++;
6764 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6766 unsigned int value2 = op2->ui;
6769 exp->string = PrintUInt(op1->ui = value2);
6772 exp->expType = op1->type;
6774 op1->type->refCount++;
6779 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6781 int value2 = op2->i;
6784 exp->string = PrintInt64(op1->i = value2);
6787 exp->expType = op1->type;
6789 op1->type->refCount++;
6794 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6796 unsigned int value2 = op2->ui;
6799 exp->string = PrintUInt64(op1->ui = value2);
6802 exp->expType = op1->type;
6804 op1->type->refCount++;
6809 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6811 short value2 = op2->s;
6814 exp->string = PrintShort(op1->s = value2);
6817 exp->expType = op1->type;
6819 op1->type->refCount++;
6824 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6826 unsigned short value2 = op2->us;
6829 exp->string = PrintUShort(op1->us = value2);
6832 exp->expType = op1->type;
6834 op1->type->refCount++;
6839 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6841 char value2 = op2->c;
6844 exp->string = PrintChar(op1->c = value2);
6847 exp->expType = op1->type;
6849 op1->type->refCount++;
6854 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6856 unsigned char value2 = op2->uc;
6859 exp->string = PrintUChar(op1->uc = value2);
6862 exp->expType = op1->type;
6864 op1->type->refCount++;
6869 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6871 float value2 = op2->f;
6874 exp->string = PrintFloat(op1->f = value2);
6877 exp->expType = op1->type;
6879 op1->type->refCount++;
6884 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6886 double value2 = op2->d;
6889 exp->string = PrintDouble(op1->d = value2);
6892 exp->expType = op1->type;
6894 op1->type->refCount++;
6899 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6901 int value2 = op2->i;
6904 exp->string = PrintInt(op1->i += value2);
6907 exp->expType = op1->type;
6909 op1->type->refCount++;
6914 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6916 unsigned int value2 = op2->ui;
6919 exp->string = PrintUInt(op1->ui += value2);
6922 exp->expType = op1->type;
6924 op1->type->refCount++;
6929 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6931 int value2 = op2->i;
6934 exp->string = PrintInt64(op1->i += value2);
6937 exp->expType = op1->type;
6939 op1->type->refCount++;
6944 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6946 unsigned int value2 = op2->ui;
6949 exp->string = PrintUInt64(op1->ui += value2);
6952 exp->expType = op1->type;
6954 op1->type->refCount++;
6959 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6961 short value2 = op2->s;
6964 exp->string = PrintShort(op1->s += value2);
6967 exp->expType = op1->type;
6969 op1->type->refCount++;
6974 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6976 unsigned short value2 = op2->us;
6979 exp->string = PrintUShort(op1->us += value2);
6982 exp->expType = op1->type;
6984 op1->type->refCount++;
6989 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6991 char value2 = op2->c;
6994 exp->string = PrintChar(op1->c += value2);
6997 exp->expType = op1->type;
6999 op1->type->refCount++;
7004 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7006 unsigned char value2 = op2->uc;
7009 exp->string = PrintUChar(op1->uc += value2);
7012 exp->expType = op1->type;
7014 op1->type->refCount++;
7019 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7021 float value2 = op2->f;
7024 exp->string = PrintFloat(op1->f += value2);
7027 exp->expType = op1->type;
7029 op1->type->refCount++;
7034 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7036 double value2 = op2->d;
7039 exp->string = PrintDouble(op1->d += value2);
7042 exp->expType = op1->type;
7044 op1->type->refCount++;
7049 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7051 int value2 = op2->i;
7054 exp->string = PrintInt(op1->i -= value2);
7057 exp->expType = op1->type;
7059 op1->type->refCount++;
7064 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7066 unsigned int value2 = op2->ui;
7069 exp->string = PrintUInt(op1->ui -= value2);
7072 exp->expType = op1->type;
7074 op1->type->refCount++;
7079 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7081 int value2 = op2->i;
7084 exp->string = PrintInt64(op1->i -= value2);
7087 exp->expType = op1->type;
7089 op1->type->refCount++;
7094 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7096 unsigned int value2 = op2->ui;
7099 exp->string = PrintUInt64(op1->ui -= value2);
7102 exp->expType = op1->type;
7104 op1->type->refCount++;
7109 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7111 short value2 = op2->s;
7114 exp->string = PrintShort(op1->s -= value2);
7117 exp->expType = op1->type;
7119 op1->type->refCount++;
7124 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7126 unsigned short value2 = op2->us;
7129 exp->string = PrintUShort(op1->us -= value2);
7132 exp->expType = op1->type;
7134 op1->type->refCount++;
7139 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7141 char value2 = op2->c;
7144 exp->string = PrintChar(op1->c -= value2);
7147 exp->expType = op1->type;
7149 op1->type->refCount++;
7154 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7156 unsigned char value2 = op2->uc;
7159 exp->string = PrintUChar(op1->uc -= value2);
7162 exp->expType = op1->type;
7164 op1->type->refCount++;
7169 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7171 float value2 = op2->f;
7174 exp->string = PrintFloat(op1->f -= value2);
7177 exp->expType = op1->type;
7179 op1->type->refCount++;
7184 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7186 double value2 = op2->d;
7189 exp->string = PrintDouble(op1->d -= value2);
7192 exp->expType = op1->type;
7194 op1->type->refCount++;
7199 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7201 int value2 = op2->i;
7204 exp->string = PrintInt(op1->i *= value2);
7207 exp->expType = op1->type;
7209 op1->type->refCount++;
7214 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7216 unsigned int value2 = op2->ui;
7219 exp->string = PrintUInt(op1->ui *= value2);
7222 exp->expType = op1->type;
7224 op1->type->refCount++;
7229 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7231 int value2 = op2->i;
7234 exp->string = PrintInt64(op1->i *= value2);
7237 exp->expType = op1->type;
7239 op1->type->refCount++;
7244 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7246 unsigned int value2 = op2->ui;
7249 exp->string = PrintUInt64(op1->ui *= value2);
7252 exp->expType = op1->type;
7254 op1->type->refCount++;
7259 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7261 short value2 = op2->s;
7264 exp->string = PrintShort(op1->s *= value2);
7267 exp->expType = op1->type;
7269 op1->type->refCount++;
7274 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7276 unsigned short value2 = op2->us;
7279 exp->string = PrintUShort(op1->us *= value2);
7282 exp->expType = op1->type;
7284 op1->type->refCount++;
7289 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7291 char value2 = op2->c;
7294 exp->string = PrintChar(op1->c *= value2);
7297 exp->expType = op1->type;
7299 op1->type->refCount++;
7304 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7306 unsigned char value2 = op2->uc;
7309 exp->string = PrintUChar(op1->uc *= value2);
7312 exp->expType = op1->type;
7314 op1->type->refCount++;
7319 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7321 float value2 = op2->f;
7324 exp->string = PrintFloat(op1->f *= value2);
7327 exp->expType = op1->type;
7329 op1->type->refCount++;
7334 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7336 double value2 = op2->d;
7339 exp->string = PrintDouble(op1->d *= value2);
7342 exp->expType = op1->type;
7344 op1->type->refCount++;
7349 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7351 int value2 = op2->i;
7354 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7357 exp->expType = op1->type;
7359 op1->type->refCount++;
7364 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7366 unsigned int value2 = op2->ui;
7369 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7372 exp->expType = op1->type;
7374 op1->type->refCount++;
7379 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7381 int value2 = op2->i;
7384 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7387 exp->expType = op1->type;
7389 op1->type->refCount++;
7394 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7396 unsigned int value2 = op2->ui;
7399 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7402 exp->expType = op1->type;
7404 op1->type->refCount++;
7409 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7411 short value2 = op2->s;
7414 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7417 exp->expType = op1->type;
7419 op1->type->refCount++;
7424 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7426 unsigned short value2 = op2->us;
7429 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7432 exp->expType = op1->type;
7434 op1->type->refCount++;
7439 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7441 char value2 = op2->c;
7444 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7447 exp->expType = op1->type;
7449 op1->type->refCount++;
7454 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7456 unsigned char value2 = op2->uc;
7459 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7462 exp->expType = op1->type;
7464 op1->type->refCount++;
7469 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7471 float value2 = op2->f;
7474 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7477 exp->expType = op1->type;
7479 op1->type->refCount++;
7484 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7486 double value2 = op2->d;
7489 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7492 exp->expType = op1->type;
7494 op1->type->refCount++;
7499 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7501 int value2 = op2->i;
7504 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7507 exp->expType = op1->type;
7509 op1->type->refCount++;
7514 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7516 unsigned int value2 = op2->ui;
7519 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7522 exp->expType = op1->type;
7524 op1->type->refCount++;
7529 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7531 int value2 = op2->i;
7534 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7537 exp->expType = op1->type;
7539 op1->type->refCount++;
7544 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7546 unsigned int value2 = op2->ui;
7549 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7552 exp->expType = op1->type;
7554 op1->type->refCount++;
7559 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7561 short value2 = op2->s;
7564 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7567 exp->expType = op1->type;
7569 op1->type->refCount++;
7574 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7576 unsigned short value2 = op2->us;
7579 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7582 exp->expType = op1->type;
7584 op1->type->refCount++;
7589 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7591 char value2 = op2->c;
7594 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7597 exp->expType = op1->type;
7599 op1->type->refCount++;
7604 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7606 unsigned char value2 = op2->uc;
7609 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7612 exp->expType = op1->type;
7614 op1->type->refCount++;
7619 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7621 int value2 = op2->i;
7624 exp->string = PrintInt(op1->i & value2);
7627 exp->expType = op1->type;
7629 op1->type->refCount++;
7634 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7636 unsigned int value2 = op2->ui;
7639 exp->string = PrintUInt(op1->ui & value2);
7642 exp->expType = op1->type;
7644 op1->type->refCount++;
7649 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7651 int value2 = op2->i;
7654 exp->string = PrintInt64(op1->i & value2);
7657 exp->expType = op1->type;
7659 op1->type->refCount++;
7664 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7666 unsigned int value2 = op2->ui;
7669 exp->string = PrintUInt64(op1->ui & value2);
7672 exp->expType = op1->type;
7674 op1->type->refCount++;
7679 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7681 short value2 = op2->s;
7684 exp->string = PrintShort(op1->s & value2);
7687 exp->expType = op1->type;
7689 op1->type->refCount++;
7694 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7696 unsigned short value2 = op2->us;
7699 exp->string = PrintUShort(op1->us & value2);
7702 exp->expType = op1->type;
7704 op1->type->refCount++;
7709 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7711 char value2 = op2->c;
7714 exp->string = PrintChar(op1->c & value2);
7717 exp->expType = op1->type;
7719 op1->type->refCount++;
7724 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7726 unsigned char value2 = op2->uc;
7729 exp->string = PrintUChar(op1->uc & value2);
7732 exp->expType = op1->type;
7734 op1->type->refCount++;
7739 static unsigned int IntBitOr(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 UIntBitOr(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 Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 int value2 = op2->i;
7774 exp->string = PrintInt64(op1->i | value2);
7777 exp->expType = op1->type;
7779 op1->type->refCount++;
7784 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 unsigned int value2 = op2->ui;
7789 exp->string = PrintUInt64(op1->ui | value2);
7792 exp->expType = op1->type;
7794 op1->type->refCount++;
7799 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 short value2 = op2->s;
7804 exp->string = PrintShort(op1->s | value2);
7807 exp->expType = op1->type;
7809 op1->type->refCount++;
7814 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 unsigned short value2 = op2->us;
7819 exp->string = PrintUShort(op1->us | value2);
7822 exp->expType = op1->type;
7824 op1->type->refCount++;
7829 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 char value2 = op2->c;
7834 exp->string = PrintChar(op1->c | value2);
7837 exp->expType = op1->type;
7839 op1->type->refCount++;
7844 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 unsigned char value2 = op2->uc;
7849 exp->string = PrintUChar(op1->uc | value2);
7852 exp->expType = op1->type;
7854 op1->type->refCount++;
7859 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 int value2 = op2->i;
7864 exp->string = PrintInt(op1->i ^ value2);
7867 exp->expType = op1->type;
7869 op1->type->refCount++;
7874 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7876 unsigned int value2 = op2->ui;
7879 exp->string = PrintUInt(op1->ui ^ value2);
7882 exp->expType = op1->type;
7884 op1->type->refCount++;
7889 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7891 int value2 = op2->i;
7894 exp->string = PrintInt64(op1->i ^ value2);
7897 exp->expType = op1->type;
7899 op1->type->refCount++;
7904 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7906 unsigned int value2 = op2->ui;
7909 exp->string = PrintUInt64(op1->ui ^ value2);
7912 exp->expType = op1->type;
7914 op1->type->refCount++;
7919 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7921 short value2 = op2->s;
7924 exp->string = PrintShort(op1->s ^ value2);
7927 exp->expType = op1->type;
7929 op1->type->refCount++;
7934 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7936 unsigned short value2 = op2->us;
7939 exp->string = PrintUShort(op1->us ^ value2);
7942 exp->expType = op1->type;
7944 op1->type->refCount++;
7949 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7951 char value2 = op2->c;
7954 exp->string = PrintChar(op1->c ^ value2);
7957 exp->expType = op1->type;
7959 op1->type->refCount++;
7964 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7966 unsigned char value2 = op2->uc;
7969 exp->string = PrintUChar(op1->uc ^ value2);
7972 exp->expType = op1->type;
7974 op1->type->refCount++;
7979 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7981 int value2 = op2->i;
7984 exp->string = PrintInt(op1->i << value2);
7987 exp->expType = op1->type;
7989 op1->type->refCount++;
7994 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7996 unsigned int value2 = op2->ui;
7999 exp->string = PrintUInt(op1->ui << value2);
8002 exp->expType = op1->type;
8004 op1->type->refCount++;
8009 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8011 int value2 = op2->i;
8014 exp->string = PrintInt64(op1->i << value2);
8017 exp->expType = op1->type;
8019 op1->type->refCount++;
8024 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8026 unsigned int value2 = op2->ui;
8029 exp->string = PrintUInt64(op1->ui << value2);
8032 exp->expType = op1->type;
8034 op1->type->refCount++;
8039 static unsigned int ShortLShift(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 UShortLShift(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 CharLShift(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 UCharLShift(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 IntRShift(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 UIntRShift(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 Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8131 int value2 = op2->i;
8134 exp->string = PrintInt64(op1->i >> value2);
8137 exp->expType = op1->type;
8139 op1->type->refCount++;
8144 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8146 unsigned int value2 = op2->ui;
8149 exp->string = PrintUInt64(op1->ui >> value2);
8152 exp->expType = op1->type;
8154 op1->type->refCount++;
8159 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8161 short value2 = op2->s;
8164 exp->string = PrintShort(op1->s >> value2);
8167 exp->expType = op1->type;
8169 op1->type->refCount++;
8174 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8176 unsigned short value2 = op2->us;
8179 exp->string = PrintUShort(op1->us >> value2);
8182 exp->expType = op1->type;
8184 op1->type->refCount++;
8189 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8191 char value2 = op2->c;
8194 exp->string = PrintChar(op1->c >> value2);
8197 exp->expType = op1->type;
8199 op1->type->refCount++;
8204 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8206 unsigned char value2 = op2->uc;
8209 exp->string = PrintUChar(op1->uc >> value2);
8212 exp->expType = op1->type;
8214 op1->type->refCount++;
8219 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8222 exp->string = PrintInt((~op1->i));
8225 exp->expType = op1->type;
8227 op1->type->refCount++;
8232 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8235 exp->string = PrintUInt((unsigned int)(~op1->ui));
8238 exp->expType = op1->type;
8240 op1->type->refCount++;
8245 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8248 exp->string = PrintInt64((~op1->i));
8251 exp->expType = op1->type;
8253 op1->type->refCount++;
8258 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8261 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8264 exp->expType = op1->type;
8266 op1->type->refCount++;
8271 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8274 exp->string = PrintShort((short)(~op1->s));
8277 exp->expType = op1->type;
8279 op1->type->refCount++;
8284 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8287 exp->string = PrintUShort((unsigned short)(~op1->us));
8290 exp->expType = op1->type;
8292 op1->type->refCount++;
8297 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8300 exp->string = PrintChar((char)(~op1->c));
8303 exp->expType = op1->type;
8305 op1->type->refCount++;
8310 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8313 exp->string = PrintUChar((unsigned char)(~op1->uc));
8316 exp->expType = op1->type;
8318 op1->type->refCount++;
8323 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 int value2 = op2->i;
8328 exp->string = PrintInt(op1->i &= value2);
8331 exp->expType = op1->type;
8333 op1->type->refCount++;
8338 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 unsigned int value2 = op2->ui;
8343 exp->string = PrintUInt(op1->ui &= value2);
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 int value2 = op2->i;
8358 exp->string = PrintInt64(op1->i &= value2);
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 unsigned int value2 = op2->ui;
8373 exp->string = PrintUInt64(op1->ui &= value2);
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 short value2 = op2->s;
8388 exp->string = PrintShort(op1->s &= value2);
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 unsigned short value2 = op2->us;
8403 exp->string = PrintUShort(op1->us &= value2);
8406 exp->expType = op1->type;
8408 op1->type->refCount++;
8413 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 char value2 = op2->c;
8418 exp->string = PrintChar(op1->c &= value2);
8421 exp->expType = op1->type;
8423 op1->type->refCount++;
8428 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 unsigned char value2 = op2->uc;
8433 exp->string = PrintUChar(op1->uc &= value2);
8436 exp->expType = op1->type;
8438 op1->type->refCount++;
8443 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 int value2 = op2->i;
8448 exp->string = PrintInt(op1->i |= value2);
8451 exp->expType = op1->type;
8453 op1->type->refCount++;
8458 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 unsigned int value2 = op2->ui;
8463 exp->string = PrintUInt(op1->ui |= value2);
8466 exp->expType = op1->type;
8468 op1->type->refCount++;
8473 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 int value2 = op2->i;
8478 exp->string = PrintInt64(op1->i |= value2);
8481 exp->expType = op1->type;
8483 op1->type->refCount++;
8488 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 unsigned int value2 = op2->ui;
8493 exp->string = PrintUInt64(op1->ui |= value2);
8496 exp->expType = op1->type;
8498 op1->type->refCount++;
8503 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 short value2 = op2->s;
8508 exp->string = PrintShort(op1->s |= value2);
8511 exp->expType = op1->type;
8513 op1->type->refCount++;
8518 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 unsigned short value2 = op2->us;
8523 exp->string = PrintUShort(op1->us |= value2);
8526 exp->expType = op1->type;
8528 op1->type->refCount++;
8533 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 char value2 = op2->c;
8538 exp->string = PrintChar(op1->c |= value2);
8541 exp->expType = op1->type;
8543 op1->type->refCount++;
8548 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 unsigned char value2 = op2->uc;
8553 exp->string = PrintUChar(op1->uc |= value2);
8556 exp->expType = op1->type;
8558 op1->type->refCount++;
8563 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 int value2 = op2->i;
8568 exp->string = PrintInt(op1->i ^= value2);
8571 exp->expType = op1->type;
8573 op1->type->refCount++;
8578 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 unsigned int value2 = op2->ui;
8583 exp->string = PrintUInt(op1->ui ^= value2);
8586 exp->expType = op1->type;
8588 op1->type->refCount++;
8593 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 int value2 = op2->i;
8598 exp->string = PrintInt64(op1->i ^= value2);
8601 exp->expType = op1->type;
8603 op1->type->refCount++;
8608 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 unsigned int value2 = op2->ui;
8613 exp->string = PrintUInt64(op1->ui ^= value2);
8616 exp->expType = op1->type;
8618 op1->type->refCount++;
8623 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 short value2 = op2->s;
8628 exp->string = PrintShort(op1->s ^= value2);
8631 exp->expType = op1->type;
8633 op1->type->refCount++;
8638 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 unsigned short value2 = op2->us;
8643 exp->string = PrintUShort(op1->us ^= value2);
8646 exp->expType = op1->type;
8648 op1->type->refCount++;
8653 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 char value2 = op2->c;
8658 exp->string = PrintChar(op1->c ^= value2);
8661 exp->expType = op1->type;
8663 op1->type->refCount++;
8668 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 unsigned char value2 = op2->uc;
8673 exp->string = PrintUChar(op1->uc ^= value2);
8676 exp->expType = op1->type;
8678 op1->type->refCount++;
8683 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 int value2 = op2->i;
8688 exp->string = PrintInt(op1->i <<= value2);
8691 exp->expType = op1->type;
8693 op1->type->refCount++;
8698 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 unsigned int value2 = op2->ui;
8703 exp->string = PrintUInt(op1->ui <<= value2);
8706 exp->expType = op1->type;
8708 op1->type->refCount++;
8713 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 int value2 = op2->i;
8718 exp->string = PrintInt64(op1->i <<= value2);
8721 exp->expType = op1->type;
8723 op1->type->refCount++;
8728 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 unsigned int value2 = op2->ui;
8733 exp->string = PrintUInt64(op1->ui <<= value2);
8736 exp->expType = op1->type;
8738 op1->type->refCount++;
8743 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 short value2 = op2->s;
8748 exp->string = PrintShort(op1->s <<= value2);
8751 exp->expType = op1->type;
8753 op1->type->refCount++;
8758 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 unsigned short value2 = op2->us;
8763 exp->string = PrintUShort(op1->us <<= value2);
8766 exp->expType = op1->type;
8768 op1->type->refCount++;
8773 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 char value2 = op2->c;
8778 exp->string = PrintChar(op1->c <<= value2);
8781 exp->expType = op1->type;
8783 op1->type->refCount++;
8788 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 unsigned char value2 = op2->uc;
8793 exp->string = PrintUChar(op1->uc <<= value2);
8796 exp->expType = op1->type;
8798 op1->type->refCount++;
8803 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 int value2 = op2->i;
8808 exp->string = PrintInt(op1->i >>= value2);
8811 exp->expType = op1->type;
8813 op1->type->refCount++;
8818 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 unsigned int value2 = op2->ui;
8823 exp->string = PrintUInt(op1->ui >>= value2);
8826 exp->expType = op1->type;
8828 op1->type->refCount++;
8833 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 int value2 = op2->i;
8838 exp->string = PrintInt64(op1->i >>= value2);
8841 exp->expType = op1->type;
8843 op1->type->refCount++;
8848 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 unsigned int value2 = op2->ui;
8853 exp->string = PrintUInt64(op1->ui >>= value2);
8856 exp->expType = op1->type;
8858 op1->type->refCount++;
8863 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 short value2 = op2->s;
8868 exp->string = PrintShort(op1->s >>= value2);
8871 exp->expType = op1->type;
8873 op1->type->refCount++;
8878 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 unsigned short value2 = op2->us;
8883 exp->string = PrintUShort(op1->us >>= value2);
8886 exp->expType = op1->type;
8888 op1->type->refCount++;
8893 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 char value2 = op2->c;
8898 exp->string = PrintChar(op1->c >>= value2);
8901 exp->expType = op1->type;
8903 op1->type->refCount++;
8908 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 unsigned char value2 = op2->uc;
8913 exp->string = PrintUChar(op1->uc >>= value2);
8916 exp->expType = op1->type;
8918 op1->type->refCount++;
8923 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8926 exp->string = PrintInt((int)(!op1->i));
8929 exp->expType = op1->type;
8931 op1->type->refCount++;
8936 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8939 exp->string = PrintUInt((unsigned int)(!op1->ui));
8942 exp->expType = op1->type;
8944 op1->type->refCount++;
8949 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8952 exp->string = PrintInt64((int)(!op1->i));
8955 exp->expType = op1->type;
8957 op1->type->refCount++;
8962 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8965 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8968 exp->expType = op1->type;
8970 op1->type->refCount++;
8975 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8978 exp->string = PrintShort((short)(!op1->s));
8981 exp->expType = op1->type;
8983 op1->type->refCount++;
8988 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8991 exp->string = PrintUShort((unsigned short)(!op1->us));
8994 exp->expType = op1->type;
8996 op1->type->refCount++;
9001 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9004 exp->string = PrintChar((char)(!op1->c));
9007 exp->expType = op1->type;
9009 op1->type->refCount++;
9014 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9017 exp->string = PrintUChar((unsigned char)(!op1->uc));
9020 exp->expType = op1->type;
9022 op1->type->refCount++;
9027 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 int value2 = op2->i;
9032 exp->string = PrintInt(op1->i == value2);
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 unsigned int value2 = op2->ui;
9047 exp->string = PrintUInt(op1->ui == value2);
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 int value2 = op2->i;
9062 exp->string = PrintInt64(op1->i == value2);
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9074 unsigned int value2 = op2->ui;
9077 exp->string = PrintUInt64(op1->ui == value2);
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9089 short value2 = op2->s;
9092 exp->string = PrintShort(op1->s == value2);
9095 exp->expType = op1->type;
9097 op1->type->refCount++;
9102 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9104 unsigned short value2 = op2->us;
9107 exp->string = PrintUShort(op1->us == value2);
9110 exp->expType = op1->type;
9112 op1->type->refCount++;
9117 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9119 char value2 = op2->c;
9122 exp->string = PrintChar(op1->c == value2);
9125 exp->expType = op1->type;
9127 op1->type->refCount++;
9132 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9134 unsigned char value2 = op2->uc;
9137 exp->string = PrintUChar(op1->uc == value2);
9140 exp->expType = op1->type;
9142 op1->type->refCount++;
9147 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9149 float value2 = op2->f;
9152 exp->string = PrintFloat(op1->f == value2);
9155 exp->expType = op1->type;
9157 op1->type->refCount++;
9162 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9164 double value2 = op2->d;
9167 exp->string = PrintDouble(op1->d == value2);
9170 exp->expType = op1->type;
9172 op1->type->refCount++;
9177 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9179 int value2 = op2->i;
9182 exp->string = PrintInt(op1->i != value2);
9185 exp->expType = op1->type;
9187 op1->type->refCount++;
9192 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9194 unsigned int value2 = op2->ui;
9197 exp->string = PrintUInt(op1->ui != value2);
9200 exp->expType = op1->type;
9202 op1->type->refCount++;
9207 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9209 int value2 = op2->i;
9212 exp->string = PrintInt64(op1->i != value2);
9215 exp->expType = op1->type;
9217 op1->type->refCount++;
9222 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9224 unsigned int value2 = op2->ui;
9227 exp->string = PrintUInt64(op1->ui != value2);
9230 exp->expType = op1->type;
9232 op1->type->refCount++;
9237 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9239 short value2 = op2->s;
9242 exp->string = PrintShort(op1->s != value2);
9245 exp->expType = op1->type;
9247 op1->type->refCount++;
9252 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9254 unsigned short value2 = op2->us;
9257 exp->string = PrintUShort(op1->us != value2);
9260 exp->expType = op1->type;
9262 op1->type->refCount++;
9267 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9269 char value2 = op2->c;
9272 exp->string = PrintChar(op1->c != value2);
9275 exp->expType = op1->type;
9277 op1->type->refCount++;
9282 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9284 unsigned char value2 = op2->uc;
9287 exp->string = PrintUChar(op1->uc != value2);
9290 exp->expType = op1->type;
9292 op1->type->refCount++;
9297 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9299 float value2 = op2->f;
9302 exp->string = PrintFloat(op1->f != value2);
9305 exp->expType = op1->type;
9307 op1->type->refCount++;
9312 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9314 double value2 = op2->d;
9317 exp->string = PrintDouble(op1->d != value2);
9320 exp->expType = op1->type;
9322 op1->type->refCount++;
9327 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9329 int value2 = op2->i;
9332 exp->string = PrintInt(op1->i && value2);
9335 exp->expType = op1->type;
9337 op1->type->refCount++;
9342 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9344 unsigned int value2 = op2->ui;
9347 exp->string = PrintUInt(op1->ui && value2);
9350 exp->expType = op1->type;
9352 op1->type->refCount++;
9357 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9359 int value2 = op2->i;
9362 exp->string = PrintInt64(op1->i && value2);
9365 exp->expType = op1->type;
9367 op1->type->refCount++;
9372 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9374 unsigned int value2 = op2->ui;
9377 exp->string = PrintUInt64(op1->ui && value2);
9380 exp->expType = op1->type;
9382 op1->type->refCount++;
9387 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9389 short value2 = op2->s;
9392 exp->string = PrintShort(op1->s && value2);
9395 exp->expType = op1->type;
9397 op1->type->refCount++;
9402 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9404 unsigned short value2 = op2->us;
9407 exp->string = PrintUShort(op1->us && value2);
9410 exp->expType = op1->type;
9412 op1->type->refCount++;
9417 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9419 char value2 = op2->c;
9422 exp->string = PrintChar(op1->c && value2);
9425 exp->expType = op1->type;
9427 op1->type->refCount++;
9432 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9434 unsigned char value2 = op2->uc;
9437 exp->string = PrintUChar(op1->uc && value2);
9440 exp->expType = op1->type;
9442 op1->type->refCount++;
9447 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9449 float value2 = op2->f;
9452 exp->string = PrintFloat(op1->f && value2);
9455 exp->expType = op1->type;
9457 op1->type->refCount++;
9462 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9464 double value2 = op2->d;
9467 exp->string = PrintDouble(op1->d && value2);
9470 exp->expType = op1->type;
9472 op1->type->refCount++;
9477 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9479 int value2 = op2->i;
9482 exp->string = PrintInt(op1->i || value2);
9485 exp->expType = op1->type;
9487 op1->type->refCount++;
9492 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9494 unsigned int value2 = op2->ui;
9497 exp->string = PrintUInt(op1->ui || value2);
9500 exp->expType = op1->type;
9502 op1->type->refCount++;
9507 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9509 int value2 = op2->i;
9512 exp->string = PrintInt64(op1->i || value2);
9515 exp->expType = op1->type;
9517 op1->type->refCount++;
9522 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9524 unsigned int value2 = op2->ui;
9527 exp->string = PrintUInt64(op1->ui || value2);
9530 exp->expType = op1->type;
9532 op1->type->refCount++;
9537 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9539 short value2 = op2->s;
9542 exp->string = PrintShort(op1->s || value2);
9545 exp->expType = op1->type;
9547 op1->type->refCount++;
9552 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9554 unsigned short value2 = op2->us;
9557 exp->string = PrintUShort(op1->us || value2);
9560 exp->expType = op1->type;
9562 op1->type->refCount++;
9567 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9569 char value2 = op2->c;
9572 exp->string = PrintChar(op1->c || value2);
9575 exp->expType = op1->type;
9577 op1->type->refCount++;
9582 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9584 unsigned char value2 = op2->uc;
9587 exp->string = PrintUChar(op1->uc || value2);
9590 exp->expType = op1->type;
9592 op1->type->refCount++;
9597 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9599 float value2 = op2->f;
9602 exp->string = PrintFloat(op1->f || value2);
9605 exp->expType = op1->type;
9607 op1->type->refCount++;
9612 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9614 double value2 = op2->d;
9617 exp->string = PrintDouble(op1->d || value2);
9620 exp->expType = op1->type;
9622 op1->type->refCount++;
9627 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9629 int value2 = op2->i;
9632 exp->string = PrintInt(op1->i > value2);
9635 exp->expType = op1->type;
9637 op1->type->refCount++;
9642 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9644 unsigned int value2 = op2->ui;
9647 exp->string = PrintUInt(op1->ui > value2);
9650 exp->expType = op1->type;
9652 op1->type->refCount++;
9657 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9659 int value2 = op2->i;
9662 exp->string = PrintInt64(op1->i > value2);
9665 exp->expType = op1->type;
9667 op1->type->refCount++;
9672 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9674 unsigned int value2 = op2->ui;
9677 exp->string = PrintUInt64(op1->ui > value2);
9680 exp->expType = op1->type;
9682 op1->type->refCount++;
9687 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9689 short value2 = op2->s;
9692 exp->string = PrintShort(op1->s > value2);
9695 exp->expType = op1->type;
9697 op1->type->refCount++;
9702 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9704 unsigned short value2 = op2->us;
9707 exp->string = PrintUShort(op1->us > value2);
9710 exp->expType = op1->type;
9712 op1->type->refCount++;
9717 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9719 char value2 = op2->c;
9722 exp->string = PrintChar(op1->c > value2);
9725 exp->expType = op1->type;
9727 op1->type->refCount++;
9732 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9734 unsigned char value2 = op2->uc;
9737 exp->string = PrintUChar(op1->uc > value2);
9740 exp->expType = op1->type;
9742 op1->type->refCount++;
9747 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9749 float value2 = op2->f;
9752 exp->string = PrintFloat(op1->f > value2);
9755 exp->expType = op1->type;
9757 op1->type->refCount++;
9762 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9764 double value2 = op2->d;
9767 exp->string = PrintDouble(op1->d > value2);
9770 exp->expType = op1->type;
9772 op1->type->refCount++;
9777 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9779 int value2 = op2->i;
9782 exp->string = PrintInt(op1->i < value2);
9785 exp->expType = op1->type;
9787 op1->type->refCount++;
9792 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9794 unsigned int value2 = op2->ui;
9797 exp->string = PrintUInt(op1->ui < value2);
9800 exp->expType = op1->type;
9802 op1->type->refCount++;
9807 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9809 int value2 = op2->i;
9812 exp->string = PrintInt64(op1->i < value2);
9815 exp->expType = op1->type;
9817 op1->type->refCount++;
9822 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9824 unsigned int value2 = op2->ui;
9827 exp->string = PrintUInt64(op1->ui < value2);
9830 exp->expType = op1->type;
9832 op1->type->refCount++;
9837 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9839 short value2 = op2->s;
9842 exp->string = PrintShort(op1->s < value2);
9845 exp->expType = op1->type;
9847 op1->type->refCount++;
9852 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9854 unsigned short value2 = op2->us;
9857 exp->string = PrintUShort(op1->us < value2);
9860 exp->expType = op1->type;
9862 op1->type->refCount++;
9867 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9869 char value2 = op2->c;
9872 exp->string = PrintChar(op1->c < value2);
9875 exp->expType = op1->type;
9877 op1->type->refCount++;
9882 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9884 unsigned char value2 = op2->uc;
9887 exp->string = PrintUChar(op1->uc < value2);
9890 exp->expType = op1->type;
9892 op1->type->refCount++;
9897 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9899 float value2 = op2->f;
9902 exp->string = PrintFloat(op1->f < value2);
9905 exp->expType = op1->type;
9907 op1->type->refCount++;
9912 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9914 double value2 = op2->d;
9917 exp->string = PrintDouble(op1->d < value2);
9920 exp->expType = op1->type;
9922 op1->type->refCount++;
9927 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9929 int value2 = op2->i;
9932 exp->string = PrintInt(op1->i >= value2);
9935 exp->expType = op1->type;
9937 op1->type->refCount++;
9942 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9944 unsigned int value2 = op2->ui;
9947 exp->string = PrintUInt(op1->ui >= value2);
9950 exp->expType = op1->type;
9952 op1->type->refCount++;
9957 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9959 int value2 = op2->i;
9962 exp->string = PrintInt64(op1->i >= value2);
9965 exp->expType = op1->type;
9967 op1->type->refCount++;
9972 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9974 unsigned int value2 = op2->ui;
9977 exp->string = PrintUInt64(op1->ui >= value2);
9980 exp->expType = op1->type;
9982 op1->type->refCount++;
9987 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9989 short value2 = op2->s;
9992 exp->string = PrintShort(op1->s >= value2);
9995 exp->expType = op1->type;
9997 op1->type->refCount++;
10002 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10004 unsigned short value2 = op2->us;
10007 exp->string = PrintUShort(op1->us >= value2);
10010 exp->expType = op1->type;
10012 op1->type->refCount++;
10017 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10019 char value2 = op2->c;
10022 exp->string = PrintChar(op1->c >= value2);
10025 exp->expType = op1->type;
10027 op1->type->refCount++;
10032 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10034 unsigned char value2 = op2->uc;
10037 exp->string = PrintUChar(op1->uc >= value2);
10040 exp->expType = op1->type;
10042 op1->type->refCount++;
10047 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10049 float value2 = op2->f;
10052 exp->string = PrintFloat(op1->f >= value2);
10055 exp->expType = op1->type;
10057 op1->type->refCount++;
10062 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10064 double value2 = op2->d;
10067 exp->string = PrintDouble(op1->d >= value2);
10070 exp->expType = op1->type;
10072 op1->type->refCount++;
10077 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10079 int value2 = op2->i;
10082 exp->string = PrintInt(op1->i <= value2);
10085 exp->expType = op1->type;
10087 op1->type->refCount++;
10092 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10094 unsigned int value2 = op2->ui;
10097 exp->string = PrintUInt(op1->ui <= value2);
10100 exp->expType = op1->type;
10102 op1->type->refCount++;
10107 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10109 int value2 = op2->i;
10112 exp->string = PrintInt64(op1->i <= value2);
10115 exp->expType = op1->type;
10117 op1->type->refCount++;
10122 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10124 unsigned int value2 = op2->ui;
10127 exp->string = PrintUInt64(op1->ui <= value2);
10130 exp->expType = op1->type;
10132 op1->type->refCount++;
10137 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10139 short value2 = op2->s;
10142 exp->string = PrintShort(op1->s <= value2);
10145 exp->expType = op1->type;
10147 op1->type->refCount++;
10152 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10154 unsigned short value2 = op2->us;
10157 exp->string = PrintUShort(op1->us <= value2);
10160 exp->expType = op1->type;
10162 op1->type->refCount++;
10167 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10169 char value2 = op2->c;
10172 exp->string = PrintChar(op1->c <= value2);
10175 exp->expType = op1->type;
10177 op1->type->refCount++;
10182 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10184 unsigned char value2 = op2->uc;
10187 exp->string = PrintUChar(op1->uc <= value2);
10190 exp->expType = op1->type;
10192 op1->type->refCount++;
10197 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10199 float value2 = op2->f;
10202 exp->string = PrintFloat(op1->f <= value2);
10205 exp->expType = op1->type;
10207 op1->type->refCount++;
10212 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10214 double value2 = op2->d;
10217 exp->string = PrintDouble(op1->d <= value2);
10220 exp->expType = op1->type;
10222 op1->type->refCount++;
10227 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10230 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10233 exp->expType = op1->type;
10235 op1->type->refCount++;
10240 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10243 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10246 exp->expType = op1->type;
10248 op1->type->refCount++;
10253 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10256 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10259 exp->expType = op1->type;
10261 op1->type->refCount++;
10266 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10269 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10272 exp->expType = op1->type;
10274 op1->type->refCount++;
10279 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10282 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10285 exp->expType = op1->type;
10287 op1->type->refCount++;
10292 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10295 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10298 exp->expType = op1->type;
10300 op1->type->refCount++;
10305 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10308 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10311 exp->expType = op1->type;
10313 op1->type->refCount++;
10318 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10321 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10324 exp->expType = op1->type;
10326 op1->type->refCount++;
10331 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10334 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10337 exp->expType = op1->type;
10339 op1->type->refCount++;
10344 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10347 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10350 exp->expType = op1->type;
10352 op1->type->refCount++;
10357 struct OpTable intOps =
10359 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
10362 struct OpTable uintOps =
10364 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
10367 struct OpTable int64Ops =
10369 Int64Add, Int64Sub, Int64Mul, Int64Div, Int64Mod, Int64Neg, Int64Inc, Int64Dec, Int64Asign, Int64AddAsign, Int64SubAsign, Int64MulAsign, Int64DivAsign, Int64ModAsign, Int64BitAnd, Int64BitOr, Int64BitXor, Int64LShift, Int64RShift, Int64BitNot, Int64AndAsign, Int64OrAsign, Int64XorAsign, Int64LShiftAsign, Int64RShiftAsign, Int64Not, Int64Equ, Int64Nqu, Int64And, Int64Or, Int64Grt, Int64Sma, Int64GrtEqu, Int64SmaEqu, Int64Cond
10372 struct OpTable uint64Ops =
10374 UInt64Add, UInt64Sub, UInt64Mul, UInt64Div, UInt64Mod, UInt64Neg, UInt64Inc, UInt64Dec, UInt64Asign, UInt64AddAsign, UInt64SubAsign, UInt64MulAsign, UInt64DivAsign, UInt64ModAsign, UInt64BitAnd, UInt64BitOr, UInt64BitXor, UInt64LShift, UInt64RShift, UInt64BitNot, UInt64AndAsign, UInt64OrAsign, UInt64XorAsign, UInt64LShiftAsign, UInt64RShiftAsign, UInt64Not, UInt64Equ, UInt64Nqu, UInt64And, UInt64Or, UInt64Grt, UInt64Sma, UInt64GrtEqu, UInt64SmaEqu, UInt64Cond
10377 struct OpTable shortOps =
10379 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
10382 struct OpTable ushortOps =
10384 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
10387 struct OpTable floatOps =
10389 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
10392 struct OpTable doubleOps =
10394 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
10397 struct OpTable charOps =
10399 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
10402 struct OpTable ucharOps =
10404 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
10407 void ReadString(char * output, char * string)
10409 int len = strlen(string);
10411 unsigned int quoted = 0x0, escaped = 0x0;
10413 for(c = 0; c < len; c++)
10415 char ch = string[c];
10449 output[d++] = '\\';
10471 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10473 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10475 extern double strtod(char * , char * * );
10477 struct Operand GetOperand(struct Expression * exp)
10479 struct Operand op =
10483 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
10486 struct Type * type = exp->expType;
10490 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10492 if(!type->_class->registered->dataType)
10493 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10494 type = type->_class->registered->dataType;
10496 op.kind = type->kind;
10497 op.type = exp->expType;
10498 if(exp->isConstant && exp->type == 2)
10505 if(exp->constant[0] == '\'')
10506 op.c = exp->constant[1];
10507 else if(type->isSigned)
10509 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10514 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10522 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10527 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10528 op.ops = ushortOps;
10535 op.i = strtol(exp->constant, (((void *)0)), 0);
10540 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10548 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10553 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10561 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10566 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10567 op.ops = uint64Ops;
10574 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10579 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10580 op.ops = uint64Ops;
10585 op.f = (float)strtod(exp->constant, (((void *)0)));
10589 op.d = (double)strtod(exp->constant, (((void *)0)));
10590 op.ops = doubleOps;
10595 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10605 int __ecereVMethodID_class_OnGetString;
10607 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10609 static void UnusedFunction()
10613 ((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);
10616 extern int __ecereVMethodID_class_OnGetString;
10618 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10620 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10622 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10624 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10625 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10628 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10629 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10630 struct Type * type;
10631 void * ptr = inst->data + dataMember->offset + offset;
10632 char * result = (((void *)0));
10634 exp->loc = member->loc = inst->loc;
10635 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10636 if(!dataMember->dataType)
10637 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10638 type = dataMember->dataType;
10639 if(type->kind == 8)
10641 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10643 if(_class->type == 4)
10645 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10649 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10650 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10652 for(item = e->values.first; item; item = item->next)
10654 if((int)item->data == *(int *)ptr)
10656 result = item->name;
10662 exp->identifier = MkIdentifier(result);
10664 exp->destType = MkClassType(_class->fullName);
10665 ProcessExpressionType(exp);
10669 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10671 if(!_class->dataType)
10672 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10673 type = _class->dataType;
10682 FreeExpContents(exp);
10683 exp->constant = PrintFloat(*(float *)ptr);
10689 FreeExpContents(exp);
10690 exp->constant = PrintDouble(*(double *)ptr);
10696 FreeExpContents(exp);
10697 exp->constant = PrintInt(*(int *)ptr);
10703 FreeExpContents(exp);
10704 exp->constant = PrintInt64(*(long long *)ptr);
10710 FreeExpContents(exp);
10711 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10717 FreeExpContents(exp);
10718 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10723 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10726 ListAdd(memberList, member);
10728 if(parentDataMember->type == 1)
10733 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10735 void PopulateInstance(struct Instantiation * inst)
10737 struct Symbol * classSym = inst->_class->symbol;
10738 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10739 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10740 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10743 inst->members = MkListOne(MkMembersInitList(memberList));
10745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10746 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10748 if(!dataMember->isProperty)
10750 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10751 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10754 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10755 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10756 struct Type * type;
10757 void * ptr = inst->data + dataMember->offset;
10758 char * result = (((void *)0));
10760 exp->loc = member->loc = inst->loc;
10761 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10762 if(!dataMember->dataType)
10763 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10764 type = dataMember->dataType;
10765 if(type->kind == 8)
10767 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10769 if(_class->type == 4)
10771 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10775 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10776 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10778 for(item = e->values.first; item; item = item->next)
10780 if((int)item->data == *(int *)ptr)
10782 result = item->name;
10789 exp->identifier = MkIdentifier(result);
10791 exp->destType = MkClassType(_class->fullName);
10792 ProcessExpressionType(exp);
10795 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10797 if(!_class->dataType)
10798 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10799 type = _class->dataType;
10808 exp->constant = PrintFloat(*(float *)ptr);
10814 exp->constant = PrintDouble(*(double *)ptr);
10820 exp->constant = PrintInt(*(int *)ptr);
10826 exp->constant = PrintInt64(*(long long *)ptr);
10832 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10837 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10840 ListAdd(memberList, member);
10846 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);
10848 extern void FreeInstance(struct Instantiation * inst);
10850 void ComputeInstantiation(struct Expression * exp)
10852 struct Instantiation * inst = exp->instance;
10853 struct MembersInit * members;
10854 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10855 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10856 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10857 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10858 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10859 int subMemberStackPos = 0;
10862 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10866 if(_class->type == 0 || _class->type == 5)
10868 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10869 if(_class->type == 0)
10870 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10873 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10877 for(members = (*inst->members).first; members; members = members->next)
10879 switch(members->type)
10883 if(members->dataMembers)
10885 struct MemberInit * member;
10887 for(member = (*members->dataMembers).first; member; member = member->next)
10889 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10890 unsigned int found = 0x0;
10891 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10892 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10893 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10894 unsigned int dataMemberOffset;
10898 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10901 if(curMember->isProperty)
10902 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10905 dataMember = curMember;
10906 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10907 if(_class->type == 0)
10908 dataMemberOffset += _class->base->structSize;
10915 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10919 if(prop->memberAccess == 1)
10921 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10922 curClass = prop->_class;
10927 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10928 int _subMemberStackPos = 0;
10930 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10934 if(dataMember->memberAccess == 1)
10936 curMember = dataMember;
10937 curClass = dataMember->_class;
10938 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10939 subMemberStackPos = _subMemberStackPos;
10944 if(found && member->initializer && member->initializer->type == 0)
10946 struct Expression * value = member->initializer->exp;
10947 struct Type * type = (((void *)0));
10948 unsigned int deepMember = 0x0;
10952 type = prop->dataType;
10954 else if(dataMember)
10956 if(!dataMember->dataType)
10957 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10958 type = dataMember->dataType;
10960 if(ident && ident->next)
10963 for(ident = ident->next; ident && type; ident = ident->next)
10965 if(type->kind == 8)
10967 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10969 type = prop->dataType;
10972 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10974 type = dataMember->dataType;
10977 else if(type->kind == 9 || type->kind == 10)
10979 struct Type * memberType;
10981 for(memberType = type->members.first; memberType; memberType = memberType->next)
10983 if(!strcmp(memberType->name, ident->string))
10994 FreeType(value->destType);
10995 value->destType = type;
10998 ComputeExpression(value);
11000 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11002 if(type->kind == 8)
11004 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11006 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11008 if(!_class->dataType)
11009 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11010 type = _class->dataType;
11015 void * ptr = inst->data + dataMemberOffset;
11017 if(value->type == 2)
11023 GetInt(value, (int *)ptr);
11028 GetInt64(value, (long long *)ptr);
11033 GetIntPtr(value, (intptr_t *)ptr);
11038 GetIntSize(value, (ssize_t *)ptr);
11043 GetFloat(value, (float *)ptr);
11048 GetDouble(value, (double *)ptr);
11053 else if(value->type == 1)
11055 if(type->kind == 8)
11057 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11059 if(_class->type == 1)
11061 ComputeTypeSize(type);
11062 if(value->instance->data)
11063 memcpy(ptr, value->instance->data, type->size);
11070 if(value->type == 1 && value->instance->data)
11072 if(type->kind == 8)
11074 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11076 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)))
11078 void (* Set)(void *, void *) = (void *)prop->Set;
11080 Set(inst->data, value->instance->data);
11081 PopulateInstance(inst);
11085 else if(value->type == 2)
11091 void (* Set)(void *, double) = (void *)prop->Set;
11093 Set(inst->data, strtod(value->constant, (((void *)0))));
11098 void (* Set)(void *, float) = (void *)prop->Set;
11100 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11105 void (* Set)(void *, int) = (void *)prop->Set;
11107 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11112 void (* Set)(void *, long long) = (void *)prop->Set;
11114 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11119 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11121 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11126 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11128 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11133 else if(value->type == 3)
11137 ReadString(temp, value->string);
11138 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11142 else if(!deepMember && type && _class->type == 3)
11146 if(value->type == 2)
11148 if(type->kind == 8)
11150 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11152 if(_class->type == 3)
11154 if(!_class->dataType)
11155 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11156 type = _class->dataType;
11164 float (* Set)(float) = (void *)prop->Set;
11166 GetFloat(member->initializer->exp, &fValue);
11167 exp->constant = PrintFloat(Set(fValue));
11174 double (* Set)(double) = (void *)prop->Set;
11176 GetDouble(member->initializer->exp, &dValue);
11177 exp->constant = PrintDouble(Set(dValue));
11185 else if(!deepMember && type && _class->type == 2)
11189 if(value->type == 1 && value->instance->data)
11191 unsigned int (* Set)(void *) = (void *)prop->Set;
11193 bits = Set(value->instance->data);
11195 else if(value->type == 2)
11199 else if(dataMember)
11201 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11202 struct Type * type;
11205 GetInt(value, &part);
11206 bits = (bits & ~bitMember->mask);
11207 if(!bitMember->dataType)
11208 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11209 type = bitMember->dataType;
11210 if(type->kind == 8 && type->_class && type->_class->registered)
11212 if(!type->_class->registered->dataType)
11213 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11214 type = type->_class->registered->dataType;
11221 bits |= ((char)part << bitMember->pos);
11223 bits |= ((unsigned char)part << bitMember->pos);
11227 bits |= ((short)part << bitMember->pos);
11229 bits |= ((unsigned short)part << bitMember->pos);
11234 bits |= (part << bitMember->pos);
11236 bits |= ((unsigned int)part << bitMember->pos);
11240 bits |= ((long long)part << bitMember->pos);
11242 bits |= ((uint64)part << bitMember->pos);
11247 bits |= ((intptr_t)part << bitMember->pos);
11251 bits |= ((uintptr_t)part << bitMember->pos);
11257 bits |= ((ssize_t)part << bitMember->pos);
11261 bits |= ((size_t)part << bitMember->pos);
11270 if(_class && _class->type == 3)
11272 ComputeExpression(member->initializer->exp);
11273 exp->constant = member->initializer->exp->constant;
11275 member->initializer->exp->constant = (((void *)0));
11285 if(_class && _class->type == 2)
11287 exp->constant = PrintHexUInt(bits);
11292 FreeInstance(inst);
11296 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11298 if(exp->op.op == SIZEOF)
11300 FreeExpContents(exp);
11302 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11312 struct Expression * exp2 = exp->op.exp2;
11314 exp->op.exp2 = (((void *)0));
11315 FreeExpContents(exp);
11316 FreeType(exp->expType);
11317 FreeType(exp->destType);
11319 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11325 FreeExpContents(exp);
11326 op1->ops.Neg(exp, op1);
11330 if(op1->ops.BitNot)
11332 FreeExpContents(exp);
11333 op1->ops.BitNot(exp, op1);
11339 FreeExpContents(exp);
11340 op1->ops.Not(exp, op1);
11352 FreeExpContents(exp);
11353 op1->ops.Add(exp, op1, op2);
11359 FreeExpContents(exp);
11360 op1->ops.Sub(exp, op1, op2);
11366 FreeExpContents(exp);
11367 op1->ops.Mul(exp, op1, op2);
11373 FreeExpContents(exp);
11374 op1->ops.Div(exp, op1, op2);
11380 FreeExpContents(exp);
11381 op1->ops.Mod(exp, op1, op2);
11387 if(op1->ops.BitAnd)
11389 FreeExpContents(exp);
11390 op1->ops.BitAnd(exp, op1, op2);
11397 FreeExpContents(exp);
11398 op1->ops.BitOr(exp, op1, op2);
11402 if(op1->ops.BitXor)
11404 FreeExpContents(exp);
11405 op1->ops.BitXor(exp, op1, op2);
11409 if(op1->ops.LShift)
11411 FreeExpContents(exp);
11412 op1->ops.LShift(exp, op1, op2);
11416 if(op1->ops.RShift)
11418 FreeExpContents(exp);
11419 op1->ops.RShift(exp, op1, op2);
11425 FreeExpContents(exp);
11426 op1->ops.Equ(exp, op1, op2);
11432 FreeExpContents(exp);
11433 op1->ops.Nqu(exp, op1, op2);
11439 FreeExpContents(exp);
11440 op1->ops.And(exp, op1, op2);
11446 FreeExpContents(exp);
11447 op1->ops.Or(exp, op1, op2);
11453 FreeExpContents(exp);
11454 op1->ops.Grt(exp, op1, op2);
11460 FreeExpContents(exp);
11461 op1->ops.Sma(exp, op1, op2);
11465 if(op1->ops.GrtEqu)
11467 FreeExpContents(exp);
11468 op1->ops.GrtEqu(exp, op1, op2);
11472 if(op1->ops.SmaEqu)
11474 FreeExpContents(exp);
11475 op1->ops.SmaEqu(exp, op1, op2);
11483 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11485 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11487 void ComputeExpression(struct Expression * exp)
11489 char expString[10240];
11491 expString[0] = '\0';
11496 ComputeInstantiation(exp);
11501 struct Expression * exp1, * exp2 = (((void *)0));
11502 struct Operand op1 =
11506 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
11509 struct Operand op2 =
11513 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
11518 ComputeExpression(exp->op.exp2);
11521 ComputeExpression(exp->op.exp1);
11522 exp1 = exp->op.exp1;
11523 exp2 = exp->op.exp2;
11524 op1 = GetOperand(exp1);
11526 op1.type->refCount++;
11529 op2 = GetOperand(exp2);
11531 op2.type->refCount++;
11536 exp1 = exp->op.exp2;
11537 op1 = GetOperand(exp1);
11539 op1.type->refCount++;
11541 CallOperator(exp, exp1, exp2, &op1, &op2);
11543 FreeType(op1.type);
11545 FreeType(op2.type);
11551 struct Expression * e, * n;
11553 for(e = (*exp->list).first; e; e = n)
11558 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11560 ComputeExpression(e);
11561 FreeType(exp->expType);
11562 FreeType(exp->destType);
11564 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11565 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11576 struct Expression * memberExp = exp->member.exp;
11577 struct Identifier * memberID = exp->member.member;
11578 struct Type * type;
11580 ComputeExpression(exp->member.exp);
11581 type = exp->member.exp->expType;
11584 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)));
11585 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11586 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11587 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11589 if(type->kind == 19 && exp->member.exp->type == 26)
11590 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11594 struct Symbol * classSym;
11597 PrintTypeNoConst(type, string, 0x0, 0x1);
11598 classSym = FindClass(string);
11599 _class = classSym ? classSym->registered : (((void *)0));
11601 if(exp->member.member)
11603 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11605 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11607 if(!prop && !member && _class && exp->member.member)
11609 struct Symbol * classSym = FindClass(exp->member.member->string);
11611 convertTo = _class;
11612 _class = classSym ? classSym->registered : (((void *)0));
11613 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11619 struct Type * type = prop->dataType;
11621 if(_class->type == 3)
11623 if(type->kind == 8)
11625 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11627 if(_class->type == 3)
11629 if(!_class->dataType)
11630 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11631 type = _class->dataType;
11639 float (* Get)(float) = (void *)prop->Get;
11641 GetFloat(exp->member.exp, &value);
11642 exp->constant = PrintFloat(Get ? Get(value) : value);
11649 double (* Get)(double);
11651 GetDouble(exp->member.exp, &value);
11653 Get = (void *)prop->Set;
11655 Get = (void *)prop->Get;
11656 exp->constant = PrintDouble(Get ? Get(value) : value);
11666 struct Expression * value = exp->member.exp;
11667 struct Type * type;
11669 if(!prop->dataType)
11670 ProcessPropertyType(prop);
11671 type = prop->dataType;
11675 else if(_class->type == 1)
11681 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11683 if(propertyClass->type == 1 && value->type == 1)
11685 void (* Set)(void *, void *) = (void *)prop->Set;
11687 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11688 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11689 exp->instance->_class = MkSpecifierName(_class->fullName);
11690 exp->instance->loc = exp->loc;
11692 Set(exp->instance->data, value->instance->data);
11693 PopulateInstance(exp->instance);
11700 void (* Set)(void *, int) = (void *)prop->Set;
11702 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11703 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11704 exp->instance->_class = MkSpecifierName(_class->fullName);
11705 exp->instance->loc = exp->loc;
11707 GetInt(value, &intValue);
11708 Set(exp->instance->data, intValue);
11709 PopulateInstance(exp->instance);
11714 long long intValue;
11715 void (* Set)(void *, long long) = (void *)prop->Set;
11717 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11718 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11719 exp->instance->_class = MkSpecifierName(_class->fullName);
11720 exp->instance->loc = exp->loc;
11722 GetInt64(value, &intValue);
11723 Set(exp->instance->data, intValue);
11724 PopulateInstance(exp->instance);
11730 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11732 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11733 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11734 exp->instance->_class = MkSpecifierName(_class->fullName);
11735 exp->instance->loc = exp->loc;
11737 GetIntPtr(value, &intValue);
11738 Set(exp->instance->data, intValue);
11739 PopulateInstance(exp->instance);
11745 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11747 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11748 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11749 exp->instance->_class = MkSpecifierName(_class->fullName);
11750 exp->instance->loc = exp->loc;
11752 GetIntSize(value, &intValue);
11753 Set(exp->instance->data, intValue);
11754 PopulateInstance(exp->instance);
11759 double doubleValue;
11760 void (* Set)(void *, double) = (void *)prop->Set;
11762 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11763 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11764 exp->instance->_class = MkSpecifierName(_class->fullName);
11765 exp->instance->loc = exp->loc;
11767 GetDouble(value, &doubleValue);
11768 Set(exp->instance->data, doubleValue);
11769 PopulateInstance(exp->instance);
11774 else if(_class->type == 2)
11780 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11782 if(propertyClass->type == 1 && value->instance->data)
11784 unsigned int (* Set)(void *) = (void *)prop->Set;
11785 unsigned int bits = Set(value->instance->data);
11787 exp->constant = PrintHexUInt(bits);
11791 else if(_class->type == 2)
11793 unsigned int value;
11794 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11797 GetUInt(exp->member.exp, &value);
11799 exp->constant = PrintHexUInt(bits);
11808 if(_class->type == 2)
11810 unsigned int value;
11812 GetUInt(exp->member.exp, &value);
11817 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11819 if(_class->type == 1)
11821 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11823 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11824 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11825 exp->instance->_class = MkSpecifierName(_class->fullName);
11826 exp->instance->loc = exp->loc;
11828 Get(value, exp->instance->data);
11829 PopulateInstance(exp->instance);
11831 else if(_class->type == 2)
11833 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11834 uint64 bits = Get(value);
11836 exp->constant = PrintHexUInt64(bits);
11843 else if(_class->type == 1)
11845 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11851 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11853 if(_class->type == 1 && value)
11855 void (* Get)(void *, void *) = (void *)prop->Get;
11857 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11858 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11859 exp->instance->_class = MkSpecifierName(_class->fullName);
11860 exp->instance->loc = exp->loc;
11862 Get(value, exp->instance->data);
11863 PopulateInstance(exp->instance);
11874 exp->isConstant = 0x0;
11883 FreeExpression(memberExp);
11884 FreeIdentifier(memberID);
11890 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11892 FreeExpContents(exp);
11893 exp->constant = PrintUInt(ComputeTypeSize(type));
11900 struct Symbol * classSym = exp->_class->symbol;
11902 if(classSym && classSym->registered)
11904 if(classSym->registered->fixed)
11906 FreeSpecifier(exp->_class);
11907 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11912 char className[1024];
11914 strcpy(className, "__ecereClass_");
11915 FullClassNameCat(className, classSym->string, 0x1);
11916 MangleClassName(className);
11917 DeclareClass(classSym, className);
11918 FreeExpContents(exp);
11920 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11921 exp->member.member = MkIdentifier("structSize");
11928 struct Type * type;
11929 struct Expression * e = exp;
11931 if(exp->type == 11)
11934 ComputeExpression(exp->cast.exp);
11937 if(e && exp->expType)
11939 type = exp->expType;
11940 if(type->kind == 8)
11942 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11944 if(_class && (_class->type == 3 || _class->type == 2))
11946 if(!_class->dataType)
11947 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11948 type = _class->dataType;
11959 GetChar(e, &value);
11960 FreeExpContents(exp);
11961 exp->constant = PrintChar(value);
11966 unsigned char value;
11968 GetUChar(e, &value);
11969 FreeExpContents(exp);
11970 exp->constant = PrintUChar(value);
11979 GetShort(e, &value);
11980 FreeExpContents(exp);
11981 exp->constant = PrintShort(value);
11986 unsigned short value;
11988 GetUShort(e, &value);
11989 FreeExpContents(exp);
11990 exp->constant = PrintUShort(value);
12000 FreeExpContents(exp);
12001 exp->constant = PrintInt(value);
12006 unsigned int value;
12008 GetUInt(e, &value);
12009 FreeExpContents(exp);
12010 exp->constant = PrintUInt(value);
12019 GetInt64(e, &value);
12020 FreeExpContents(exp);
12021 exp->constant = PrintInt64(value);
12028 GetUInt64(e, &value);
12029 FreeExpContents(exp);
12030 exp->constant = PrintUInt64(value);
12039 GetIntPtr(e, &value);
12040 FreeExpContents(exp);
12041 exp->constant = PrintInt64((long long)value);
12048 GetUIntPtr(e, &value);
12049 FreeExpContents(exp);
12050 exp->constant = PrintUInt64((uint64)value);
12059 GetIntSize(e, &value);
12060 FreeExpContents(exp);
12061 exp->constant = PrintInt64((long long)value);
12068 GetUIntSize(e, &value);
12069 FreeExpContents(exp);
12070 exp->constant = PrintUInt64((uint64)value);
12078 GetFloat(e, &value);
12079 FreeExpContents(exp);
12080 exp->constant = PrintFloat(value);
12088 GetDouble(e, &value);
12089 FreeExpContents(exp);
12090 exp->constant = PrintDouble(value);
12100 struct Operand op1 =
12104 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
12107 struct Operand op2 =
12111 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
12114 struct Operand op3 =
12118 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
12123 ComputeExpression((*exp->cond.exp).last);
12124 if(exp->cond.elseExp)
12125 ComputeExpression(exp->cond.elseExp);
12127 ComputeExpression(exp->cond.cond);
12128 op1 = GetOperand(exp->cond.cond);
12130 op1.type->refCount++;
12131 op2 = GetOperand((*exp->cond.exp).last);
12133 op2.type->refCount++;
12134 op3 = GetOperand(exp->cond.elseExp);
12136 op3.type->refCount++;
12139 FreeExpContents(exp);
12140 op1.ops.Cond(exp, &op1, &op2, &op3);
12143 FreeType(op1.type);
12145 FreeType(op2.type);
12147 FreeType(op3.type);
12153 void ApplyAnyObjectLogic(struct Expression * e);
12155 extern void CopyTypeInto(struct Type * type, struct Type * src);
12157 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12159 unsigned int result = 0x1;
12163 struct __ecereNameSpace__ecere__sys__OldList converts =
12167 struct Conversion * convert;
12169 if(destType->kind == 0)
12171 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12175 for(convert = converts.first; convert; convert = convert->next)
12177 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12181 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12182 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12185 newExp->destType = (((void *)0));
12189 exp->addedThis = 0x1;
12190 exp->member.exp = newExp;
12191 FreeType(exp->member.exp->expType);
12192 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12193 exp->member.exp->expType->classObjectType = objectType;
12194 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12195 exp->member.memberType = 1;
12196 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12197 exp->needCast = 0x1;
12199 exp->expType->refCount++;
12200 ApplyAnyObjectLogic(exp->member.exp);
12206 exp->addedThis = 0x1;
12207 exp->member.exp = newExp;
12208 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12210 newExp->byReference = 0x1;
12212 FreeType(exp->member.exp->expType);
12213 exp->member.exp->expType = (((void *)0));
12214 if(convert->convert->dataType)
12216 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12217 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12218 exp->member.exp->expType->refCount = 1;
12219 exp->member.exp->expType->classObjectType = objectType;
12220 ApplyAnyObjectLogic(exp->member.exp);
12222 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12223 exp->member.memberType = 4;
12224 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12225 exp->needCast = 0x1;
12226 if(convert->resultType)
12227 convert->resultType->refCount++;
12233 FreeType(exp->expType);
12236 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12237 exp->needCast = 0x1;
12239 exp->expType->refCount++;
12243 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12244 exp->needCast = 0x1;
12245 if(convert->resultType)
12246 convert->resultType->refCount++;
12250 if(exp->isConstant && inCompiler)
12251 ComputeExpression(exp);
12252 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12254 if(!result && exp->expType && converts.count)
12256 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12258 if(!result && exp->expType && exp->destType)
12260 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))
12267 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12269 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12271 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12273 void CheckTemplateTypes(struct Expression * exp)
12275 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12277 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12278 struct Statement * compound;
12279 struct Context * context;
12283 exp->destType->refCount++;
12285 exp->expType->refCount++;
12286 newExp->prev = (((void *)0));
12287 newExp->next = (((void *)0));
12288 switch(exp->expType->kind)
12291 if(exp->destType->classObjectType)
12294 exp->destType->refCount--;
12296 exp->expType->refCount--;
12297 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12301 struct __ecereNameSpace__ecere__sys__OldList * specs;
12302 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12303 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12305 context = PushContext();
12306 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12307 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12308 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12310 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12311 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12312 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12313 exp->compound->compound.context = context;
12314 PopContext(context);
12319 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12320 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12324 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12326 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12327 struct Statement * compound;
12328 struct Context * context;
12332 exp->destType->refCount++;
12334 exp->expType->refCount++;
12335 newExp->prev = (((void *)0));
12336 newExp->next = (((void *)0));
12337 switch(exp->expType->kind)
12340 if(exp->destType->classObjectType)
12343 exp->destType->refCount--;
12345 exp->expType->refCount--;
12346 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12350 struct __ecereNameSpace__ecere__sys__OldList * specs;
12351 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12352 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12354 context = PushContext();
12355 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12356 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12357 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12359 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12360 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12361 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12362 exp->compound->compound.context = context;
12363 PopContext(context);
12368 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12371 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12372 ProcessExpressionType((*exp->list).first);
12378 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12379 newExp->needCast = 0x1;
12380 ProcessExpressionType((*exp->list).first);
12386 if(exp->expType->kind == 20)
12388 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12392 FreeType(exp->destType);
12393 FreeType(exp->expType);
12394 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12398 if(newExp->type == 8 && newExp->member.memberType == 3)
12402 exp->op.exp1 = (((void *)0));
12403 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12407 char typeString[1024];
12408 struct Declarator * decl;
12409 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12411 typeString[0] = '\0';
12412 PrintType(exp->expType, typeString, 0x0, 0x0);
12413 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12415 exp->cast.typeName = MkTypeName(specs, decl);
12416 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12417 exp->cast.exp->needCast = 0x1;
12425 extern int strncmp(const char * , const char * , size_t n);
12427 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12429 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12431 int nsLen = strlen(nameSpace);
12432 struct Symbol * symbol;
12434 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)))
12436 char * s = symbol->string;
12438 if(!strncmp(s, nameSpace, nsLen))
12443 for(c = strlen(s) - 1; c >= 0; c--)
12446 namePart = s + c + 1;
12447 if(!strcmp(namePart, name))
12455 return (((void *)0));
12458 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12461 char nameSpace[1024];
12463 unsigned int gotColon = 0x0;
12465 nameSpace[0] = '\0';
12466 for(c = strlen(name) - 1; c >= 0; c--)
12472 namePart = name + c + 1;
12473 while(c >= 0 && name[c] == ':')
12477 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12481 memcpy(nameSpace, name, c + 1);
12482 nameSpace[c + 1] = (char)0;
12483 return ScanWithNameSpace(tree, nameSpace, namePart);
12487 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12493 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12497 return ScanWithNameSpace(tree, "", namePart);
12499 return (((void *)0));
12502 static void ProcessDeclaration(struct Declaration * decl);
12504 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12506 struct Context * ctx;
12507 struct Symbol * symbol = (((void *)0));
12509 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12511 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12513 symbol = (((void *)0));
12516 char curName[1024];
12518 strcpy(curName, thisNameSpace);
12519 strcat(curName, "::");
12520 strcat(curName, name);
12521 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12524 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12527 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12528 if(symbol || ctx == endContext)
12531 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12533 if(symbol->pointerExternal->type == 0)
12535 struct FunctionDefinition * function = symbol->pointerExternal->function;
12536 struct Context * tmpContext = curContext;
12538 curContext = (((void *)0));
12539 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12540 curContext = tmpContext;
12541 symbol->pointerExternal->symbol = symbol;
12542 DeclareType(symbol->type, 0x1, 0x1);
12543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12544 symbol->id = curExternal->symbol->idCode;
12546 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12549 symbol->id = curExternal->symbol->idCode;
12555 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12557 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12558 ListAdd(specs, MkSpecifier(UNSIGNED));
12563 if(type->_class->registered)
12565 if(!type->_class->registered->dataType)
12566 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12567 GetTypeSpecs(type->_class->registered->dataType, specs);
12572 ListAdd(specs, MkSpecifier(DOUBLE));
12575 ListAdd(specs, MkSpecifier(FLOAT));
12578 ListAdd(specs, MkSpecifier(CHAR));
12581 ListAdd(specs, MkSpecifier(_BOOL));
12584 ListAdd(specs, MkSpecifier(SHORT));
12587 ListAdd(specs, MkSpecifier(INT64));
12590 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12593 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12597 ListAdd(specs, MkSpecifier(INT));
12602 static void PrintArraySize(struct Type * arrayType, char * string)
12608 if(arrayType->enumClass)
12609 strcat(size, arrayType->enumClass->string);
12610 else if(arrayType->arraySizeExp)
12611 PrintExpression(arrayType->arraySizeExp, size);
12613 strcat(string, size);
12616 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12620 if(printConst && type->constant)
12621 strcat(string, "const ");
12626 struct Symbol * c = type->_class;
12628 if(type->classObjectType == 2)
12629 strcat(string, "typed_object");
12630 else if(type->classObjectType == 3)
12631 strcat(string, "any_object");
12635 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12637 if(type->byReference)
12638 strcat(string, " &");
12642 strcat(string, "void");
12645 strcat(string, type->isSigned ? "int" : "uint");
12648 strcat(string, type->isSigned ? "int64" : "uint64");
12651 strcat(string, type->isSigned ? "intptr" : "uintptr");
12654 strcat(string, type->isSigned ? "intsize" : "uintsize");
12657 strcat(string, type->isSigned ? "char" : "byte");
12660 strcat(string, "_Bool");
12663 strcat(string, type->isSigned ? "short" : "uint16");
12666 strcat(string, "float");
12669 strcat(string, "double");
12674 strcat(string, "struct ");
12675 strcat(string, type->enumName);
12677 else if(type->typeName)
12678 strcat(string, type->typeName);
12681 struct Type * member;
12683 strcat(string, "struct { ");
12684 for(member = type->members.first; member; member = member->next)
12686 PrintType(member, string, 0x1, fullName);
12687 strcat(string, "; ");
12689 strcat(string, "}");
12695 strcat(string, "union ");
12696 strcat(string, type->enumName);
12698 else if(type->typeName)
12699 strcat(string, type->typeName);
12702 strcat(string, "union ");
12703 strcat(string, "(unnamed)");
12709 strcat(string, "enum ");
12710 strcat(string, type->enumName);
12712 else if(type->typeName)
12713 strcat(string, type->typeName);
12715 strcat(string, "int");
12718 strcat(string, "...");
12721 strcat(string, "subclass(");
12722 strcat(string, type->_class ? type->_class->string : "int");
12723 strcat(string, ")");
12726 strcat(string, type->templateParameter->identifier->string);
12729 strcat(string, "thisclass");
12732 strcat(string, "__builtin_va_list");
12738 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12740 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12742 if(type->name && type->name[0])
12745 strcat(string, type->name);
12748 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12754 strcat(string, name);
12759 static void PrintAttribs(struct Type * type, char * string)
12763 if(type->dllExport)
12764 strcat(string, "dllexport ");
12765 if(type->attrStdcall)
12766 strcat(string, "stdcall ");
12770 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12772 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12774 struct Type * attrType = (((void *)0));
12776 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12777 PrintAttribs(type, string);
12778 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12779 strcat(string, " const");
12780 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12781 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12782 strcat(string, " (");
12783 if(type->kind == 13)
12785 if(type->type->kind == 11 || type->type->kind == 16)
12786 PrintAttribs(type->type, string);
12788 if(type->kind == 13)
12790 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12791 strcat(string, "*");
12793 strcat(string, " *");
12795 if(printConst && type->constant && type->kind == 13)
12796 strcat(string, " const");
12799 PrintTypeSpecs(type, string, fullName, printConst);
12802 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12804 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12805 strcat(string, ")");
12806 if(type->kind == 12)
12807 PrintArraySize(type, string);
12808 else if(type->kind == 11)
12810 struct Type * param;
12812 strcat(string, "(");
12813 for(param = type->params.first; param; param = param->next)
12815 PrintType(param, string, 0x1, fullName);
12817 strcat(string, ", ");
12819 strcat(string, ")");
12821 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12822 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12825 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12827 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12828 if(type->thisClass || (printName && type->name && type->name[0]))
12829 strcat(string, " ");
12830 if((type->thisClass || type->staticMethod))
12832 struct Symbol * _class = type->thisClass;
12834 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12836 if(type->classObjectType == 1)
12837 strcat(string, "class");
12839 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12841 else if(_class && _class->string)
12843 char * s = _class->string;
12849 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12855 strcat(string, name);
12858 strcat(string, "::");
12860 if(printName && type->name)
12861 PrintName(type, string, fullName);
12862 PostPrintType(type, string, fullName);
12863 if(type->bitFieldCount)
12867 sprintf(count, ":%d", type->bitFieldCount);
12868 strcat(string, count);
12872 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12874 _PrintType(type, string, printName, fullName, 0x1);
12877 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12879 _PrintType(type, string, printName, fullName, 0x0);
12882 static struct Type * FindMember(struct Type * type, char * string)
12884 struct Type * memberType;
12886 for(memberType = type->members.first; memberType; memberType = memberType->next)
12888 if(!memberType->name)
12890 struct Type * subType = FindMember(memberType, string);
12895 else if(!strcmp(memberType->name, string))
12898 return (((void *)0));
12901 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12903 struct Type * memberType;
12905 for(memberType = type->members.first; memberType; memberType = memberType->next)
12907 if(!memberType->name)
12909 struct Type * subType = FindMember(memberType, string);
12913 *offset += memberType->offset;
12917 else if(!strcmp(memberType->name, string))
12919 *offset += memberType->offset;
12923 return (((void *)0));
12926 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12928 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12930 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12932 struct Expression * ParseExpressionString(char * expression)
12934 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12935 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
12936 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12938 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12939 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12940 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12941 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12943 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12944 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12946 parsedExpression = (((void *)0));
12948 expression_yyparse();
12949 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12950 return parsedExpression;
12953 extern char * QMkString(char * source);
12955 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12957 struct Identifier * id = exp->identifier;
12958 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12959 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12960 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12961 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12963 if(_class && _class->type == 4)
12965 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12966 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12970 struct __ecereNameSpace__ecere__com__Class * baseClass;
12972 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12974 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12976 for(value = e->values.first; value; value = value->next)
12978 if(!strcmp(value->name, id->string))
12983 char constant[256];
12985 FreeExpContents(exp);
12987 exp->isConstant = 0x1;
12988 if(!strcmp(baseClass->dataTypeString, "int"))
12989 sprintf(constant, "%d", (int)value->data);
12991 sprintf(constant, "0x%X", (int)value->data);
12992 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12993 exp->expType = MkClassType(baseClass->fullName);
13001 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13003 ProcessMethodType(method);
13004 exp->expType = __extension__ ({
13005 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13007 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13011 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13013 if(!prop->dataType)
13014 ProcessPropertyType(prop);
13015 exp->expType = prop->dataType;
13017 prop->dataType->refCount++;
13020 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13022 if(!member->dataType)
13023 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13024 exp->expType = member->dataType;
13025 if(member->dataType)
13026 member->dataType->refCount++;
13029 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13031 if(!classProp->dataType)
13032 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13033 if(classProp->constant)
13035 FreeExpContents(exp);
13036 exp->isConstant = 0x1;
13037 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13040 exp->constant = QMkString((char *)classProp->Get(_class));
13044 char constant[256];
13047 sprintf(constant, "%d", (int)classProp->Get(_class));
13048 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13054 exp->expType = classProp->dataType;
13055 if(classProp->dataType)
13056 classProp->dataType->refCount++;
13062 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13064 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13065 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13066 struct __ecereNameSpace__ecere__com__NameSpace * child;
13070 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)))
13072 data = ScanGlobalData(child, name);
13080 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13082 extern char * strncpy(char * , const char * , size_t n);
13084 static struct GlobalData * FindGlobalData(char * name)
13087 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13089 nameSpace = globalData;
13090 for(c = 0; name[c]; c++)
13092 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13094 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13095 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13097 strncpy(spaceName, name + start, c - start);
13098 spaceName[c - start] = '\0';
13099 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13100 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13102 return (((void *)0));
13103 nameSpace = newSpace;
13111 return ScanGlobalData(nameSpace, name + start);
13113 return (((void *)0));
13116 static int definedExpStackPos;
13118 static void * definedExpStack[512];
13120 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13122 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13124 FreeExpContents(checkedExp);
13125 FreeType(checkedExp->expType);
13126 FreeType(checkedExp->destType);
13127 *checkedExp = *newExp;
13128 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13129 checkedExp->prev = prev;
13130 checkedExp->next = next;
13133 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13135 extern int printf(char * , ...);
13137 void __ecereMethod_Expression_Clear();
13139 void ApplyAnyObjectLogic(struct Expression * e)
13141 struct Type * destType = e->destType;
13143 if(destType && (destType->classObjectType == 3))
13145 if(e && e->expType)
13147 struct Type * type = e->expType;
13148 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13150 if(type->kind == 8 && type->_class && type->_class->registered)
13152 _class = type->_class->registered;
13154 else if(type->kind == 19)
13156 _class = FindClass("ecere::com::Class")->registered;
13160 char string[1024] = "";
13161 struct Symbol * classSym;
13163 PrintTypeNoConst(type, string, 0x0, 0x1);
13164 classSym = FindClass(string);
13166 _class = classSym->registered;
13168 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)))
13170 if(!_class || strcmp(_class->fullName, "char *"))
13172 struct Expression * checkedExp = e, * newExp;
13174 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13176 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13178 if(checkedExp->type == 25)
13180 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13183 checkedExp = (*checkedExp->list).last;
13185 else if(checkedExp->type == 11)
13186 checkedExp = checkedExp->cast.exp;
13188 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13190 newExp = checkedExp->op.exp2;
13191 checkedExp->op.exp2 = (((void *)0));
13192 FreeExpContents(checkedExp);
13193 if(e->expType && e->expType->passAsTemplate)
13197 ComputeTypeSize(e->expType);
13198 sprintf(size, "%d", e->expType->size);
13199 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))))));
13201 ReplaceExpContents(checkedExp, newExp);
13202 e->byReference = 0x1;
13204 else if(!e->byReference || (_class && _class->type == 5))
13206 struct Expression * checkedExp, * newExp;
13209 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;
13211 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13213 struct Context * context = PushContext();
13214 struct Declarator * decl;
13215 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13216 char typeString[1024];
13217 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13219 typeString[0] = '\0';
13221 newExp->prev = (((void *)0));
13222 newExp->next = (((void *)0));
13223 newExp->expType = (((void *)0));
13224 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13225 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13226 newExp->destType = ProcessType(specs, decl);
13227 curContext = context;
13231 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13234 sprintf(name, "__internalValue%03X", internalValueCounter++);
13235 if(!curCompound->compound.declarations)
13236 curCompound->compound.declarations = MkList();
13237 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13238 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13239 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13240 e->compound = MkCompoundStmt((((void *)0)), stmts);
13243 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13245 struct Type * type = e->destType;
13247 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13248 CopyTypeInto(e->destType, type);
13249 e->destType->refCount = 1;
13250 e->destType->classObjectType = 0;
13253 e->compound->compound.context = context;
13254 PopContext(context);
13255 curContext = context->parent;
13259 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13261 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13263 if(checkedExp->type == 25)
13265 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13268 checkedExp = (*checkedExp->list).last;
13270 else if(checkedExp->type == 11)
13271 checkedExp = checkedExp->cast.exp;
13274 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13276 *operand = *checkedExp;
13277 checkedExp->destType = (((void *)0));
13278 checkedExp->expType = (((void *)0));
13279 __ecereMethod_Expression_Clear(checkedExp);
13280 checkedExp->type = 4;
13281 checkedExp->op.op = '&';
13282 checkedExp->op.exp1 = (((void *)0));
13283 checkedExp->op.exp2 = operand;
13292 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))))
13294 if(e->expType->classObjectType && destType && destType->classObjectType)
13300 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13303 thisExp->prev = (((void *)0));
13304 thisExp->next = (((void *)0));
13305 __ecereMethod_Expression_Clear(e);
13307 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13308 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13309 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13311 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13312 CopyTypeInto(e->expType, thisExp->expType);
13313 e->expType->byReference = 0x0;
13314 e->expType->refCount = 1;
13315 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))
13317 e->expType->classObjectType = 0;
13322 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13324 if(destType->kind == 14)
13326 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
13328 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13330 unsigned int byReference = e->expType->byReference;
13331 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13332 struct Declarator * decl;
13333 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13334 char typeString[1024];
13335 struct Type * type;
13336 int backupClassObjectType;
13337 unsigned int backupByReference;
13339 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13343 backupClassObjectType = type->classObjectType;
13344 backupByReference = type->byReference;
13345 type->classObjectType = 0;
13346 type->byReference = 0x0;
13347 typeString[0] = '\0';
13348 PrintType(type, typeString, 0x0, 0x1);
13349 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13350 type->classObjectType = backupClassObjectType;
13351 type->byReference = backupByReference;
13353 thisExp->prev = (((void *)0));
13354 thisExp->next = (((void *)0));
13355 __ecereMethod_Expression_Clear(e);
13356 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)))
13360 e->op.exp1 = (((void *)0));
13361 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13362 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13363 CopyTypeInto(e->expType, type);
13364 e->expType->byReference = 0x0;
13365 e->expType->refCount = 1;
13370 e->cast.typeName = MkTypeName(specs, decl);
13371 e->cast.exp = thisExp;
13372 e->byReference = 0x1;
13376 e->destType = destType;
13377 destType->refCount++;
13382 extern char * strstr(const char * , const char * );
13384 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13386 struct __ecereNameSpace__ecere__com__DefinedExpression
13388 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13389 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13392 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13393 } __attribute__ ((gcc_struct));
13395 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13397 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13399 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13401 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13403 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13405 extern struct Expression * CopyExpression(struct Expression * exp);
13407 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13409 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13411 static void ProcessStatement(struct Statement * stmt);
13413 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13415 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13417 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13419 extern char * sourceFile;
13421 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13423 void ProcessExpressionType(struct Expression * exp)
13425 unsigned int unresolved = 0x0;
13426 struct Location oldyylloc = yylloc;
13427 unsigned int notByReference = 0x0;
13429 if(!exp || exp->expType)
13436 struct Identifier * id = exp->identifier;
13440 if(id->_class && id->_class->name)
13442 id->classSym = id->_class->symbol;
13444 if(strstr(id->string, "__ecereClass") == id->string)
13446 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13449 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13451 ReplaceClassMembers(exp, thisClass);
13454 ProcessExpressionType(exp);
13457 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13462 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13466 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13472 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13475 ProcessExpressionType(exp);
13479 else if(currentClass && !id->_class)
13481 if(ResolveIdWithClass(exp, currentClass, 0x1))
13484 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13489 struct Type * type = symbol->type;
13490 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13492 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13494 struct Context * context = SetupTemplatesContext(_class);
13496 type = ReplaceThisClassType(_class);
13497 FinishTemplatesContext(context);
13499 type->refCount = 0;
13501 FreeSpecifier(id->_class);
13502 id->_class = (((void *)0));
13503 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13504 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13505 id->classSym = (((void *)0));
13506 exp->expType = type;
13509 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13510 exp->isConstant = 0x1;
13511 if(symbol->isParam || !strcmp(id->string, "this"))
13513 if(_class && _class->type == 1 && !type->declaredWithStruct)
13514 exp->byReference = 0x1;
13516 if(symbol->isIterator)
13518 if(symbol->isIterator == 3)
13521 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13522 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13523 exp->expType = (((void *)0));
13524 ProcessExpressionType(exp);
13526 else if(symbol->isIterator != 4)
13529 exp->member.exp = MkExpIdentifier(exp->identifier);
13530 exp->member.exp->expType = exp->expType;
13531 exp->member.member = MkIdentifier("data");
13532 exp->expType = (((void *)0));
13533 ProcessExpressionType(exp);
13540 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13542 if(thisNameSpace && !(id->_class && !id->_class->name))
13546 strcpy(name, thisNameSpace);
13547 strcat(name, "::");
13548 strcat(name, id->string);
13549 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13552 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13557 for(c = 0; c < definedExpStackPos; c++)
13558 if(definedExpStack[c] == definedExp)
13560 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13562 struct Location backupYylloc = yylloc;
13564 definedExpStack[definedExpStackPos++] = definedExp;
13565 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13566 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13567 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13569 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13570 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13571 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13572 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13574 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13575 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13577 parsedExpression = (((void *)0));
13579 expression_yyparse();
13580 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13581 yylloc = backupYylloc;
13582 if(parsedExpression)
13584 FreeIdentifier(id);
13586 exp->list = MkListOne(parsedExpression);
13587 parsedExpression->loc = yylloc;
13588 ProcessExpressionType(exp);
13589 definedExpStackPos--;
13592 definedExpStackPos--;
13598 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
13604 struct GlobalData * data = (((void *)0));
13606 if(thisNameSpace && !(id->_class && !id->_class->name))
13610 strcpy(name, thisNameSpace);
13611 strcat(name, "::");
13612 strcat(name, id->string);
13613 data = FindGlobalData(name);
13616 data = FindGlobalData(id->string);
13619 DeclareGlobalData(data);
13620 exp->expType = data->dataType;
13622 data->dataType->refCount++;
13623 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13624 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13625 FreeSpecifier(id->_class);
13626 id->_class = (((void *)0));
13631 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13633 if(thisNameSpace && !(id->_class && !id->_class->name))
13637 strcpy(name, thisNameSpace);
13638 strcat(name, "::");
13639 strcat(name, id->string);
13640 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13643 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13648 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13649 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13651 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13652 strcpy(name, "__ecereFunction_");
13653 FullClassNameCat(name, id->string, 0x0);
13654 if(DeclareFunction(function, name))
13656 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13657 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13659 exp->expType = function->dataType;
13660 if(function->dataType)
13661 function->dataType->refCount++;
13662 FreeSpecifier(id->_class);
13663 id->_class = (((void *)0));
13675 struct __ecereNameSpace__ecere__com__Class * _class;
13677 if(!exp->instance->_class)
13679 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13681 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13684 ProcessInstantiationType(exp->instance);
13685 exp->isConstant = exp->instance->isConstant;
13686 if(exp->instance->_class)
13688 exp->expType = MkClassType(exp->instance->_class->name);
13696 char * constant = exp->constant;
13697 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13699 exp->expType = type;
13700 if(constant[0] == '\'')
13702 if((int)((unsigned char *)constant)[1] > 127)
13705 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13709 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13710 exp->constant = PrintUInt(ch);
13712 type->_class = FindClass("unichar");
13713 type->isSigned = 0x0;
13718 type->isSigned = 0x1;
13723 char * dot = strchr(constant, '.');
13724 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13729 exponent = strchr(constant, 'p');
13731 exponent = strchr(constant, 'P');
13735 exponent = strchr(constant, 'e');
13737 exponent = strchr(constant, 'E');
13739 if(dot || exponent)
13741 if(strchr(constant, 'f') || strchr(constant, 'F'))
13745 type->isSigned = 0x1;
13749 unsigned int isSigned = constant[0] == '-';
13750 long long i64 = strtoll(constant, (((void *)0)), 0);
13751 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13752 unsigned int is64Bit = 0x0;
13756 if(i64 < (((int)0x80000000)))
13761 if(ui64 > (((int)0x7fffffff)))
13763 if(ui64 > (0xffffffff))
13766 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13770 else if(constant[0] != '0' || !constant[1])
13773 type->kind = is64Bit ? 4 : 3;
13774 type->isSigned = isSigned;
13777 exp->isConstant = 0x1;
13778 if(exp->destType && exp->destType->kind == 7)
13780 else if(exp->destType && exp->destType->kind == 6)
13782 else if(exp->destType && exp->destType->kind == 4)
13789 exp->isConstant = 0x1;
13790 exp->expType = __extension__ ({
13791 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13793 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13794 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13796 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13797 }), __ecereInstance2;
13803 ProcessExpressionType(exp->_new.size);
13804 exp->expType = __extension__ ({
13805 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13807 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13809 DeclareType(exp->expType->type, 0x0, 0x0);
13813 ProcessExpressionType(exp->_renew.size);
13814 ProcessExpressionType(exp->_renew.exp);
13815 exp->expType = __extension__ ({
13816 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13818 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13820 DeclareType(exp->expType->type, 0x0, 0x0);
13824 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13825 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13826 unsigned int useDestType = 0x0, useSideType = 0x0;
13827 struct Location oldyylloc = yylloc;
13828 unsigned int useSideUnit = 0x0;
13829 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13871 if(exp->op.op != '*' || exp->op.exp1)
13878 if(exp->op.op == '&')
13880 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13882 struct Identifier * id = exp->op.exp2->identifier;
13883 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13885 if(symbol && symbol->isIterator == 2)
13888 exp->member.exp = exp->op.exp2;
13889 exp->member.member = MkIdentifier("key");
13890 exp->expType = (((void *)0));
13891 exp->op.exp2->expType = symbol->type;
13892 symbol->type->refCount++;
13893 ProcessExpressionType(exp);
13901 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))
13903 if(exp->op.exp1->destType)
13904 FreeType(exp->op.exp1->destType);
13905 exp->op.exp1->destType = exp->destType;
13907 exp->destType->refCount++;
13911 if(exp->op.exp1->destType)
13912 FreeType(exp->op.exp1->destType);
13913 exp->op.exp1->destType = dummy;
13916 if(exp->op.exp1->destType && exp->op.op != '=')
13917 exp->op.exp1->destType->count++;
13918 ProcessExpressionType(exp->op.exp1);
13919 if(exp->op.exp1->destType && exp->op.op != '=')
13920 exp->op.exp1->destType->count--;
13921 if(exp->op.exp1->destType == dummy)
13924 exp->op.exp1->destType = (((void *)0));
13926 type1 = exp->op.exp1->expType;
13930 char expString[10240];
13932 expString[0] = '\0';
13933 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13937 exp->op.exp2->destType = exp->op.exp1->expType;
13938 if(exp->op.exp1->expType)
13939 exp->op.exp1->expType->refCount++;
13943 exp->op.exp2->destType = exp->destType;
13945 exp->destType->refCount++;
13949 exp->expType = type1;
13954 PrintExpression(exp->op.exp2, expString);
13955 if(type1 && type1->kind == 13)
13957 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)
13958 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13959 else if(exp->op.op == '=')
13961 if(exp->op.exp2->destType)
13962 FreeType(exp->op.exp2->destType);
13963 exp->op.exp2->destType = type1;
13970 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)
13974 if(exp->op.exp2->destType)
13975 FreeType(exp->op.exp2->destType);
13976 exp->op.exp2->destType = type1;
13983 exp->expType = type1;
13985 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)))
13987 if(exp->op.exp2->destType)
13988 FreeType(exp->op.exp2->destType);
13989 exp->op.exp2->destType = exp->destType;
13991 exp->destType->refCount++;
13995 if(exp->op.exp2->destType)
13996 FreeType(exp->op.exp2->destType);
13997 exp->op.exp2->destType = dummy;
14000 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14002 FreeType(exp->op.exp2->destType);
14003 exp->op.exp2->destType = type1;
14006 if(exp->op.exp2->destType && exp->op.op != '=')
14007 exp->op.exp2->destType->count++;
14008 ProcessExpressionType(exp->op.exp2);
14009 if(exp->op.exp2->destType && exp->op.op != '=')
14010 exp->op.exp2->destType->count--;
14011 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14013 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)
14015 if(exp->op.op != '=' && type1->type->kind == 0)
14016 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14018 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)))
14020 if(exp->op.op == ADD_ASSIGN)
14021 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14023 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))
14025 if(exp->op.op == ADD_ASSIGN)
14026 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14028 else if(inCompiler)
14030 char type1String[1024];
14031 char type2String[1024];
14033 type1String[0] = '\0';
14034 type2String[0] = '\0';
14035 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14036 PrintType(type1, type2String, 0x0, 0x1);
14037 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14038 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14041 if(exp->op.exp2->destType == dummy)
14044 exp->op.exp2->destType = (((void *)0));
14046 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14048 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14049 type2->refCount = 1;
14050 CopyTypeInto(type2, exp->op.exp2->expType);
14051 type2->isSigned = 0x1;
14053 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14055 type2 = __extension__ ({
14056 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14058 __ecereInstance1->kind = 3, __ecereInstance1;
14060 type2->refCount = 1;
14061 type2->isSigned = 0x1;
14064 type2 = exp->op.exp2->expType;
14067 if(exp->op.op == SIZEOF)
14069 exp->expType = __extension__ ({
14070 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14072 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14074 exp->isConstant = 0x1;
14076 else if(exp->op.op == '*' && !exp->op.exp1)
14078 exp->expType = Dereference(type2);
14079 if(type2 && type2->kind == 8)
14080 notByReference = 0x1;
14082 else if(exp->op.op == '&' && !exp->op.exp1)
14083 exp->expType = Reference(type2);
14090 if(exp->op.exp1->destType)
14091 FreeType(exp->op.exp1->destType);
14092 exp->op.exp1->destType = MkClassType("bool");
14093 exp->op.exp1->destType->truth = 0x1;
14094 if(!exp->op.exp1->expType)
14095 ProcessExpressionType(exp->op.exp1);
14097 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14098 FreeType(exp->op.exp1->expType);
14099 exp->op.exp1->expType = MkClassType("bool");
14100 exp->op.exp1->expType->truth = 0x1;
14104 if(exp->op.exp2->destType)
14105 FreeType(exp->op.exp2->destType);
14106 exp->op.exp2->destType = MkClassType("bool");
14107 exp->op.exp2->destType->truth = 0x1;
14108 if(!exp->op.exp2->expType)
14109 ProcessExpressionType(exp->op.exp2);
14111 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14112 FreeType(exp->op.exp2->expType);
14113 exp->op.exp2->expType = MkClassType("bool");
14114 exp->op.exp2->expType->truth = 0x1;
14117 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")))))
14119 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14121 if(exp->op.exp2->destType)
14122 FreeType(exp->op.exp2->destType);
14123 exp->op.exp2->destType = type1;
14125 if(exp->op.exp1->destType)
14126 FreeType(exp->op.exp1->destType);
14127 exp->op.exp1->destType = type2;
14129 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)
14130 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);
14131 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14133 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14137 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14139 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14140 ProcessExpressionType(exp->op.exp1);
14141 if(type2->kind != 13)
14143 ProcessExpressionType(classExp);
14144 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"))))))));
14145 if(!exp->op.exp2->expType)
14146 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14147 ProcessExpressionType(exp->op.exp2);
14151 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)))
14153 if(type1->kind != 8 && type1->type->kind == 0)
14154 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14155 exp->expType = type1;
14159 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)))
14161 if(type2->kind != 8 && type2->type->kind == 0)
14162 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14163 exp->expType = type2;
14167 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))
14169 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
14173 unsigned int success = 0x0;
14175 if(type1->kind == 13 && type2->kind == 13)
14177 if(exp->op.op == '+')
14178 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14179 else if(exp->op.op == '-')
14181 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14183 exp->expType = __extension__ ({
14184 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14186 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14189 if(type1->type->kind == 20)
14191 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14195 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14197 ProcessExpressionType(classExp);
14199 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")))))));
14200 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14208 if(!success && exp->op.exp1->type == 2)
14210 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14213 FreeType(exp->expType);
14214 exp->expType = exp->op.exp1->destType;
14215 if(exp->op.exp1->destType)
14216 exp->op.exp1->destType->refCount++;
14219 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14222 FreeType(exp->expType);
14223 exp->expType = exp->op.exp2->destType;
14224 if(exp->op.exp2->destType)
14225 exp->op.exp2->destType->refCount++;
14231 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14234 FreeType(exp->expType);
14235 exp->expType = exp->op.exp2->destType;
14236 if(exp->op.exp2->destType)
14237 exp->op.exp2->destType->refCount++;
14240 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14243 FreeType(exp->expType);
14244 exp->expType = exp->op.exp1->destType;
14245 if(exp->op.exp1->destType)
14246 exp->op.exp1->destType->refCount++;
14252 char expString1[10240];
14253 char expString2[10240];
14257 expString1[0] = '\0';
14258 expString2[0] = '\0';
14263 PrintExpression(exp->op.exp1, expString1);
14264 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14265 PrintExpression(exp->op.exp2, expString2);
14266 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14267 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14268 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14270 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14274 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14276 if(exp->op.exp1->destType)
14277 FreeType(exp->op.exp1->destType);
14278 exp->op.exp1->destType = type2->_class->registered->dataType;
14279 if(type2->_class->registered->dataType)
14280 type2->_class->registered->dataType->refCount++;
14281 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14282 exp->expType = type2;
14286 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14288 if(exp->op.exp2->destType)
14289 FreeType(exp->op.exp2->destType);
14290 exp->op.exp2->destType = type1->_class->registered->dataType;
14291 if(type1->_class->registered->dataType)
14292 type1->_class->registered->dataType->refCount++;
14293 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14294 exp->expType = type1;
14300 unsigned int valid = 0x0;
14302 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14304 if(exp->op.exp2->destType)
14305 FreeType(exp->op.exp2->destType);
14306 if(!type1->_class->registered->dataType)
14307 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14308 exp->op.exp2->destType = type1->_class->registered->dataType;
14309 exp->op.exp2->destType->refCount++;
14310 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14311 type2 = exp->op.exp2->destType;
14312 exp->expType = type2;
14315 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14317 if(exp->op.exp1->destType)
14318 FreeType(exp->op.exp1->destType);
14319 if(!type2->_class->registered->dataType)
14320 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14321 exp->op.exp1->destType = type2->_class->registered->dataType;
14322 exp->op.exp1->destType->refCount++;
14323 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14324 type1 = exp->op.exp1->destType;
14325 exp->expType = type1;
14328 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14330 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14332 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14335 FreeType(exp->expType);
14336 exp->expType = exp->op.exp1->expType;
14337 if(exp->op.exp2->expType)
14338 exp->op.exp1->expType->refCount++;
14342 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14344 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14347 FreeType(exp->expType);
14348 exp->expType = exp->op.exp2->expType;
14349 if(exp->op.exp2->expType)
14350 exp->op.exp2->expType->refCount++;
14357 if(exp->op.exp2->destType)
14358 FreeType(exp->op.exp2->destType);
14359 exp->op.exp2->destType = type1;
14361 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14364 FreeType(exp->expType);
14365 exp->expType = exp->op.exp2->destType;
14366 if(exp->op.exp2->destType)
14367 exp->op.exp2->destType->refCount++;
14369 else if(type1 && type2)
14371 char expString1[10240];
14372 char expString2[10240];
14373 char type1String[1024];
14374 char type2String[1024];
14376 expString1[0] = '\0';
14377 expString2[0] = '\0';
14378 type1String[0] = '\0';
14379 type2String[0] = '\0';
14382 PrintExpression(exp->op.exp1, expString1);
14383 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14384 PrintExpression(exp->op.exp2, expString2);
14385 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14386 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14387 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14389 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14390 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14392 exp->expType = exp->op.exp1->expType;
14393 if(exp->op.exp1->expType)
14394 exp->op.exp1->expType->refCount++;
14396 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14398 exp->expType = exp->op.exp2->expType;
14399 if(exp->op.exp2->expType)
14400 exp->op.exp2->expType->refCount++;
14407 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14409 struct Type * oldType = exp->op.exp1->expType;
14411 exp->op.exp1->expType = (((void *)0));
14412 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14415 exp->op.exp1->expType = oldType;
14417 if(exp->op.exp1->destType)
14418 FreeType(exp->op.exp1->destType);
14419 exp->op.exp1->destType = type2;
14421 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14424 FreeType(exp->expType);
14425 exp->expType = exp->op.exp1->destType;
14426 if(exp->op.exp1->destType)
14427 exp->op.exp1->destType->refCount++;
14431 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14433 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14435 if(exp->op.exp1->destType)
14436 FreeType(exp->op.exp1->destType);
14437 exp->op.exp1->destType = type2->_class->registered->dataType;
14438 if(type2->_class->registered->dataType)
14439 type2->_class->registered->dataType->refCount++;
14440 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14442 if(exp->op.op == '!')
14444 exp->expType = MkClassType("bool");
14445 exp->expType->truth = 0x1;
14449 exp->expType = type2;
14454 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14456 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14458 if(exp->op.exp2->destType)
14459 FreeType(exp->op.exp2->destType);
14460 exp->op.exp2->destType = type1->_class->registered->dataType;
14461 if(type1->_class->registered->dataType)
14462 type1->_class->registered->dataType->refCount++;
14463 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14465 exp->expType = type1;
14471 if(exp->op.exp1 && !exp->op.exp1->expType)
14473 char expString[10000];
14475 expString[0] = '\0';
14478 PrintExpression(exp->op.exp1, expString);
14479 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14482 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14484 if(exp->op.exp2 && !exp->op.exp2->expType)
14486 char expString[10240];
14488 expString[0] = '\0';
14491 PrintExpression(exp->op.exp2, expString);
14492 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14495 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14499 FreeType(exp->expType);
14500 exp->expType = MkClassType("bool");
14501 exp->expType->truth = 0x1;
14503 if(exp->op.op != SIZEOF)
14504 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14505 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14507 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14509 yylloc = oldyylloc;
14516 struct Expression * e;
14518 exp->isConstant = 0x1;
14519 for(e = (*exp->list).first; e; e = e->next)
14521 unsigned int inced = 0x0;
14525 FreeType(e->destType);
14526 e->destType = exp->destType;
14529 exp->destType->refCount++;
14530 e->destType->count++;
14534 ProcessExpressionType(e);
14536 exp->destType->count--;
14537 if(!exp->expType && !e->next)
14539 exp->expType = e->expType;
14541 e->expType->refCount++;
14544 exp->isConstant = 0x0;
14546 e = (*exp->list).first;
14547 if(!e->next && e->type == 8)
14549 struct Expression * next = exp->next, * prev = exp->prev;
14551 FreeType(exp->expType);
14552 FreeType(exp->destType);
14553 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14557 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14558 ProcessExpressionType(exp);
14564 struct Expression * e;
14566 exp->isConstant = 0x1;
14567 ProcessExpressionType(exp->index.exp);
14568 if(!exp->index.exp->isConstant)
14569 exp->isConstant = 0x0;
14570 if(exp->index.exp->expType)
14572 struct Type * source = exp->index.exp->expType;
14574 if(source->kind == 8 && source->_class && source->_class->registered)
14576 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14577 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14579 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14581 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14582 if(exp->index.index && (*exp->index.index).last)
14584 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14589 for(e = (*exp->index.index).first; e; e = e->next)
14591 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14594 FreeType(e->destType);
14595 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14597 ProcessExpressionType(e);
14602 exp->isConstant = 0x0;
14605 exp->expType = Dereference(exp->index.exp->expType);
14607 DeclareType(exp->expType, 0x0, 0x0);
14612 struct Expression * e;
14613 struct Type * functionType;
14614 struct Type * methodType = (((void *)0));
14620 PrintExpression(exp->call.exp, name);
14621 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14623 PrintExpression(exp->call.exp, name);
14626 if(exp->call.exp->type == 0)
14628 struct Expression * idExp = exp->call.exp;
14629 struct Identifier * id = idExp->identifier;
14631 if(!strcmp(id->string, "__builtin_frame_address"))
14633 exp->expType = ProcessTypeString("void *", 0x1);
14634 if(exp->call.arguments && (*exp->call.arguments).first)
14635 ProcessExpressionType((*exp->call.arguments).first);
14638 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14640 exp->expType = ProcessTypeString("int", 0x1);
14641 if(exp->call.arguments && (*exp->call.arguments).first)
14642 ProcessExpressionType((*exp->call.arguments).first);
14645 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14647 struct Expression * a = (((void *)0));
14648 struct Expression * b = (((void *)0));
14649 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14651 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14653 a = (*exp->call.arguments).first;
14654 b = (*exp->call.arguments).last;
14658 else if((*exp->call.arguments).count == 1)
14660 a = (*exp->call.arguments).first;
14665 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14666 idExp->identifier = (((void *)0));
14667 FreeExpContents(exp);
14668 ProcessExpressionType(a);
14670 ProcessExpressionType(b);
14672 exp->list = MkList();
14673 if(a->expType && (!b || b->expType))
14675 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14679 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14680 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14681 struct Declaration * decl;
14682 char temp1[1024], temp2[1024];
14684 GetTypeSpecs(a->expType, specs);
14685 if(a && !a->isConstant && a->type != 0)
14687 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14688 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14689 tempExp1 = QMkExpId(temp1);
14690 tempExp1->expType = a->expType;
14692 a->expType->refCount++;
14693 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14695 if(b && !b->isConstant && b->type != 0)
14697 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14698 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14699 tempExp2 = QMkExpId(temp2);
14700 tempExp2->expType = b->expType;
14702 b->expType->refCount++;
14703 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14705 decl = MkDeclaration(specs, decls);
14706 if(!curCompound->compound.declarations)
14707 curCompound->compound.declarations = MkList();
14708 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14712 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14714 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14716 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14717 exp->expType = a->expType;
14719 a->expType->refCount++;
14721 else if(!strcmp(id->string, "Abs"))
14723 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14724 exp->expType = a->expType;
14726 a->expType->refCount++;
14728 else if(!strcmp(id->string, "Sgn"))
14730 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"))))));
14731 exp->expType = ProcessTypeString("int", 0x0);
14733 FreeExpression(tempExp1);
14735 FreeExpression(tempExp2);
14736 FreeIdentifier(id);
14742 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14744 if(!exp->call.exp->destType)
14746 exp->call.exp->destType = dummy;
14749 ProcessExpressionType(exp->call.exp);
14750 if(exp->call.exp->destType == dummy)
14753 exp->call.exp->destType = (((void *)0));
14757 functionType = exp->call.exp->expType;
14758 if(functionType && functionType->kind == 16)
14760 methodType = functionType;
14761 functionType = methodType->method->dataType;
14762 if(exp->call.exp->expType->usedClass)
14764 char typeString[1024];
14766 typeString[0] = '\0';
14768 struct Symbol * back = functionType->thisClass;
14770 functionType->thisClass = (((void *)0));
14771 PrintType(functionType, typeString, 0x1, 0x1);
14772 functionType->thisClass = back;
14774 if(strstr(typeString, "thisclass"))
14776 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14777 struct Declarator * decl;
14780 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14782 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14783 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14784 thisClassParams = 0x0;
14785 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14787 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14789 thisClass = exp->call.exp->expType->usedClass;
14790 ProcessDeclarator(decl);
14791 thisClass = backupThisClass;
14793 thisClassParams = 0x1;
14794 functionType = ProcessType(specs, decl);
14795 functionType->refCount = 0;
14796 FinishTemplatesContext(context);
14798 FreeList(specs, FreeSpecifier);
14799 FreeDeclarator(decl);
14803 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14805 struct Type * type = functionType->type;
14807 if(!functionType->refCount)
14809 functionType->type = (((void *)0));
14810 FreeType(functionType);
14812 functionType = type;
14814 if(functionType && functionType->kind != 11)
14816 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
14818 else if(functionType)
14820 unsigned int emptyParams = 0x0, noParams = 0x0;
14821 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14822 struct Type * type = functionType->params.first;
14823 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14825 struct Location oldyylloc = yylloc;
14829 if(functionType->extraParam && e && functionType->thisClass)
14831 e->destType = MkClassType(functionType->thisClass->string);
14834 if(!functionType->staticMethod && !functionType->extraParam)
14836 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14838 type = MkClassType(memberExp->member.exp->expType->_class->string);
14841 e->destType = type;
14843 type = functionType->params.first;
14846 type->refCount = 0;
14848 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14850 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14851 type->byReference = functionType->byReference;
14852 type->typedByReference = functionType->typedByReference;
14855 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14857 e->destType = type;
14859 type = functionType->params.first;
14862 type->refCount = 0;
14865 if(type && type->kind == 0)
14868 if(!type->refCount)
14870 type = (((void *)0));
14872 for(; e; e = e->next)
14874 if(!type && !emptyParams)
14877 if(methodType && methodType->methodClass)
14878 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);
14880 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);
14883 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14885 struct Type * templatedType = (((void *)0));
14886 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14887 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14890 if(_class && _class->templateArgs)
14892 struct __ecereNameSpace__ecere__com__Class * sClass;
14894 for(sClass = _class; sClass; sClass = sClass->base)
14896 if(sClass->templateClass)
14897 sClass = sClass->templateClass;
14899 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14901 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14903 struct __ecereNameSpace__ecere__com__Class * nextClass;
14905 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14907 if(nextClass->templateClass)
14908 nextClass = nextClass->templateClass;
14909 id += nextClass->templateParams.count;
14919 if(curParam && _class->templateArgs[id].dataTypeString)
14921 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14924 struct Context * context = SetupTemplatesContext(_class);
14926 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14927 FinishTemplatesContext(context);
14929 e->destType = templatedType;
14932 templatedType->passAsTemplate = 0x1;
14937 e->destType = type;
14944 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14946 e->destType = type->prev;
14947 e->destType->refCount++;
14951 e->destType = type;
14956 if(type && type->kind != 14)
14958 struct Type * next = type->next;
14960 if(!type->refCount)
14965 if(type && type->kind != 14)
14967 if(methodType && methodType->methodClass)
14968 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);
14970 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);
14972 yylloc = oldyylloc;
14973 if(type && !type->refCount)
14978 functionType = __extension__ ({
14979 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14981 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
14983 if(exp->call.exp->type == 0)
14985 char * string = exp->call.exp->identifier->string;
14989 struct Symbol * symbol;
14990 struct Location oldyylloc = yylloc;
14992 yylloc = exp->call.exp->identifier->loc;
14993 if(strstr(string, "__builtin_") == string)
14997 functionType->returnType = exp->destType;
14998 exp->destType->refCount++;
15002 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15003 symbol = __extension__ ({
15004 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15006 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15008 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15009 if(strstr(symbol->string, "::"))
15010 globalContext->hasNameSpace = 0x1;
15011 yylloc = oldyylloc;
15014 else if(exp->call.exp->type == 8)
15018 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
15019 if(!functionType->returnType)
15021 functionType->returnType = __extension__ ({
15022 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15024 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15028 if(functionType && functionType->kind == 11)
15030 exp->expType = functionType->returnType;
15031 if(functionType->returnType)
15032 functionType->returnType->refCount++;
15033 if(!functionType->refCount)
15034 FreeType(functionType);
15036 if(exp->call.arguments)
15038 for(e = (*exp->call.arguments).first; e; e = e->next)
15040 struct Type * destType = e->destType;
15042 ProcessExpressionType(e);
15049 struct Type * type;
15050 struct Location oldyylloc = yylloc;
15051 unsigned int thisPtr;
15052 struct Expression * checkExp = exp->member.exp;
15056 if(checkExp->type == 11)
15057 checkExp = checkExp->cast.exp;
15058 else if(checkExp->type == 5)
15059 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15063 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15064 exp->thisPtr = thisPtr;
15065 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15067 exp->member.member->classSym = exp->member.member->_class->symbol;
15069 ProcessExpressionType(exp->member.exp);
15070 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)
15072 exp->isConstant = 0x0;
15075 exp->isConstant = exp->member.exp->isConstant;
15076 type = exp->member.exp->expType;
15078 if(type && (type->kind == 20))
15080 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15081 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15085 for(param = _class->templateParams.first; param; param = param->next)
15087 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15091 if(param && param->defaultArg.member)
15093 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15097 struct Expression * expMember = exp->member.exp;
15098 struct Declarator * decl;
15099 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15100 char thisClassTypeString[1024];
15102 FreeIdentifier(exp->member.member);
15103 ProcessExpressionType(argExp);
15105 char * colon = strstr(param->defaultArg.memberString, "::");
15109 char className[1024];
15110 struct __ecereNameSpace__ecere__com__Class * sClass;
15112 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15113 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15116 strcpy(thisClassTypeString, _class->fullName);
15118 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15119 exp->expType = ProcessType(specs, decl);
15120 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15122 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15123 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15125 int paramCount = 0;
15126 int lastParam = -1;
15127 char templateString[1024];
15128 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15130 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15131 for(cClass = expClass; cClass; cClass = cClass->base)
15135 for(param = cClass->templateParams.first; param; param = param->next)
15138 struct __ecereNameSpace__ecere__com__Class * sClass;
15139 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15141 for(sClass = cClass->base; sClass; sClass = sClass->base)
15142 id += sClass->templateParams.count;
15143 arg = expClass->templateArgs[id];
15144 for(sClass = _class; sClass; sClass = sClass->base)
15146 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15148 struct __ecereNameSpace__ecere__com__Class * nextClass;
15150 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15151 p += nextClass->templateParams.count;
15152 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15154 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15156 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15158 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15159 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15166 char argument[256];
15168 argument[0] = '\0';
15169 switch(param->type)
15173 char expString[1024];
15174 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15175 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15176 struct Expression * exp;
15177 char * string = PrintHexUInt64(arg.expression.ui64);
15179 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15180 ProcessExpressionType(exp);
15181 ComputeExpression(exp);
15182 expString[0] = '\0';
15183 PrintExpression(exp, expString);
15184 strcat(argument, expString);
15185 FreeExpression(exp);
15190 strcat(argument, arg.member->name);
15195 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15197 if(!strcmp(arg.dataTypeString, "thisclass"))
15198 strcat(argument, thisClassTypeString);
15200 strcat(argument, arg.dataTypeString);
15208 strcat(templateString, ", ");
15209 if(lastParam != p - 1)
15211 strcat(templateString, param->name);
15212 strcat(templateString, " = ");
15214 strcat(templateString, argument);
15223 int len = strlen(templateString);
15225 if(templateString[len - 1] == '>')
15226 templateString[len++] = ' ';
15227 templateString[len++] = '>';
15228 templateString[len++] = '\0';
15231 struct Context * context = SetupTemplatesContext(_class);
15233 FreeType(exp->expType);
15234 exp->expType = ProcessTypeString(templateString, 0x0);
15235 FinishTemplatesContext(context);
15239 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")))))))));
15242 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15244 type = ProcessTemplateParameterType(type->templateParameter);
15247 if(type && (type->kind == 20))
15249 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)))
15251 struct Identifier * id = exp->member.member;
15252 int typeKind = type->kind;
15253 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));
15255 if(typeKind == 19 && exp->member.exp->type == 26)
15257 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15262 if(typeKind == 3 || typeKind == 15)
15263 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15266 if(type->kind == 8 && type->_class && type->_class->registered)
15268 _class = type->_class->registered;
15270 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15272 _class = FindClass("char *")->registered;
15274 else if(type->kind == 13)
15276 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15277 FreeType(exp->expType);
15278 exp->expType = ProcessTypeString("uintptr", 0x0);
15279 exp->byReference = 0x1;
15283 char string[1024] = "";
15284 struct Symbol * classSym;
15286 PrintTypeNoConst(type, string, 0x0, 0x1);
15287 classSym = FindClass(string);
15289 _class = classSym->registered;
15295 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15296 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15297 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15298 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15299 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15301 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15302 exp->member.memberType = 1;
15303 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15304 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15307 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15309 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15310 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15312 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15314 member = (((void *)0));
15316 if(!member && !prop)
15317 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15318 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15319 exp->member.thisPtr = 0x1;
15325 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15326 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15327 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15329 if(!prop && !member)
15331 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15334 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15335 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15336 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15341 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15342 prop = (((void *)0));
15344 member = (((void *)0));
15348 if(!prop && !member && !method)
15349 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15350 if(!prop && !member && !method)
15354 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15357 exp->member.memberType = 5;
15358 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15362 char structName[1024];
15363 struct Identifier * id = exp->member.member;
15364 struct Expression * classExp = exp->member.exp;
15367 FreeType(classExp->expType);
15368 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15369 strcpy(structName, "__ecereClassData_");
15370 FullClassNameCat(structName, type->_class->string, 0x0);
15372 exp->member.member = id;
15373 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"))))))));
15375 ProcessExpressionType(exp);
15381 struct Symbol * classSym = FindClass(id->string);
15385 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15388 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15394 exp->member.memberType = 1;
15395 if(!prop->dataType)
15396 ProcessPropertyType(prop);
15397 exp->expType = prop->dataType;
15399 prop->dataType->refCount++;
15403 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15405 FreeExpContents(exp);
15407 exp->identifier = MkIdentifier("class");
15408 ProcessExpressionType(exp);
15411 exp->member.memberType = 3;
15412 DeclareStruct(_class->fullName, 0x0);
15413 if(!member->dataType)
15415 struct Context * context = SetupTemplatesContext(_class);
15417 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15418 FinishTemplatesContext(context);
15420 exp->expType = member->dataType;
15421 if(member->dataType)
15422 member->dataType->refCount++;
15424 else if(revConvert)
15426 exp->member.memberType = 4;
15427 exp->expType = MkClassType(revConvert->_class->fullName);
15432 exp->member.memberType = 2;
15434 if(!method->dataType)
15435 ProcessMethodType(method);
15436 exp->expType = __extension__ ({
15437 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15439 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15441 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15442 exp->expType->usedClass = _class;
15444 else if(!classProp)
15446 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15448 FreeExpContents(exp);
15450 exp->identifier = MkIdentifier("class");
15451 ProcessExpressionType(exp);
15454 yylloc = exp->member.member->loc;
15455 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15457 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15459 if(_class && exp->expType)
15461 struct __ecereNameSpace__ecere__com__Class * tClass;
15464 while(tClass && !tClass->templateClass)
15465 tClass = tClass->base;
15466 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15469 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15470 struct __ecereNameSpace__ecere__com__Class * sClass;
15472 for(sClass = tClass; sClass; sClass = sClass->base)
15475 if(sClass->templateClass)
15476 sClass = sClass->templateClass;
15477 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15479 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15481 for(sClass = sClass->base; sClass; sClass = sClass->base)
15482 id += sClass->templateParams.count;
15490 if(curParam && tClass->templateArgs[id].dataTypeString)
15492 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15493 struct Context * context = SetupTemplatesContext(tClass);
15495 FreeType(exp->expType);
15496 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15499 if(exp->expType->kind == 21)
15501 FreeType(exp->expType);
15502 exp->expType = ReplaceThisClassType(_class);
15504 if(tClass->templateClass)
15505 exp->expType->passAsTemplate = 0x1;
15508 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15509 if(exp->destType->kind == 21)
15511 FreeType(exp->destType);
15512 exp->destType = ReplaceThisClassType(_class);
15516 FinishTemplatesContext(context);
15519 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15522 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15523 struct __ecereNameSpace__ecere__com__Class * sClass;
15525 for(sClass = tClass; sClass; sClass = sClass->base)
15528 if(sClass->templateClass)
15529 sClass = sClass->templateClass;
15530 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15532 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15534 for(sClass = sClass->base; sClass; sClass = sClass->base)
15535 id += sClass->templateParams.count;
15545 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15546 struct Context * context = SetupTemplatesContext(tClass);
15547 struct Type * basicType;
15549 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15552 if(basicType->kind == 21)
15554 FreeType(basicType);
15555 basicType = ReplaceThisClassType(_class);
15557 FreeType(exp->expType);
15558 exp->expType = __extension__ ({
15559 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15561 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15565 exp->destType = exp->expType;
15566 exp->destType->refCount++;
15569 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15570 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15571 struct Declarator * decl;
15573 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15576 exp->destType->refCount++;
15578 exp->expType->refCount++;
15580 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15581 exp->cast.exp = newExp;
15584 FinishTemplatesContext(context);
15587 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15589 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15593 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15596 int paramCount = 0;
15597 int lastParam = -1;
15598 char templateString[1024];
15599 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15601 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15602 while(cClass != expClass)
15604 struct __ecereNameSpace__ecere__com__Class * sClass;
15606 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15609 for(param = cClass->templateParams.first; param; param = param->next)
15611 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15614 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15615 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15617 while(cClassCur != tClass && !paramCur)
15619 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15621 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15623 cClassCur = sClassCur;
15624 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15626 if(!strcmp(paramCur->name, param->name))
15633 if(paramCur && paramCur->type == 0)
15634 arg = tClass->templateArgs[cp];
15636 arg = expClass->templateArgs[p];
15638 char argument[256];
15640 argument[0] = '\0';
15641 switch(param->type)
15645 char expString[1024];
15646 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15647 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15648 struct Expression * exp;
15649 char * string = PrintHexUInt64(arg.expression.ui64);
15651 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15652 ProcessExpressionType(exp);
15653 ComputeExpression(exp);
15654 expString[0] = '\0';
15655 PrintExpression(exp, expString);
15656 strcat(argument, expString);
15657 FreeExpression(exp);
15662 strcat(argument, arg.member->name);
15667 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15668 strcat(argument, arg.dataTypeString);
15675 strcat(templateString, ", ");
15676 if(lastParam != p - 1)
15678 strcat(templateString, param->name);
15679 strcat(templateString, " = ");
15681 strcat(templateString, argument);
15690 int len = strlen(templateString);
15692 if(templateString[len - 1] == '>')
15693 templateString[len++] = ' ';
15694 templateString[len++] = '>';
15695 templateString[len++] = '\0';
15697 FreeType(exp->expType);
15699 struct Context * context = SetupTemplatesContext(tClass);
15701 exp->expType = ProcessTypeString(templateString, 0x0);
15702 FinishTemplatesContext(context);
15709 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)");
15711 else if(type && (type->kind == 9 || type->kind == 10))
15713 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15717 exp->expType = memberType;
15719 memberType->refCount++;
15724 char expString[10240];
15726 expString[0] = '\0';
15729 PrintExpression(exp, expString);
15730 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15732 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15734 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15736 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15738 struct Identifier * id = exp->member.member;
15739 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));
15743 FreeType(exp->expType);
15744 exp->expType = ReplaceThisClassType(_class);
15748 yylloc = oldyylloc;
15753 struct Type * destType = exp->destType;
15755 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15757 exp->member.member->classSym = exp->member.member->_class->symbol;
15759 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15763 ProcessExpressionType(exp);
15770 struct Symbol * classSym = exp->_class->symbol;
15772 if(classSym && classSym->registered)
15774 if(classSym->registered->type == 5)
15779 DeclareStruct(classSym->string, 0x0);
15780 FreeSpecifier(exp->_class);
15782 FullClassNameCat(name, classSym->string, 0x0);
15783 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15787 if(classSym->registered->fixed)
15789 FreeSpecifier(exp->_class);
15790 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15795 char className[1024];
15797 strcpy(className, "__ecereClass_");
15798 FullClassNameCat(className, classSym->string, 0x1);
15799 MangleClassName(className);
15800 DeclareClass(classSym, className);
15801 FreeExpContents(exp);
15803 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15804 exp->member.member = MkIdentifier("structSize");
15808 exp->expType = __extension__ ({
15809 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15811 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15817 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15819 exp->expType = __extension__ ({
15820 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15822 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15824 exp->isConstant = 0x1;
15825 DeclareType(type, 0x0, 0x0);
15831 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15834 FreeType(exp->cast.exp->destType);
15835 exp->cast.exp->destType = type;
15837 ProcessExpressionType(exp->cast.exp);
15839 exp->expType = type;
15840 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15842 void * prev = exp->prev, * next = exp->next;
15843 struct Type * expType = exp->cast.exp->destType;
15844 struct Expression * castExp = exp->cast.exp;
15845 struct Type * destType = exp->destType;
15848 expType->refCount++;
15849 FreeType(exp->expType);
15850 FreeTypeName(exp->cast.typeName);
15852 FreeType(exp->expType);
15853 FreeType(exp->destType);
15854 exp->expType = expType;
15855 exp->destType = destType;
15856 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15862 exp->isConstant = exp->cast.exp->isConstant;
15868 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15870 exp->expType = type;
15875 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15877 ProcessExpressionType(exp->vaArg.exp);
15878 exp->expType = type;
15883 struct Expression * e;
15885 exp->isConstant = 0x1;
15886 FreeType(exp->cond.cond->destType);
15887 exp->cond.cond->destType = MkClassType("bool");
15888 exp->cond.cond->destType->truth = 0x1;
15889 ProcessExpressionType(exp->cond.cond);
15890 if(!exp->cond.cond->isConstant)
15891 exp->isConstant = 0x0;
15892 for(e = (*exp->cond.exp).first; e; e = e->next)
15896 FreeType(e->destType);
15897 e->destType = exp->destType;
15899 e->destType->refCount++;
15901 ProcessExpressionType(e);
15904 exp->expType = e->expType;
15906 e->expType->refCount++;
15909 exp->isConstant = 0x0;
15911 FreeType(exp->cond.elseExp->destType);
15912 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15913 if(exp->cond.elseExp->destType)
15914 exp->cond.elseExp->destType->refCount++;
15915 ProcessExpressionType(exp->cond.elseExp);
15916 if(!exp->cond.elseExp->isConstant)
15917 exp->isConstant = 0x0;
15922 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15924 struct Statement * last = (*exp->compound->compound.statements).last;
15926 if(last->type == 3 && last->expressions && (*last->expressions).last)
15928 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15930 exp->destType->refCount++;
15932 ProcessStatement(exp->compound);
15933 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15935 exp->expType->refCount++;
15941 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15943 if(spec && spec->type == 1)
15945 exp->expType = MkClassType(spec->name);
15946 exp->expType->kind = 19;
15947 exp->byReference = 0x1;
15951 exp->expType = MkClassType("ecere::com::Class");
15952 exp->byReference = 0x1;
15958 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15962 struct Identifier * id = exp->classData.id;
15963 char structName[1024];
15964 struct Expression * classExp;
15966 strcpy(structName, "__ecereClassData_");
15967 FullClassNameCat(structName, _class->fullName, 0x0);
15969 exp->member.member = id;
15970 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
15971 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
15973 classExp = MkExpIdentifier(MkIdentifier("class"));
15974 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"))))))));
15975 ProcessExpressionType(exp);
15982 struct Type * type = (((void *)0));
15983 char * typeString = (((void *)0));
15984 char typeStringBuf[1024];
15986 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))
15988 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
15990 typeString = templateClass->templateArgs[2].dataTypeString;
15994 struct Expression * e;
15996 for(e = (*exp->list).first; e; e = e->next)
15998 ProcessExpressionType(e);
16008 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16012 e->expType = (((void *)0));
16013 e = (*exp->list).first;
16014 ProcessExpressionType(e);
16017 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16019 FreeType(e->expType);
16020 e->expType = (((void *)0));
16022 type = (((void *)0));
16030 FreeType(e->expType);
16031 e->expType = (((void *)0));
16037 typeStringBuf[0] = '\0';
16038 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16039 typeString = typeStringBuf;
16041 type = (((void *)0));
16046 char templateString[1024];
16047 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16048 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16049 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16050 struct Expression * expExt;
16051 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16053 sprintf(templateString, "Container<%s>", typeString);
16056 struct Expression * e;
16058 type = ProcessTypeString(typeString, 0x0);
16059 while(e = (*exp->list).first)
16061 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16062 e->destType = type;
16064 ProcessExpressionType(e);
16065 ListAdd(initializers, MkInitializerAssignment(e));
16068 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16070 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16071 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16072 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16073 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16074 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16075 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16076 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16077 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16078 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16079 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16080 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16082 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16084 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16085 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16086 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16087 exp->expType = ProcessTypeString(templateString, 0x0);
16089 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16090 ProcessExpressionType(expExt);
16094 exp->expType = ProcessTypeString("Container", 0x0);
16095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
16100 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16102 FreeType(exp->expType);
16103 exp->expType = ReplaceThisClassType(thisClass);
16105 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16107 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16111 if(exp->expType->kind != 15)
16113 struct Type * member;
16114 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16116 FreeType(exp->expType);
16117 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16118 exp->expType->kind = symbol->type->kind;
16119 exp->expType->refCount++;
16120 exp->expType->enumName = enumName;
16121 exp->expType->members = symbol->type->members;
16122 for(member = symbol->type->members.first; member; member = member->next)
16123 member->refCount++;
16127 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16129 for(member = symbol->type->members.first; member; member = member->next)
16131 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16133 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16139 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16141 else if(exp->destType && !exp->destType->keepCast)
16143 if(!CheckExpressionType(exp, exp->destType, 0x0))
16145 if(!exp->destType->count || unresolved)
16150 if(exp->destType->kind != 14)
16157 char expString[10240];
16159 expString[0] = '\0';
16160 PrintType(exp->destType, type2, 0x0, 0x1);
16163 PrintExpression(exp, expString);
16164 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16167 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16168 else if(exp->type != 16)
16169 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16174 char expString[10240];
16176 expString[0] = '\0';
16179 PrintExpression(exp, expString);
16180 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16183 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
16184 else if(exp->type != 16)
16185 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16197 PrintType(exp->expType, type1, 0x0, 0x1);
16198 PrintType(exp->destType, type2, 0x0, 0x1);
16200 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)))
16204 char expString[10240];
16206 expString[0] = '\0';
16209 PrintExpression(exp, expString);
16210 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16212 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16213 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16214 FreeType(exp->expType);
16215 exp->destType->refCount++;
16216 exp->expType = exp->destType;
16221 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16223 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16224 char typeString[1024];
16225 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16226 struct Declarator * decl;
16228 typeString[0] = '\0';
16231 exp->expType->refCount++;
16233 exp->expType->refCount++;
16235 newExp->destType = exp->expType;
16236 PrintType(exp->expType, typeString, 0x0, 0x0);
16237 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16238 exp->cast.typeName = MkTypeName(specs, decl);
16239 exp->cast.exp = newExp;
16242 else if(unresolved)
16244 if(exp->identifier->_class && exp->identifier->_class->name)
16245 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16246 else if(exp->identifier->string && exp->identifier->string[0])
16247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16249 else if(!exp->expType && exp->type != 16)
16251 char expString[10240];
16253 expString[0] = '\0';
16256 PrintExpression(exp, expString);
16257 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16259 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16262 ApplyAnyObjectLogic(exp);
16263 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)))
16265 exp->byReference = 0x1;
16267 yylloc = oldyylloc;
16270 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)
16274 *curMember = (*curMember)->next;
16275 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16277 *curMember = subMemberStack[--(*subMemberStackPos)];
16278 *curMember = (*curMember)->next;
16280 while((*curMember) && (*curMember)->isProperty)
16281 *curMember = (*curMember)->next;
16282 if(subMemberStackPos)
16284 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16286 subMemberStack[(*subMemberStackPos)++] = *curMember;
16287 *curMember = (*curMember)->members.first;
16288 while(*curMember && (*curMember)->isProperty)
16289 *curMember = (*curMember)->next;
16297 if(subMemberStackPos && *subMemberStackPos)
16299 *curMember = subMemberStack[--(*subMemberStackPos)];
16300 *curMember = (*curMember)->next;
16304 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16306 if(*curClass == _class)
16308 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16310 *curMember = (*curClass)->membersAndProperties.first;
16312 while((*curMember) && (*curMember)->isProperty)
16313 *curMember = (*curMember)->next;
16314 if(subMemberStackPos)
16316 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16318 subMemberStack[(*subMemberStackPos)++] = *curMember;
16319 *curMember = (*curMember)->members.first;
16320 while(*curMember && (*curMember)->isProperty)
16321 *curMember = (*curMember)->next;
16328 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16333 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16335 if(init->exp && !init->exp->destType)
16337 FreeType(init->exp->destType);
16338 init->exp->destType = type;
16344 ProcessExpressionType(init->exp);
16345 init->isConstant = init->exp->isConstant;
16351 struct Expression * exp = init->exp;
16352 struct Instantiation * inst = exp->instance;
16353 struct MembersInit * members;
16356 init->list = MkList();
16359 for(members = (*inst->members).first; members; members = members->next)
16361 if(members->type == 0)
16363 struct MemberInit * member;
16365 for(member = (*members->dataMembers).first; member; member = member->next)
16367 ListAdd(init->list, member->initializer);
16368 member->initializer = (((void *)0));
16373 FreeExpression(exp);
16377 struct Initializer * i;
16378 struct Type * initializerType = (((void *)0));
16379 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16380 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16381 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16382 int subMemberStackPos = 0;
16384 if(type && type->kind == 12)
16385 initializerType = Dereference(type);
16386 else if(type && (type->kind == 9 || type->kind == 10))
16387 initializerType = type->members.first;
16388 for(i = (*init->list).first; i; i = i->next)
16390 if(type && type->kind == 8 && type->_class && type->_class->registered)
16392 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16395 if(!curMember->dataType)
16396 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16397 initializerType = curMember->dataType;
16400 ProcessInitializer(i, initializerType);
16401 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16402 initializerType = initializerType->next;
16404 init->isConstant = 0x0;
16406 if(type && type->kind == 12)
16407 FreeType(initializerType);
16408 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16410 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
16417 extern struct Symbol * FindType(struct Context * ctx, char * name);
16419 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16421 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16427 if(spec->specifier == THISCLASS)
16432 spec->name = ReplaceThisClass(thisClass);
16433 spec->symbol = FindClass(spec->name);
16434 ProcessSpecifier(spec, declareStruct);
16441 struct Symbol * symbol = FindType(curContext, spec->name);
16444 DeclareType(symbol->type, 0x1, 0x1);
16445 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16446 DeclareStruct(spec->name, 0x0);
16451 struct Enumerator * e;
16455 for(e = (*spec->list).first; e; e = e->next)
16458 ProcessExpressionType(e->exp);
16466 if(spec->definitions)
16468 struct ClassDef * def;
16469 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16471 ProcessClass(spec->definitions, symbol);
16478 static void ProcessDeclarator(struct Declarator * decl)
16483 if(decl->identifier->classSym)
16485 FreeSpecifier(decl->identifier->_class);
16486 decl->identifier->_class = (((void *)0));
16490 if(decl->array.exp)
16491 ProcessExpressionType(decl->array.exp);
16498 if(decl->declarator)
16499 ProcessDeclarator(decl->declarator);
16500 if(decl->type == 4)
16502 struct Identifier * id = GetDeclId(decl);
16504 if(id && id->_class)
16506 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16508 if(!decl->function.parameters)
16509 decl->function.parameters = MkList();
16510 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16511 id->_class = (((void *)0));
16513 if(decl->function.parameters)
16515 struct TypeName * param;
16517 for(param = (*decl->function.parameters).first; param; param = param->next)
16519 if(param->qualifiers && (*param->qualifiers).first)
16521 struct Specifier * spec = (*param->qualifiers).first;
16523 if(spec && spec->specifier == TYPED_OBJECT)
16525 struct Declarator * d = param->declarator;
16526 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);
16528 FreeList(param->qualifiers, FreeSpecifier);
16529 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16530 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16534 else if(spec && spec->specifier == ANY_OBJECT)
16536 struct Declarator * d = param->declarator;
16538 FreeList(param->qualifiers, FreeSpecifier);
16539 param->qualifiers = MkListOne(MkSpecifier(VOID));
16540 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16542 else if(spec->specifier == THISCLASS)
16547 spec->name = ReplaceThisClass(thisClass);
16548 spec->symbol = FindClass(spec->name);
16549 ProcessSpecifier(spec, 0x0);
16553 if(param->declarator)
16554 ProcessDeclarator(param->declarator);
16562 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16564 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16566 static void ProcessDeclaration(struct Declaration * decl)
16568 yylloc = decl->loc;
16573 unsigned int declareStruct = 0x0;
16575 if(decl->declarators)
16577 struct InitDeclarator * d;
16579 for(d = (*decl->declarators).first; d; d = d->next)
16581 struct Type * type, * subType;
16583 ProcessDeclarator(d->declarator);
16584 type = ProcessType(decl->specifiers, d->declarator);
16587 ProcessInitializer(d->initializer, type);
16588 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16590 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16592 struct Instantiation * inst = d->initializer->exp->instance;
16594 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16595 d->initializer->exp->instance = (((void *)0));
16596 if(decl->specifiers)
16597 FreeList(decl->specifiers, FreeSpecifier);
16598 FreeList(decl->declarators, FreeInitDeclarator);
16605 for(subType = type; subType; )
16607 if(subType->kind == 8)
16609 declareStruct = 0x1;
16612 else if(subType->kind == 13)
16614 else if(subType->kind == 12)
16615 subType = subType->arrayType;
16624 if(decl->specifiers)
16626 struct Specifier * s;
16628 for(s = (*decl->specifiers).first; s; s = s->next)
16630 ProcessSpecifier(s, declareStruct);
16637 ProcessInstantiationType(decl->inst);
16642 struct Specifier * spec;
16643 struct Declarator * d;
16644 unsigned int declareStruct = 0x0;
16646 if(decl->declarators)
16648 for(d = (*decl->declarators).first; d; d = d->next)
16650 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16651 struct Type * subType;
16653 ProcessDeclarator(d);
16654 for(subType = type; subType; )
16656 if(subType->kind == 8)
16658 declareStruct = 0x1;
16661 else if(subType->kind == 13)
16663 else if(subType->kind == 12)
16664 subType = subType->arrayType;
16671 if(decl->specifiers)
16673 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16674 ProcessSpecifier(spec, declareStruct);
16681 static struct FunctionDefinition * curFunction;
16683 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16685 char propName[1024], propNameM[1024];
16686 char getName[1024], setName[1024];
16687 struct __ecereNameSpace__ecere__sys__OldList * args;
16689 DeclareProperty(prop, setName, getName);
16690 strcpy(propName, "__ecereProp_");
16691 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16692 strcat(propName, "_");
16693 FullClassNameCat(propName, prop->name, 0x1);
16694 MangleClassName(propName);
16695 strcpy(propNameM, "__ecerePropM_");
16696 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16697 strcat(propNameM, "_");
16698 FullClassNameCat(propNameM, prop->name, 0x1);
16699 MangleClassName(propNameM);
16700 if(prop->isWatchable)
16703 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16704 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16705 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16707 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16708 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16709 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16713 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16714 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16715 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16717 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16718 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16719 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16721 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16722 curFunction->propSet->fireWatchersDone = 0x1;
16725 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16727 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16729 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16731 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16733 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16735 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16737 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16739 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16741 static void ProcessStatement(struct Statement * stmt)
16743 yylloc = stmt->loc;
16747 ProcessStatement(stmt->labeled.stmt);
16750 if(stmt->caseStmt.exp)
16752 FreeType(stmt->caseStmt.exp->destType);
16753 stmt->caseStmt.exp->destType = curSwitchType;
16755 curSwitchType->refCount++;
16756 ProcessExpressionType(stmt->caseStmt.exp);
16757 ComputeExpression(stmt->caseStmt.exp);
16759 if(stmt->caseStmt.stmt)
16760 ProcessStatement(stmt->caseStmt.stmt);
16764 if(stmt->compound.context)
16766 struct Declaration * decl;
16767 struct Statement * s;
16768 struct Statement * prevCompound = curCompound;
16769 struct Context * prevContext = curContext;
16771 if(!stmt->compound.isSwitch)
16773 curCompound = stmt;
16774 curContext = stmt->compound.context;
16776 if(stmt->compound.declarations)
16778 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16779 ProcessDeclaration(decl);
16781 if(stmt->compound.statements)
16783 for(s = (*stmt->compound.statements).first; s; s = s->next)
16784 ProcessStatement(s);
16786 curContext = prevContext;
16787 curCompound = prevCompound;
16793 struct Expression * exp;
16795 if(stmt->expressions)
16797 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16798 ProcessExpressionType(exp);
16804 struct Expression * exp;
16806 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16807 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16808 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16809 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16811 ProcessExpressionType(exp);
16813 if(stmt->ifStmt.stmt)
16814 ProcessStatement(stmt->ifStmt.stmt);
16815 if(stmt->ifStmt.elseStmt)
16816 ProcessStatement(stmt->ifStmt.elseStmt);
16821 struct Type * oldSwitchType = curSwitchType;
16823 if(stmt->switchStmt.exp)
16825 struct Expression * exp;
16827 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16831 ProcessExpressionType(exp);
16834 curSwitchType = exp->expType;
16837 ProcessStatement(stmt->switchStmt.stmt);
16838 curSwitchType = oldSwitchType;
16843 if(stmt->whileStmt.exp)
16845 struct Expression * exp;
16847 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16848 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16849 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16850 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16852 ProcessExpressionType(exp);
16855 if(stmt->whileStmt.stmt)
16856 ProcessStatement(stmt->whileStmt.stmt);
16861 if(stmt->doWhile.exp)
16863 struct Expression * exp;
16865 if((*stmt->doWhile.exp).last)
16867 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16868 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16869 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16871 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16873 ProcessExpressionType(exp);
16876 if(stmt->doWhile.stmt)
16877 ProcessStatement(stmt->doWhile.stmt);
16882 struct Expression * exp;
16884 if(stmt->forStmt.init)
16885 ProcessStatement(stmt->forStmt.init);
16886 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16888 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16889 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16890 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16892 if(stmt->forStmt.check)
16893 ProcessStatement(stmt->forStmt.check);
16894 if(stmt->forStmt.increment)
16896 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16897 ProcessExpressionType(exp);
16899 if(stmt->forStmt.stmt)
16900 ProcessStatement(stmt->forStmt.stmt);
16905 struct Identifier * id = stmt->forEachStmt.id;
16906 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16907 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16908 struct Statement * block = stmt->forEachStmt.stmt;
16909 char iteratorType[1024];
16910 struct Type * source;
16911 struct Expression * e;
16912 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));
16913 struct Expression * arrayExp;
16914 char * typeString = (((void *)0));
16915 int builtinCount = 0;
16917 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16921 FreeType(e->destType);
16922 e->destType = ProcessTypeString("Container", 0x0);
16924 if(!isBuiltin || e->next)
16925 ProcessExpressionType(e);
16927 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16928 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16930 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16931 struct Symbol * symbol;
16932 struct Expression * expIt = (((void *)0));
16933 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16934 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16935 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16936 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16939 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16940 stmt->compound.context->parent = curContext;
16941 curContext = stmt->compound.context;
16942 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16944 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16945 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16947 isCustomAVLTree = 0x1;
16948 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16950 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16953 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16955 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16957 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16960 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16964 struct Declarator * decl;
16965 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16967 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
16968 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16969 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
16973 struct Type * type = (((void *)0));
16974 char typeStringBuf[1024];
16976 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
16977 if(((struct Expression *)(*exp).last)->type == 11)
16979 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
16982 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
16984 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)
16986 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
16988 typeString = templateClass->templateArgs[2].dataTypeString;
16990 else if(arrayExp->list)
16992 struct Expression * e;
16994 for(e = (*arrayExp->list).first; e; e = e->next)
16996 ProcessExpressionType(e);
17006 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17010 e->expType = (((void *)0));
17011 e = (*arrayExp->list).first;
17012 ProcessExpressionType(e);
17015 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17017 FreeType(e->expType);
17018 e->expType = (((void *)0));
17020 type = (((void *)0));
17028 FreeType(e->expType);
17029 e->expType = (((void *)0));
17035 typeStringBuf[0] = '\0';
17036 PrintType(type, typeStringBuf, 0x0, 0x1);
17037 typeString = typeStringBuf;
17043 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17044 struct Declarator * decl;
17045 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17049 struct Expression * e;
17051 builtinCount = (*arrayExp->list).count;
17052 type = ProcessTypeString(typeString, 0x0);
17053 while(e = (*arrayExp->list).first)
17055 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17056 e->destType = type;
17058 ProcessExpressionType(e);
17059 ListAdd(initializers, MkInitializerAssignment(e));
17062 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17064 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17065 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17066 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17067 FreeList(exp, FreeExpression);
17071 arrayExp->expType = ProcessTypeString("Container", 0x0);
17072 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
17075 else if(isLinkList && !isList)
17077 struct Declarator * decl;
17078 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17080 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17081 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17082 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17084 else if(_class->templateArgs)
17087 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17089 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17090 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17092 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17095 switch(block->type)
17098 if(block->compound.context)
17099 block->compound.context->parent = stmt->compound.context;
17102 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17103 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17104 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17105 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17108 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17109 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17112 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17113 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17116 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17117 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17120 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17121 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17124 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17125 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17131 block = MkIfStmt(filter, block, (((void *)0)));
17135 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));
17136 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17137 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17138 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17144 sprintf(count, "%d", builtinCount);
17145 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));
17146 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17147 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17148 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17150 else if(isLinkList && !isList)
17152 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17153 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17155 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17157 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));
17161 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17162 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17164 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));
17166 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17167 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17168 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17172 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17174 ProcessExpressionType(expIt);
17175 if((*stmt->compound.declarations).first)
17176 ProcessDeclaration((*stmt->compound.declarations).first);
17178 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17179 ProcessStatement(stmt);
17180 curContext = stmt->compound.context->parent;
17185 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
17197 struct Expression * exp;
17199 if(stmt->expressions)
17201 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17205 if(curFunction && !curFunction->type)
17206 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17207 FreeType(exp->destType);
17208 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17210 exp->destType->refCount++;
17212 ProcessExpressionType(exp);
17219 ProcessDeclaration(stmt->decl);
17224 struct AsmField * field;
17226 if(stmt->asmStmt.inputFields)
17228 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17229 if(field->expression)
17230 ProcessExpressionType(field->expression);
17232 if(stmt->asmStmt.outputFields)
17234 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17235 if(field->expression)
17236 ProcessExpressionType(field->expression);
17238 if(stmt->asmStmt.clobberedFields)
17240 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17242 if(field->expression)
17243 ProcessExpressionType(field->expression);
17250 struct PropertyWatch * propWatch;
17251 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17252 struct Expression * object = stmt->_watch.object;
17253 struct Expression * watcher = stmt->_watch.watcher;
17256 ProcessExpressionType(watcher);
17258 ProcessExpressionType(object);
17261 if(watcher || thisClass)
17263 struct External * external = curExternal;
17264 struct Context * context = curContext;
17267 stmt->expressions = MkList();
17268 curExternal = external->prev;
17269 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17271 struct ClassFunction * func;
17272 char watcherName[1024];
17273 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17274 struct External * createdExternal;
17275 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17278 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17279 if(propWatch->deleteWatch)
17280 strcat(watcherName, "_delete");
17283 struct Identifier * propID;
17285 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17287 strcat(watcherName, "_");
17288 strcat(watcherName, propID->string);
17291 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17293 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17294 ProcessClassFunctionBody(func, propWatch->compound);
17295 propWatch->compound = (((void *)0));
17296 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17297 createdExternal->symbol->idCode = external->symbol->idCode;
17298 curExternal = createdExternal;
17299 ProcessFunction(createdExternal->function);
17301 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17303 externalDecl->declaration = decl;
17304 if(decl->symbol && !decl->symbol->pointerExternal)
17305 decl->symbol->pointerExternal = externalDecl;
17307 if(propWatch->deleteWatch)
17309 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17311 ListAdd(args, CopyExpression(object));
17312 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17313 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17314 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17318 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17319 struct Identifier * propID;
17321 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17323 char propName[1024];
17324 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17328 char getName[1024], setName[1024];
17329 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17331 DeclareProperty(prop, setName, getName);
17332 strcpy(propName, "__ecereProp_");
17333 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17334 strcat(propName, "_");
17335 FullClassNameCat(propName, prop->name, 0x1);
17336 ListAdd(args, CopyExpression(object));
17337 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17338 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17339 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17340 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17343 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17348 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
17350 curExternal = external;
17351 curContext = context;
17353 FreeExpression(watcher);
17355 FreeExpression(object);
17356 FreeList(watches, FreePropertyWatch);
17359 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
17363 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17365 ProcessStatement(propWatch->compound);
17372 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17373 struct Expression * object = stmt->_watch.object;
17374 struct __ecereNameSpace__ecere__com__Class * _class;
17377 ProcessExpressionType(object);
17380 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17383 struct Identifier * propID;
17386 stmt->expressions = MkList();
17387 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17389 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17396 for(propID = (*watches).first; propID; propID = propID->next)
17398 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17402 CreateFireWatcher(prop, object, stmt);
17405 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17410 struct __ecereNameSpace__ecere__com__Property * prop;
17411 struct __ecereNameSpace__ecere__com__Class * base;
17413 for(base = _class; base; base = base->base)
17415 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17417 if(prop->isProperty && prop->isWatchable)
17419 CreateFireWatcher(prop, object, stmt);
17425 FreeExpression(object);
17426 FreeList(watches, FreeIdentifier);
17429 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17435 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17436 struct Expression * object = stmt->_watch.object;
17437 struct Expression * watcher = stmt->_watch.watcher;
17438 struct __ecereNameSpace__ecere__com__Class * _class;
17441 ProcessExpressionType(object);
17443 ProcessExpressionType(watcher);
17446 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17447 if(watcher || thisClass)
17451 struct Identifier * propID;
17454 stmt->expressions = MkList();
17457 struct __ecereNameSpace__ecere__sys__OldList * args;
17460 ListAdd(args, CopyExpression(object));
17461 ListAdd(args, MkExpConstant("0"));
17462 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17463 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17467 for(propID = (*watches).first; propID; propID = propID->next)
17469 char propName[1024];
17470 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17474 char getName[1024], setName[1024];
17475 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17477 DeclareProperty(prop, setName, getName);
17478 strcpy(propName, "__ecereProp_");
17479 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17480 strcat(propName, "_");
17481 FullClassNameCat(propName, prop->name, 0x1);
17482 MangleClassName(propName);
17483 ListAdd(args, CopyExpression(object));
17484 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17485 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17486 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17489 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17493 FreeExpression(object);
17495 FreeExpression(watcher);
17496 FreeList(watches, FreeIdentifier);
17499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17502 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
17509 extern struct Expression * QBrackets(struct Expression * exp);
17511 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17513 extern struct Declarator * QMkPtrDecl(char * id);
17515 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17517 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17519 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17521 static void ProcessFunction(struct FunctionDefinition * function)
17523 struct Identifier * id = GetDeclId(function->declarator);
17524 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17525 struct Type * type = symbol ? symbol->type : (((void *)0));
17526 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17527 struct Context * oldTopContext = topContext;
17529 yylloc = function->loc;
17530 if(type && type->thisClass)
17532 struct Symbol * classSym = type->thisClass;
17533 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17534 char className[1024];
17535 char structName[1024];
17536 struct Declarator * funcDecl;
17537 struct Symbol * thisSymbol;
17538 unsigned int typedObject = 0x0;
17540 if(_class && !_class->base)
17542 _class = currentClass;
17543 if(_class && !_class->symbol)
17544 _class->symbol = FindClass(_class->fullName);
17545 classSym = _class ? _class->symbol : (((void *)0));
17548 thisClass = _class;
17549 if(inCompiler && _class)
17551 if(type->kind == 11)
17553 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17555 struct Type * param = symbol->type->params.first;
17557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17560 if(type->classObjectType != 1)
17562 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17563 symbol->type->staticMethod = 0x1;
17564 symbol->type->thisClass = (((void *)0));
17565 symbol->type->extraParam = 0x0;
17568 strcpy(className, "__ecereClass_");
17569 FullClassNameCat(className, _class->fullName, 0x1);
17570 MangleClassName(className);
17571 structName[0] = (char)0;
17572 FullClassNameCat(structName, _class->fullName, 0x0);
17573 funcDecl = GetFuncDecl(function->declarator);
17576 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17578 struct TypeName * param = (*funcDecl->function.parameters).first;
17580 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17583 FreeTypeName(param);
17586 if(!function->propertyNoThis)
17588 struct TypeName * thisParam;
17590 if(type->classObjectType != 1)
17592 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17593 if(!funcDecl->function.parameters)
17594 funcDecl->function.parameters = MkList();
17595 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17599 if(type->classObjectType != 1)
17601 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17602 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17604 thisParam = __extension__ ({
17605 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17607 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17609 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17613 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17615 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17617 funcDecl = GetFuncDecl(initDecl->declarator);
17620 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17622 struct TypeName * param = (*funcDecl->function.parameters).first;
17624 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17626 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17627 FreeTypeName(param);
17630 if(type->classObjectType != 1)
17632 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17634 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17636 if(!funcDecl->function.parameters)
17637 funcDecl->function.parameters = MkList();
17638 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17646 if(type->classObjectType != 1)
17648 thisSymbol = __extension__ ({
17649 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17651 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17653 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17654 if(typedObject && thisSymbol->type)
17656 thisSymbol->type->classObjectType = 2;
17657 thisSymbol->type->byReference = type->byReference;
17658 thisSymbol->type->typedByReference = type->byReference;
17662 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17664 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17667 struct __ecereNameSpace__ecere__com__Class * base;
17669 for(base = _class; base && base->type != 1000; base = base->next)
17671 for(member = base->membersAndProperties.first; member; member = member->next)
17672 if(!member->isProperty)
17678 for(member = _class->membersAndProperties.first; member; member = member->next)
17679 if(!member->isProperty)
17683 char pointerName[1024];
17684 struct Declaration * decl;
17685 struct Initializer * initializer;
17686 struct Expression * exp, * bytePtr;
17688 strcpy(pointerName, "__ecerePointer_");
17689 FullClassNameCat(pointerName, _class->fullName, 0x0);
17691 char className[1024];
17693 strcpy(className, "__ecereClass_");
17694 FullClassNameCat(className, classSym->string, 0x1);
17695 MangleClassName(className);
17696 DeclareClass(classSym, className);
17698 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17703 sprintf(string, "%d", _class->offset);
17704 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17708 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17710 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17711 exp->expType = __extension__ ({
17712 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17714 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17715 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17717 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17718 }), __ecereInstance2;
17722 yylloc = function->body->loc;
17723 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17725 struct Context * prevContext = curContext;
17727 curContext = function->body->compound.context;
17728 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17729 curContext = prevContext;
17731 decl->symbol = (((void *)0));
17732 if(!function->body->compound.declarations)
17733 function->body->compound.declarations = MkList();
17734 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17740 thisClass = (((void *)0));
17743 FreeSpecifier(id->_class);
17744 id->_class = (((void *)0));
17745 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17747 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17749 id = GetDeclId(initDecl->declarator);
17750 FreeSpecifier(id->_class);
17751 id->_class = (((void *)0));
17755 topContext = function->body->compound.context;
17757 struct FunctionDefinition * oldFunction = curFunction;
17759 curFunction = function;
17761 ProcessStatement(function->body);
17762 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17764 struct Statement * prevCompound = curCompound;
17765 struct Context * prevContext = curContext;
17766 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17768 if(!function->body->compound.statements)
17769 function->body->compound.statements = MkList();
17770 ListAdd(function->body->compound.statements, fireWatchers);
17771 curCompound = function->body;
17772 curContext = function->body->compound.context;
17773 ProcessStatement(fireWatchers);
17774 curContext = prevContext;
17775 curCompound = prevCompound;
17777 curFunction = oldFunction;
17779 if(function->declarator)
17781 ProcessDeclarator(function->declarator);
17783 topContext = oldTopContext;
17784 thisClass = oldThisClass;
17787 extern void FreeSymbol(struct Symbol * symbol);
17789 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17791 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17793 struct ClassDef * def;
17794 struct External * external = curExternal;
17795 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17797 for(def = definitions->first; def; def = def->next)
17801 if(def->function->declarator)
17802 curExternal = def->function->declarator->symbol->pointerExternal;
17804 curExternal = external;
17805 ProcessFunction((struct FunctionDefinition *)def->function);
17807 else if(def->type == 2)
17809 if(def->decl->type == 2)
17811 thisClass = regClass;
17812 ProcessInstantiationType(def->decl->inst);
17813 thisClass = (((void *)0));
17817 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17820 thisClass = regClass;
17821 ProcessDeclaration(def->decl);
17822 thisClass = backThisClass;
17825 else if(def->type == 1 && def->defProperties)
17827 struct MemberInit * defProperty;
17828 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);
17830 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17831 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17833 thisClass = regClass;
17834 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17835 thisClass = (((void *)0));
17837 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17838 FreeSymbol(thisSymbol);
17840 else if(def->type == 3 && def->propertyDef)
17842 struct PropertyDef * prop = def->propertyDef;
17844 thisClass = regClass;
17849 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17851 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17853 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17854 ProcessStatement(prop->setStmt);
17860 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17862 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17864 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17865 ProcessStatement(prop->getStmt);
17867 if(prop->issetStmt)
17871 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17873 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17875 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17876 ProcessStatement(prop->issetStmt);
17878 thisClass = (((void *)0));
17880 else if(def->type == 4 && def->propertyWatch)
17882 struct PropertyWatch * propertyWatch = def->propertyWatch;
17884 thisClass = regClass;
17885 if(propertyWatch->compound)
17887 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);
17889 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17890 curExternal = (((void *)0));
17891 ProcessStatement(propertyWatch->compound);
17893 thisClass = (((void *)0));
17898 void DeclareFunctionUtil(char * s)
17900 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17907 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17908 strcpy(name, "__ecereFunction_");
17909 FullClassNameCat(name, s, 0x0);
17910 DeclareFunction(function, name);
17914 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17916 void ComputeDataTypes()
17918 struct External * external;
17919 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17920 struct External * after = (((void *)0));
17922 currentClass = (((void *)0));
17923 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17924 for(external = (*ast).first; external; external = external->next)
17926 if(external->type == 1)
17928 struct Declaration * decl = external->declaration;
17932 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17936 struct InitDeclarator * initDecl = (*decls).first;
17940 struct Declarator * declarator = initDecl->declarator;
17942 if(declarator && declarator->type == 1)
17944 struct Identifier * id = declarator->identifier;
17946 if(id && id->string)
17948 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17950 external->symbol->id = -1001, external->symbol->idCode = -1001;
17960 temp->symbol = __extension__ ({
17961 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17963 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17965 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
17966 curExternal = temp;
17967 DeclareFunctionUtil("eSystem_New");
17968 DeclareFunctionUtil("eSystem_New0");
17969 DeclareFunctionUtil("eSystem_Renew");
17970 DeclareFunctionUtil("eSystem_Renew0");
17971 DeclareFunctionUtil("eClass_GetProperty");
17972 DeclareStruct("ecere::com::Class", 0x0);
17973 DeclareStruct("ecere::com::Instance", 0x0);
17974 DeclareStruct("ecere::com::Property", 0x0);
17975 DeclareStruct("ecere::com::DataMember", 0x0);
17976 DeclareStruct("ecere::com::Method", 0x0);
17977 DeclareStruct("ecere::com::SerialBuffer", 0x0);
17978 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
17979 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
17980 for(external = (*ast).first; external; external = external->next)
17982 afterExternal = curExternal = external;
17983 if(external->type == 0)
17985 currentClass = external->function->_class;
17986 ProcessFunction(external->function);
17988 else if(external->type == 1)
17990 currentClass = (((void *)0));
17991 ProcessDeclaration(external->declaration);
17993 else if(external->type == 2)
17995 struct ClassDefinition * _class = external->_class;
17997 currentClass = external->symbol->registered;
17998 if(_class->definitions)
18000 ProcessClass(_class->definitions, _class->symbol);
18004 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18005 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18008 else if(external->type == 4)
18010 thisNameSpace = external->id->string;
18013 currentClass = (((void *)0));
18014 thisNameSpace = (((void *)0));
18015 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18016 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18019 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);
18021 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);
18023 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18025 struct __ecereNameSpace__ecere__com__Class * class;
18027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18061 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18062 __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);
18063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18065 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18066 __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);
18067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18078 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18079 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18080 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18081 __ecereClass_Conversion = class;
18082 __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);
18083 __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);
18084 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18085 __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);
18086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18103 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18106 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)