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, THREAD = 372
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 struct Identifier * symbolic;
1033 } __attribute__ ((gcc_struct));
1035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1039 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1041 struct ClassFunction
1043 struct ClassFunction * prev;
1044 struct ClassFunction * next;
1045 struct Location loc;
1046 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1047 struct Declarator * declarator;
1048 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1049 struct Statement * body;
1050 struct __ecereNameSpace__ecere__com__Class * _class;
1051 struct __ecereNameSpace__ecere__sys__OldList attached;
1054 struct Symbol * propSet;
1055 unsigned int isVirtual;
1056 unsigned int isConstructor;
1057 unsigned int isDestructor;
1058 unsigned int dontMangle;
1061 } __attribute__ ((gcc_struct));
1063 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1067 struct MembersInit * prev;
1068 struct MembersInit * next;
1069 struct Location loc;
1073 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1074 struct ClassFunction * function;
1075 } __attribute__ ((gcc_struct));
1076 } __attribute__ ((gcc_struct));
1078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1082 struct MemberInit * prev;
1083 struct MemberInit * next;
1084 struct Location loc;
1085 struct Location realLoc;
1086 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1087 struct Initializer * initializer;
1089 unsigned int variable;
1090 unsigned int takeOutExp;
1091 } __attribute__ ((gcc_struct));
1093 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1097 struct PropertyDef * prev;
1098 struct PropertyDef * next;
1099 struct Location loc;
1100 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1101 struct Declarator * declarator;
1102 struct Identifier * id;
1103 struct Statement * getStmt;
1104 struct Statement * setStmt;
1105 struct Statement * issetStmt;
1106 struct Symbol * symbol;
1107 unsigned int conversion;
1108 unsigned int isWatchable;
1109 struct Expression * category;
1110 } __attribute__ ((gcc_struct));
1112 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1114 struct PropertyWatch
1116 struct PropertyWatch * prev;
1117 struct PropertyWatch * next;
1118 struct Location loc;
1119 struct Statement * compound;
1120 struct __ecereNameSpace__ecere__sys__OldList * properties;
1121 unsigned int deleteWatch;
1122 } __attribute__ ((gcc_struct));
1124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1128 struct ClassDef * prev;
1129 struct ClassDef * next;
1130 struct Location loc;
1134 struct Declaration * decl;
1135 struct ClassFunction * function;
1136 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1137 struct PropertyDef * propertyDef;
1138 struct PropertyWatch * propertyWatch;
1140 struct Identifier * defaultProperty;
1143 struct Identifier * id;
1144 struct Initializer * initializer;
1145 } __attribute__ ((gcc_struct));
1146 } __attribute__ ((gcc_struct));
1149 } __attribute__ ((gcc_struct));
1151 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1153 struct DBTableEntry;
1155 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1159 extern YYSTYPE yylval;
1161 extern struct Location yylloc;
1163 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1165 extern int returnCode;
1167 extern struct Expression * parsedExpression;
1169 extern unsigned int yydebug;
1171 void SetYydebug(unsigned int b)
1176 extern unsigned int echoOn;
1178 void resetScanner();
1182 int expression_yyparse();
1184 static struct Statement * curCompound;
1186 struct External * curExternal, * afterExternal;
1188 static struct Type * curSwitchType;
1190 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1192 struct __ecereNameSpace__ecere__com__Class * thisClass;
1194 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1199 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1204 static char * thisNameSpace;
1206 struct __ecereNameSpace__ecere__com__Class * containerClass;
1208 unsigned int thisClassParams = 0x1;
1210 unsigned int internalValueCounter;
1212 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1214 extern size_t strlen(const char * );
1216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1218 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1220 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1222 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1224 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1226 void PrintExpression(struct Expression * exp, char * string)
1229 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1233 OutputExpression(exp, f);
1234 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
1235 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1237 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1238 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1239 count = strlen(string);
1240 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
1241 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = f;
1243 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
1244 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1245 string[count] = '\0';
1246 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1250 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1252 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1254 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1256 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1258 if(!param->baseType)
1260 if(param->dataTypeString)
1261 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1263 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1265 return param->baseType;
1267 return (((void *)0));
1270 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1272 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1274 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1278 if(type1->kind == type2->kind)
1289 if(type1->passAsTemplate && !type2->passAsTemplate)
1291 return type1->isSigned != type2->isSigned;
1293 return type1->_class != type2->_class;
1295 return NeedCast(type1->type, type2->type);
1303 extern int strcmp(const char * , const char * );
1305 extern struct Context * curContext;
1307 extern struct Context * topContext;
1309 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1311 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);
1313 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1315 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);
1317 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);
1319 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1321 struct __ecereNameSpace__ecere__com__ClassProperty
1324 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1325 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1326 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1328 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1329 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1330 char * dataTypeString;
1331 struct Type * dataType;
1332 unsigned int constant;
1333 } __attribute__ ((gcc_struct));
1335 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1337 extern struct Expression * QMkExpId(char * id);
1339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1341 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1343 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1344 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1349 char * dataTypeString;
1351 } __attribute__ ((gcc_struct));
1352 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1354 } __attribute__ ((gcc_struct));
1356 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1358 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1360 extern void FreeIdentifier(struct Identifier * id);
1362 void ProcessExpressionType(struct Expression * exp);
1364 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1366 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1368 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1370 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1372 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1374 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1376 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1378 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1380 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1382 if(exp->type == 0 && exp->identifier)
1384 struct Identifier * id = exp->identifier;
1385 struct Context * ctx;
1386 struct Symbol * symbol = (((void *)0));
1388 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1390 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1392 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1397 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1399 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1400 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1401 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1402 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1406 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1408 if(!prop && !method)
1409 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1410 if(!prop && !method && !member)
1412 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1414 if(prop || method || member || classProp)
1417 exp->member.member = id;
1418 exp->member.memberType = 0;
1419 exp->member.exp = QMkExpId("this");
1420 exp->addedThis = 0x1;
1422 else if(_class && _class->templateParams.first)
1424 struct __ecereNameSpace__ecere__com__Class * sClass;
1426 for(sClass = _class; sClass; sClass = sClass->base)
1428 if(sClass->templateParams.first)
1430 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1432 for(param = sClass->templateParams.first; param; param = param->next)
1434 if(param->type == 2 && !strcmp(param->name, id->string))
1436 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1440 struct Declarator * decl;
1441 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1443 FreeIdentifier(exp->member.member);
1444 ProcessExpressionType(argExp);
1445 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1446 exp->expType = ProcessType(specs, decl);
1448 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1459 extern int sprintf(char * , char * , ...);
1461 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1463 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1465 char * PrintInt(long long result)
1469 if(result > (((long long)0x7fffffffffffffffLL)))
1470 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1472 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1473 return __ecereNameSpace__ecere__sys__CopyString(temp);
1476 char * PrintUInt(uint64 result)
1480 if(result > (0xffffffff))
1481 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1482 else if(result > (((int)0x7fffffff)))
1483 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1485 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1486 return __ecereNameSpace__ecere__sys__CopyString(temp);
1489 char * PrintInt64(long long result)
1493 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1494 return __ecereNameSpace__ecere__sys__CopyString(temp);
1497 char * PrintUInt64(uint64 result)
1501 if(result > (((long long)0x7fffffffffffffffLL)))
1502 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1504 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1505 return __ecereNameSpace__ecere__sys__CopyString(temp);
1508 char * PrintHexUInt(uint64 result)
1512 if(result > (0xffffffff))
1513 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1515 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1516 return __ecereNameSpace__ecere__sys__CopyString(temp);
1519 char * PrintHexUInt64(uint64 result)
1523 if(result > (0xffffffff))
1524 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1526 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1527 return __ecereNameSpace__ecere__sys__CopyString(temp);
1530 char * PrintShort(short result)
1534 sprintf(temp, "%d", (unsigned short)result);
1535 return __ecereNameSpace__ecere__sys__CopyString(temp);
1538 char * PrintUShort(unsigned short result)
1542 if(result > (unsigned short)32767)
1543 sprintf(temp, "0x%X", (int)result);
1545 sprintf(temp, "%d", (int)result);
1546 return __ecereNameSpace__ecere__sys__CopyString(temp);
1549 extern int isprint(int c);
1551 char * PrintChar(char result)
1555 if(result > (char)0 && isprint(result))
1556 sprintf(temp, "'%c'", result);
1557 else if(result < (char)0)
1558 sprintf(temp, "%d", (int)result);
1560 sprintf(temp, "0x%X", (unsigned char)result);
1561 return __ecereNameSpace__ecere__sys__CopyString(temp);
1564 char * PrintUChar(unsigned char result)
1568 sprintf(temp, "0x%X", result);
1569 return __ecereNameSpace__ecere__sys__CopyString(temp);
1572 char * PrintFloat(float result)
1576 sprintf(temp, "%.16ff", result);
1577 return __ecereNameSpace__ecere__sys__CopyString(temp);
1580 char * PrintDouble(double result)
1584 sprintf(temp, "%.16f", result);
1585 return __ecereNameSpace__ecere__sys__CopyString(temp);
1588 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1592 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (* Neg)(struct Expression *, struct Operand *);
1598 unsigned int (* Inc)(struct Expression *, struct Operand *);
1599 unsigned int (* Dec)(struct Expression *, struct Operand *);
1600 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1612 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1615 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1616 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1617 unsigned int (* Not)(struct Expression *, struct Operand *);
1618 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1619 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1620 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1621 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1622 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1623 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1624 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1625 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1626 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1627 } __attribute__ ((gcc_struct));
1629 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1635 unsigned int ptrSize;
1648 } __attribute__ ((gcc_struct));
1650 } __attribute__ ((gcc_struct));
1652 struct Operand GetOperand(struct Expression * exp);
1654 unsigned int GetInt(struct Expression * exp, int * value2)
1656 struct Operand op2 = GetOperand(exp);
1658 if(op2.kind == 3 && op2.type->isSigned)
1660 else if(op2.kind == 3)
1661 *value2 = (int)op2.ui;
1662 else if(op2.kind == 4 && op2.type->isSigned)
1663 *value2 = (int)op2.i64;
1664 else if(op2.kind == 4)
1665 *value2 = (int)op2.ui64;
1666 else if(op2.kind == 23 && op2.type->isSigned)
1667 *value2 = (int)op2.i64;
1668 else if(op2.kind == 23)
1669 *value2 = (int)op2.ui64;
1670 else if(op2.kind == 22 && op2.type->isSigned)
1671 *value2 = (int)op2.i64;
1672 else if(op2.kind == 22)
1673 *value2 = (int)op2.ui64;
1674 else if(op2.kind == 2 && op2.type->isSigned)
1675 *value2 = (int)op2.s;
1676 else if(op2.kind == 2)
1677 *value2 = (int)op2.us;
1678 else if(op2.kind == 1 && op2.type->isSigned)
1679 *value2 = (int)op2.c;
1680 else if(op2.kind == 24 || op2.kind == 1)
1681 *value2 = (int)op2.uc;
1682 else if(op2.kind == 6)
1683 *value2 = (int)op2.f;
1684 else if(op2.kind == 7)
1685 *value2 = (int)op2.d;
1686 else if(op2.kind == 13)
1687 *value2 = (int)op2.ui64;
1693 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1695 struct Operand op2 = GetOperand(exp);
1697 if(op2.kind == 3 && op2.type->isSigned)
1698 *value2 = (unsigned int)op2.i;
1699 else if(op2.kind == 3)
1701 else if(op2.kind == 4 && op2.type->isSigned)
1702 *value2 = (unsigned int)op2.i64;
1703 else if(op2.kind == 4)
1704 *value2 = (unsigned int)op2.ui64;
1705 else if(op2.kind == 23 && op2.type->isSigned)
1706 *value2 = (unsigned int)op2.i64;
1707 else if(op2.kind == 23)
1708 *value2 = (unsigned int)op2.ui64;
1709 else if(op2.kind == 22 && op2.type->isSigned)
1710 *value2 = (unsigned int)op2.i64;
1711 else if(op2.kind == 22)
1712 *value2 = (unsigned int)op2.ui64;
1713 else if(op2.kind == 2 && op2.type->isSigned)
1714 *value2 = (unsigned int)op2.s;
1715 else if(op2.kind == 2)
1716 *value2 = (unsigned int)op2.us;
1717 else if(op2.kind == 1 && op2.type->isSigned)
1718 *value2 = (unsigned int)op2.c;
1719 else if(op2.kind == 24 || op2.kind == 1)
1720 *value2 = (unsigned int)op2.uc;
1721 else if(op2.kind == 6)
1722 *value2 = (unsigned int)op2.f;
1723 else if(op2.kind == 7)
1724 *value2 = (unsigned int)op2.d;
1725 else if(op2.kind == 13)
1726 *value2 = (unsigned int)op2.ui64;
1732 unsigned int GetInt64(struct Expression * exp, long long * value2)
1734 struct Operand op2 = GetOperand(exp);
1736 if(op2.kind == 3 && op2.type->isSigned)
1737 *value2 = (long long)op2.i;
1738 else if(op2.kind == 3)
1739 *value2 = (long long)op2.ui;
1740 else if(op2.kind == 4 && op2.type->isSigned)
1742 else if(op2.kind == 4)
1743 *value2 = (long long)op2.ui64;
1744 else if(op2.kind == 23 && op2.type->isSigned)
1746 else if(op2.kind == 23)
1747 *value2 = (long long)op2.ui64;
1748 else if(op2.kind == 22 && op2.type->isSigned)
1750 else if(op2.kind == 22)
1751 *value2 = (long long)op2.ui64;
1752 else if(op2.kind == 2 && op2.type->isSigned)
1753 *value2 = (long long)op2.s;
1754 else if(op2.kind == 2)
1755 *value2 = (long long)op2.us;
1756 else if(op2.kind == 1 && op2.type->isSigned)
1757 *value2 = (long long)op2.c;
1758 else if(op2.kind == 24 || op2.kind == 1)
1759 *value2 = (long long)op2.uc;
1760 else if(op2.kind == 6)
1761 *value2 = (long long)op2.f;
1762 else if(op2.kind == 7)
1763 *value2 = (long long)op2.d;
1764 else if(op2.kind == 13)
1765 *value2 = (long long)op2.ui64;
1771 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1773 struct Operand op2 = GetOperand(exp);
1775 if(op2.kind == 3 && op2.type->isSigned)
1776 *value2 = (uint64)op2.i;
1777 else if(op2.kind == 3)
1778 *value2 = (uint64)op2.ui;
1779 else if(op2.kind == 4 && op2.type->isSigned)
1780 *value2 = (uint64)op2.i64;
1781 else if(op2.kind == 4)
1783 else if(op2.kind == 23 && op2.type->isSigned)
1784 *value2 = (uint64)op2.i64;
1785 else if(op2.kind == 23)
1787 else if(op2.kind == 22 && op2.type->isSigned)
1788 *value2 = (uint64)op2.i64;
1789 else if(op2.kind == 22)
1791 else if(op2.kind == 2 && op2.type->isSigned)
1792 *value2 = (uint64)op2.s;
1793 else if(op2.kind == 2)
1794 *value2 = (uint64)op2.us;
1795 else if(op2.kind == 1 && op2.type->isSigned)
1796 *value2 = (uint64)op2.c;
1797 else if(op2.kind == 24 || op2.kind == 1)
1798 *value2 = (uint64)op2.uc;
1799 else if(op2.kind == 6)
1800 *value2 = (uint64)op2.f;
1801 else if(op2.kind == 7)
1802 *value2 = (uint64)op2.d;
1803 else if(op2.kind == 13)
1810 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1812 struct Operand op2 = GetOperand(exp);
1814 if(op2.kind == 3 && op2.type->isSigned)
1815 *value2 = (intptr_t)op2.i;
1816 else if(op2.kind == 3)
1817 *value2 = (intptr_t)op2.ui;
1818 else if(op2.kind == 4 && op2.type->isSigned)
1819 *value2 = (intptr_t)op2.i64;
1820 else if(op2.kind == 4)
1821 *value2 = (intptr_t)op2.ui64;
1822 else if(op2.kind == 23 && op2.type->isSigned)
1823 *value2 = (intptr_t)op2.i64;
1824 else if(op2.kind == 23)
1825 *value2 = (intptr_t)op2.ui64;
1826 else if(op2.kind == 22 && op2.type->isSigned)
1827 *value2 = (intptr_t)op2.i64;
1828 else if(op2.kind == 22)
1829 *value2 = (intptr_t)op2.ui64;
1830 else if(op2.kind == 2 && op2.type->isSigned)
1831 *value2 = (intptr_t)op2.s;
1832 else if(op2.kind == 2)
1833 *value2 = (intptr_t)op2.us;
1834 else if(op2.kind == 1 && op2.type->isSigned)
1835 *value2 = (intptr_t)op2.c;
1836 else if(op2.kind == 24 || op2.kind == 1)
1837 *value2 = (intptr_t)op2.uc;
1838 else if(op2.kind == 6)
1839 *value2 = (intptr_t)op2.f;
1840 else if(op2.kind == 7)
1841 *value2 = (intptr_t)op2.d;
1842 else if(op2.kind == 13)
1843 *value2 = (intptr_t)op2.ui64;
1849 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1851 struct Operand op2 = GetOperand(exp);
1853 if(op2.kind == 3 && op2.type->isSigned)
1854 *value2 = (uintptr_t)op2.i;
1855 else if(op2.kind == 3)
1856 *value2 = (uintptr_t)op2.ui;
1857 else if(op2.kind == 4 && op2.type->isSigned)
1858 *value2 = (uintptr_t)op2.i64;
1859 else if(op2.kind == 4)
1860 *value2 = (uintptr_t)op2.ui64;
1861 else if(op2.kind == 23 && op2.type->isSigned)
1862 *value2 = (uintptr_t)op2.i64;
1863 else if(op2.kind == 23)
1864 *value2 = (uintptr_t)op2.ui64;
1865 else if(op2.kind == 22 && op2.type->isSigned)
1866 *value2 = (uintptr_t)op2.i64;
1867 else if(op2.kind == 22)
1868 *value2 = (uintptr_t)op2.ui64;
1869 else if(op2.kind == 2 && op2.type->isSigned)
1870 *value2 = (uintptr_t)op2.s;
1871 else if(op2.kind == 2)
1872 *value2 = (uintptr_t)op2.us;
1873 else if(op2.kind == 1 && op2.type->isSigned)
1874 *value2 = (uintptr_t)op2.c;
1875 else if(op2.kind == 24 || op2.kind == 1)
1876 *value2 = (uintptr_t)op2.uc;
1877 else if(op2.kind == 6)
1878 *value2 = (uintptr_t)op2.f;
1879 else if(op2.kind == 7)
1880 *value2 = (uintptr_t)op2.d;
1881 else if(op2.kind == 13)
1882 *value2 = (uintptr_t)op2.ui64;
1888 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1890 struct Operand op2 = GetOperand(exp);
1892 if(op2.kind == 3 && op2.type->isSigned)
1893 *value2 = (ssize_t)op2.i;
1894 else if(op2.kind == 3)
1895 *value2 = (ssize_t)op2.ui;
1896 else if(op2.kind == 4 && op2.type->isSigned)
1897 *value2 = (ssize_t)op2.i64;
1898 else if(op2.kind == 4)
1899 *value2 = (ssize_t)op2.ui64;
1900 else if(op2.kind == 23 && op2.type->isSigned)
1901 *value2 = (ssize_t)op2.i64;
1902 else if(op2.kind == 23)
1903 *value2 = (ssize_t)op2.ui64;
1904 else if(op2.kind == 22 && op2.type->isSigned)
1905 *value2 = (ssize_t)op2.i64;
1906 else if(op2.kind == 22)
1907 *value2 = (ssize_t)op2.ui64;
1908 else if(op2.kind == 2 && op2.type->isSigned)
1909 *value2 = (ssize_t)op2.s;
1910 else if(op2.kind == 2)
1911 *value2 = (ssize_t)op2.us;
1912 else if(op2.kind == 1 && op2.type->isSigned)
1913 *value2 = (ssize_t)op2.c;
1914 else if(op2.kind == 24 || op2.kind == 1)
1915 *value2 = (ssize_t)op2.uc;
1916 else if(op2.kind == 6)
1917 *value2 = (ssize_t)op2.f;
1918 else if(op2.kind == 7)
1919 *value2 = (ssize_t)op2.d;
1920 else if(op2.kind == 13)
1921 *value2 = (ssize_t)op2.ui64;
1927 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1929 struct Operand op2 = GetOperand(exp);
1931 if(op2.kind == 3 && op2.type->isSigned)
1932 *value2 = (size_t)op2.i;
1933 else if(op2.kind == 3)
1934 *value2 = (size_t)op2.ui;
1935 else if(op2.kind == 4 && op2.type->isSigned)
1936 *value2 = (size_t)op2.i64;
1937 else if(op2.kind == 4)
1938 *value2 = (size_t)op2.ui64;
1939 else if(op2.kind == 23 && op2.type->isSigned)
1940 *value2 = (size_t)op2.i64;
1941 else if(op2.kind == 23)
1942 *value2 = (size_t)op2.ui64;
1943 else if(op2.kind == 22 && op2.type->isSigned)
1944 *value2 = (size_t)op2.i64;
1945 else if(op2.kind == 22)
1946 *value2 = (size_t)op2.ui64;
1947 else if(op2.kind == 2 && op2.type->isSigned)
1948 *value2 = (size_t)op2.s;
1949 else if(op2.kind == 2)
1950 *value2 = (size_t)op2.us;
1951 else if(op2.kind == 1 && op2.type->isSigned)
1952 *value2 = (size_t)op2.c;
1953 else if(op2.kind == 24 || op2.kind == 1)
1954 *value2 = (size_t)op2.uc;
1955 else if(op2.kind == 6)
1956 *value2 = (size_t)op2.f;
1957 else if(op2.kind == 7)
1958 *value2 = (size_t)op2.d;
1959 else if(op2.kind == 13)
1960 *value2 = (size_t)op2.ui64;
1966 unsigned int GetShort(struct Expression * exp, short * value2)
1968 struct Operand op2 = GetOperand(exp);
1970 if(op2.kind == 3 && op2.type->isSigned)
1971 *value2 = (short)op2.i;
1972 else if(op2.kind == 3)
1973 *value2 = (short)op2.ui;
1974 else if(op2.kind == 4 && op2.type->isSigned)
1975 *value2 = (short)op2.i64;
1976 else if(op2.kind == 4)
1977 *value2 = (short)op2.ui64;
1978 else if(op2.kind == 23 && op2.type->isSigned)
1979 *value2 = (short)op2.i64;
1980 else if(op2.kind == 23)
1981 *value2 = (short)op2.ui64;
1982 else if(op2.kind == 22 && op2.type->isSigned)
1983 *value2 = (short)op2.i64;
1984 else if(op2.kind == 22)
1985 *value2 = (short)op2.ui64;
1986 else if(op2.kind == 2 && op2.type->isSigned)
1988 else if(op2.kind == 2)
1989 *value2 = (short)op2.us;
1990 else if(op2.kind == 1 && op2.type->isSigned)
1991 *value2 = (short)op2.c;
1992 else if(op2.kind == 24 || op2.kind == 1)
1993 *value2 = (short)op2.uc;
1994 else if(op2.kind == 6)
1995 *value2 = (short)op2.f;
1996 else if(op2.kind == 7)
1997 *value2 = (short)op2.d;
1998 else if(op2.kind == 13)
1999 *value2 = (short)op2.ui64;
2005 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
2007 struct Operand op2 = GetOperand(exp);
2009 if(op2.kind == 3 && op2.type->isSigned)
2010 *value2 = (unsigned short)op2.i;
2011 else if(op2.kind == 3)
2012 *value2 = (unsigned short)op2.ui;
2013 else if(op2.kind == 4 && op2.type->isSigned)
2014 *value2 = (unsigned short)op2.i64;
2015 else if(op2.kind == 4)
2016 *value2 = (unsigned short)op2.ui64;
2017 else if(op2.kind == 23 && op2.type->isSigned)
2018 *value2 = (unsigned short)op2.i64;
2019 else if(op2.kind == 23)
2020 *value2 = (unsigned short)op2.ui64;
2021 else if(op2.kind == 22 && op2.type->isSigned)
2022 *value2 = (unsigned short)op2.i64;
2023 else if(op2.kind == 22)
2024 *value2 = (unsigned short)op2.ui64;
2025 else if(op2.kind == 2 && op2.type->isSigned)
2026 *value2 = (unsigned short)op2.s;
2027 else if(op2.kind == 2)
2029 else if(op2.kind == 1 && op2.type->isSigned)
2030 *value2 = (unsigned short)op2.c;
2031 else if(op2.kind == 24 || op2.kind == 1)
2032 *value2 = (unsigned short)op2.uc;
2033 else if(op2.kind == 6)
2034 *value2 = (unsigned short)op2.f;
2035 else if(op2.kind == 7)
2036 *value2 = (unsigned short)op2.d;
2037 else if(op2.kind == 13)
2038 *value2 = (unsigned short)op2.ui64;
2044 unsigned int GetChar(struct Expression * exp, char * value2)
2046 struct Operand op2 = GetOperand(exp);
2048 if(op2.kind == 3 && op2.type->isSigned)
2049 *value2 = (char)op2.i;
2050 else if(op2.kind == 3)
2051 *value2 = (char)op2.ui;
2052 else if(op2.kind == 4 && op2.type->isSigned)
2053 *value2 = (char)op2.i64;
2054 else if(op2.kind == 4)
2055 *value2 = (char)op2.ui64;
2056 else if(op2.kind == 23 && op2.type->isSigned)
2057 *value2 = (char)op2.i64;
2058 else if(op2.kind == 23)
2059 *value2 = (char)op2.ui64;
2060 else if(op2.kind == 22 && op2.type->isSigned)
2061 *value2 = (char)op2.i64;
2062 else if(op2.kind == 22)
2063 *value2 = (char)op2.ui64;
2064 else if(op2.kind == 2 && op2.type->isSigned)
2065 *value2 = (char)op2.s;
2066 else if(op2.kind == 2)
2067 *value2 = (char)op2.us;
2068 else if(op2.kind == 1 && op2.type->isSigned)
2070 else if(op2.kind == 24 || op2.kind == 1)
2071 *value2 = (char)op2.uc;
2072 else if(op2.kind == 6)
2073 *value2 = (char)op2.f;
2074 else if(op2.kind == 7)
2075 *value2 = (char)op2.d;
2076 else if(op2.kind == 13)
2077 *value2 = (char)op2.ui64;
2083 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2085 struct Operand op2 = GetOperand(exp);
2087 if(op2.kind == 3 && op2.type->isSigned)
2088 *value2 = (unsigned char)op2.i;
2089 else if(op2.kind == 3)
2090 *value2 = (unsigned char)op2.ui;
2091 else if(op2.kind == 4 && op2.type->isSigned)
2092 *value2 = (unsigned char)op2.i64;
2093 else if(op2.kind == 4)
2094 *value2 = (unsigned char)op2.ui64;
2095 else if(op2.kind == 23 && op2.type->isSigned)
2096 *value2 = (unsigned char)op2.i64;
2097 else if(op2.kind == 23)
2098 *value2 = (unsigned char)op2.ui64;
2099 else if(op2.kind == 22 && op2.type->isSigned)
2100 *value2 = (unsigned char)op2.i64;
2101 else if(op2.kind == 22)
2102 *value2 = (unsigned char)op2.ui64;
2103 else if(op2.kind == 2 && op2.type->isSigned)
2104 *value2 = (unsigned char)op2.s;
2105 else if(op2.kind == 2)
2106 *value2 = (unsigned char)op2.us;
2107 else if(op2.kind == 1 && op2.type->isSigned)
2108 *value2 = (unsigned char)op2.c;
2109 else if(op2.kind == 24 || op2.kind == 1)
2111 else if(op2.kind == 6)
2112 *value2 = (unsigned char)op2.f;
2113 else if(op2.kind == 7)
2114 *value2 = (unsigned char)op2.d;
2115 else if(op2.kind == 13)
2116 *value2 = (unsigned char)op2.ui64;
2122 unsigned int GetFloat(struct Expression * exp, float * value2)
2124 struct Operand op2 = GetOperand(exp);
2126 if(op2.kind == 3 && op2.type->isSigned)
2127 *value2 = (float)(float)op2.i;
2128 else if(op2.kind == 3)
2129 *value2 = (float)(float)op2.ui;
2130 else if(op2.kind == 4 && op2.type->isSigned)
2131 *value2 = (float)(float)op2.i64;
2132 else if(op2.kind == 4)
2133 *value2 = (float)(float)op2.ui64;
2134 else if(op2.kind == 23 && op2.type->isSigned)
2135 *value2 = (float)(float)op2.i64;
2136 else if(op2.kind == 23)
2137 *value2 = (float)(float)op2.ui64;
2138 else if(op2.kind == 22 && op2.type->isSigned)
2139 *value2 = (float)(float)op2.i64;
2140 else if(op2.kind == 22)
2141 *value2 = (float)(float)op2.ui64;
2142 else if(op2.kind == 2 && op2.type->isSigned)
2143 *value2 = (float)(float)op2.s;
2144 else if(op2.kind == 2)
2145 *value2 = (float)(float)op2.us;
2146 else if(op2.kind == 1 && op2.type->isSigned)
2147 *value2 = (float)(float)op2.c;
2148 else if(op2.kind == 24 || op2.kind == 1)
2149 *value2 = (float)(float)op2.uc;
2150 else if(op2.kind == 6)
2151 *value2 = (float)op2.f;
2152 else if(op2.kind == 7)
2153 *value2 = (float)op2.d;
2154 else if(op2.kind == 13)
2155 *value2 = (float)(float)op2.ui64;
2161 unsigned int GetDouble(struct Expression * exp, double * value2)
2163 struct Operand op2 = GetOperand(exp);
2165 if(op2.kind == 3 && op2.type->isSigned)
2166 *value2 = (double)(double)op2.i;
2167 else if(op2.kind == 3)
2168 *value2 = (double)(double)op2.ui;
2169 else if(op2.kind == 4 && op2.type->isSigned)
2170 *value2 = (double)(double)op2.i64;
2171 else if(op2.kind == 4)
2172 *value2 = (double)(double)op2.ui64;
2173 else if(op2.kind == 23 && op2.type->isSigned)
2174 *value2 = (double)(double)op2.i64;
2175 else if(op2.kind == 23)
2176 *value2 = (double)(double)op2.ui64;
2177 else if(op2.kind == 22 && op2.type->isSigned)
2178 *value2 = (double)(double)op2.i64;
2179 else if(op2.kind == 22)
2180 *value2 = (double)(double)op2.ui64;
2181 else if(op2.kind == 2 && op2.type->isSigned)
2182 *value2 = (double)(double)op2.s;
2183 else if(op2.kind == 2)
2184 *value2 = (double)(double)op2.us;
2185 else if(op2.kind == 1 && op2.type->isSigned)
2186 *value2 = (double)(double)op2.c;
2187 else if(op2.kind == 24 || op2.kind == 1)
2188 *value2 = (double)(double)op2.uc;
2189 else if(op2.kind == 6)
2190 *value2 = (double)op2.f;
2191 else if(op2.kind == 7)
2192 *value2 = (double)op2.d;
2193 else if(op2.kind == 13)
2194 *value2 = (double)(double)op2.ui64;
2200 void ComputeExpression(struct Expression * exp);
2202 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2204 extern int targetBits;
2206 int ComputeTypeSize(struct Type * type);
2208 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2210 struct __ecereNameSpace__ecere__com__BitMember
2212 struct __ecereNameSpace__ecere__com__BitMember * prev;
2213 struct __ecereNameSpace__ecere__com__BitMember * next;
2215 unsigned int isProperty;
2218 struct __ecereNameSpace__ecere__com__Class * _class;
2219 char * dataTypeString;
2220 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2221 struct Type * dataType;
2226 } __attribute__ ((gcc_struct));
2228 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2230 struct __ecereNameSpace__ecere__sys__OldLink
2232 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2233 struct __ecereNameSpace__ecere__sys__OldLink * next;
2235 } __attribute__ ((gcc_struct));
2237 void FinishTemplatesContext(struct Context * context);
2239 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2241 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2242 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2244 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))
2247 int unionMemberOffset = 0;
2252 member->memberOffset = 0;
2253 if(targetBits < sizeof(void *) * 8)
2254 member->structAlignment = 0;
2256 else if(targetBits < sizeof(void *) * 8)
2257 _class->structAlignment = 0;
2258 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2259 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2260 if(!member && _class->destructionWatchOffset)
2261 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2263 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2265 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2267 if(!dataMember->isProperty)
2269 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2271 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2277 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2279 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2281 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2283 if(!isMember && _class->type == 2 && dataMember->dataType)
2285 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2289 ComputeTypeSize(dataMember->dataType);
2290 if(bitMember->pos == -1)
2291 bitMember->pos = _class->memberOffset;
2292 if(!bitMember->size)
2293 bitMember->size = dataMember->dataType->size * 8;
2294 _class->memberOffset = bitMember->pos + bitMember->size;
2295 for(d = 0; d < bitMember->size; d++)
2301 bitMember->mask = mask << bitMember->pos;
2303 else if(dataMember->type == 0 && dataMember->dataType)
2308 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2309 ComputeTypeSize(dataMember->dataType);
2310 if(dataMember->dataType->bitFieldCount)
2312 bitFields += dataMember->dataType->bitFieldCount;
2319 int size = (bitFields + 7) / 8;
2323 int __simpleStruct0;
2327 int __simpleStruct0;
2329 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2330 if(member->memberOffset % alignment)
2331 member->memberOffset += alignment - (member->memberOffset % alignment);
2333 dataMember->offset = member->memberOffset;
2334 if(member->type == 1)
2335 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2338 member->memberOffset += size;
2345 int __simpleStruct0;
2347 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2348 if(_class->memberOffset % alignment)
2349 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2351 dataMember->offset = _class->memberOffset;
2352 _class->memberOffset += size;
2356 size = dataMember->dataType->size;
2357 alignment = dataMember->dataType->alignment;
2361 int __simpleStruct0;
2365 int __simpleStruct0;
2367 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2368 if(member->memberOffset % alignment)
2369 member->memberOffset += alignment - (member->memberOffset % alignment);
2371 dataMember->offset = member->memberOffset;
2372 if(member->type == 1)
2373 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2376 member->memberOffset += size;
2383 int __simpleStruct0;
2385 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2386 if(_class->memberOffset % alignment)
2387 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2389 dataMember->offset = _class->memberOffset;
2390 _class->memberOffset += size;
2397 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2398 alignment = dataMember->structAlignment;
2401 int __simpleStruct0;
2405 int __simpleStruct0;
2407 if(member->memberOffset % alignment)
2408 member->memberOffset += alignment - (member->memberOffset % alignment);
2409 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2411 dataMember->offset = member->memberOffset;
2412 if(member->type == 1)
2413 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2415 member->memberOffset += dataMember->memberOffset;
2421 int __simpleStruct0;
2423 if(_class->memberOffset % alignment)
2424 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2425 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2427 dataMember->offset = _class->memberOffset;
2428 _class->memberOffset += dataMember->memberOffset;
2436 int size = (bitFields + 7) / 8;
2440 int __simpleStruct0;
2444 int __simpleStruct0;
2446 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2447 if(member->memberOffset % alignment)
2448 member->memberOffset += alignment - (member->memberOffset % alignment);
2450 if(member->type == 1)
2451 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2454 member->memberOffset += size;
2461 int __simpleStruct0;
2463 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2464 if(_class->memberOffset % alignment)
2465 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2467 _class->memberOffset += size;
2472 if(member && member->type == 1)
2474 member->memberOffset = unionMemberOffset;
2478 if(_class->type != 2)
2482 if(_class->structAlignment)
2484 if(_class->memberOffset % _class->structAlignment)
2485 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2487 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2490 struct __ecereNameSpace__ecere__com__Property * prop;
2492 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2494 if(prop->isProperty && prop->isWatchable)
2496 prop->watcherOffset = _class->structSize;
2497 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2502 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2504 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2506 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2508 if(deriv->computeSize)
2510 deriv->offset = _class->structSize;
2511 deriv->memberOffset = 0;
2512 deriv->structSize = deriv->offset;
2513 ComputeClassMembers(deriv, 0x0);
2521 FinishTemplatesContext(context);
2524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2526 struct __ecereNameSpace__ecere__com__NameSpace
2529 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2530 struct __ecereNameSpace__ecere__com__NameSpace * left;
2531 struct __ecereNameSpace__ecere__com__NameSpace * right;
2533 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2534 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2535 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2536 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2537 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2538 } __attribute__ ((gcc_struct));
2540 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2542 struct __ecereNameSpace__ecere__com__Module
2544 struct __ecereNameSpace__ecere__com__Instance * application;
2545 struct __ecereNameSpace__ecere__sys__OldList classes;
2546 struct __ecereNameSpace__ecere__sys__OldList defines;
2547 struct __ecereNameSpace__ecere__sys__OldList functions;
2548 struct __ecereNameSpace__ecere__sys__OldList modules;
2549 struct __ecereNameSpace__ecere__com__Instance * prev;
2550 struct __ecereNameSpace__ecere__com__Instance * next;
2556 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2557 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2558 } __attribute__ ((gcc_struct));
2560 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2562 struct __ecereNameSpace__ecere__com__Class * _class;
2563 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2565 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2566 ComputeModuleClasses(subModule->data);
2567 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2568 ComputeClassMembers(_class, 0x0);
2571 extern unsigned int inCompiler;
2573 extern void Compiler_Error(char * format, ...);
2575 extern char * __ecereNameSpace__ecere__GetTranslatedString(char * name, char * string, char * stringAndContext);
2577 int ComputeTypeSize(struct Type * type)
2579 unsigned int size = type ? type->size : 0;
2581 if(!size && type && !type->computing)
2583 type->computing = 0x1;
2587 type->alignment = size = sizeof(char);
2590 type->alignment = size = sizeof(char);
2593 type->alignment = size = sizeof(int);
2596 type->alignment = size = sizeof(long long);
2599 type->alignment = size = targetBits / 8;
2602 type->alignment = size = targetBits / 8;
2605 type->alignment = size = sizeof(long);
2608 type->alignment = size = sizeof(short);
2611 type->alignment = size = sizeof(float);
2614 type->alignment = size = sizeof(double);
2618 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2620 if(_class && _class->type == 1)
2622 ComputeClassMembers(_class, 0x0);
2623 type->alignment = _class->structAlignment;
2624 size = _class->structSize;
2625 if(type->alignment && size % type->alignment)
2626 size += type->alignment - (size % type->alignment);
2628 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2630 if(!_class->dataType)
2631 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2632 size = type->alignment = ComputeTypeSize(_class->dataType);
2635 size = type->alignment = targetBits / 8;
2640 size = type->alignment = targetBits / 8;
2643 if(type->arraySizeExp)
2645 ProcessExpressionType(type->arraySizeExp);
2646 ComputeExpression(type->arraySizeExp);
2647 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)))
2649 struct Location oldLoc = yylloc;
2650 char expression[10240];
2652 expression[0] = '\0';
2653 type->arraySizeExp->expType = (((void *)0));
2654 yylloc = type->arraySizeExp->loc;
2656 PrintExpression(type->arraySizeExp, expression);
2657 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Array size not constant int (%s)\n", (((void *)0))), expression);
2660 GetInt(type->arraySizeExp, &type->arraySize);
2662 else if(type->enumClass)
2664 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2666 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2669 type->arraySize = 0;
2673 type->arraySize = 0;
2675 size = ComputeTypeSize(type->type) * type->arraySize;
2677 type->alignment = type->type->alignment;
2681 struct Type * member;
2683 for(member = type->members.first; member; member = member->next)
2685 int __simpleStruct0, __simpleStruct1;
2686 unsigned int addSize = ComputeTypeSize(member);
2688 member->offset = size;
2689 if(member->alignment && size % member->alignment)
2690 member->offset += member->alignment - (size % member->alignment);
2691 size = member->offset;
2692 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2695 if(type->alignment && size % type->alignment)
2696 size += type->alignment - (size % type->alignment);
2701 struct Type * member;
2703 for(member = type->members.first; member; member = member->next)
2705 int __simpleStruct0, __simpleStruct1;
2706 unsigned int addSize = ComputeTypeSize(member);
2708 member->offset = size;
2709 if(member->alignment && size % member->alignment)
2710 member->offset += member->alignment - (size % member->alignment);
2711 size = member->offset;
2712 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2713 size = ((size > addSize) ? size : addSize);
2715 if(type->alignment && size % type->alignment)
2716 size += type->alignment - (size % type->alignment);
2721 struct TemplateParameter * param = type->templateParameter;
2722 struct Type * baseType = ProcessTemplateParameterType(param);
2726 size = ComputeTypeSize(baseType);
2727 type->alignment = baseType->alignment;
2730 type->alignment = size = sizeof(uint64);
2735 type->alignment = size = sizeof(enum
2743 type->alignment = size = targetBits / 8;
2748 type->computing = 0x0;
2753 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2755 extern struct Identifier * MkIdentifier(char * string);
2757 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2759 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2761 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2763 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2765 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2767 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2769 extern void FreeType(struct Type * type);
2771 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2773 extern struct Specifier * MkSpecifier(int specifier);
2775 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2777 extern struct Expression * MkExpConstant(char * string);
2779 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)
2781 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2782 unsigned int totalSize = 0;
2783 unsigned int maxSize = 0;
2784 int alignment, size;
2785 struct __ecereNameSpace__ecere__com__DataMember * member;
2786 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2789 *addedPadding = 0x0;
2790 if(!isMember && _class->base)
2792 maxSize = _class->structSize;
2794 if(_class->type == 1 || _class->type == 5)
2795 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2798 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2800 if(maxSize > baseSize)
2801 maxSize -= baseSize;
2807 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2809 if(!member->isProperty)
2811 switch(member->type)
2815 if(member->dataTypeString)
2817 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2818 struct Declarator * decl;
2820 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2821 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2822 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2823 if(!member->dataType)
2824 member->dataType = ProcessType(specs, decl);
2825 ReplaceThisClassSpecifiers(specs, topClass);
2827 struct Type * type = ProcessType(specs, decl);
2829 DeclareType(member->dataType, 0x0, 0x0);
2832 ComputeTypeSize(member->dataType);
2833 size = member->dataType->size;
2834 alignment = member->dataType->alignment;
2837 if(totalSize % alignment)
2838 totalSize += alignment - (totalSize % alignment);
2847 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2850 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2851 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2852 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2853 alignment = member->structAlignment;
2856 if(totalSize % alignment)
2857 totalSize += alignment - (totalSize % alignment);
2867 unsigned int __simpleStruct0;
2869 if(topMember && topMember->type == 1)
2870 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2872 *retSize += totalSize;
2874 else if(totalSize < maxSize && _class->type != 1000)
2876 int autoPadding = 0;
2878 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2879 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2880 if(totalSize + autoPadding < maxSize)
2882 char sizeString[50];
2884 sprintf(sizeString, "%d", maxSize - totalSize);
2885 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2887 *addedPadding = 0x1;
2891 FinishTemplatesContext(context);
2892 return topMember ? topMember->memberID : _class->memberID;
2895 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2897 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2898 unsigned int totalSize = 0;
2899 struct __ecereNameSpace__ecere__com__DataMember * member;
2900 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2902 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2903 DeclareMembers(_class->base, 0x0);
2904 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2906 if(!member->isProperty)
2908 switch(member->type)
2912 if(!member->dataType && member->dataTypeString)
2913 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2914 if(member->dataType)
2915 DeclareType(member->dataType, 0x0, 0x0);
2921 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2928 FinishTemplatesContext(context);
2929 return topMember ? topMember->memberID : _class->memberID;
2932 extern struct Symbol * FindClass(char * name);
2934 extern char * strchr(const char * , int);
2936 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2938 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2940 extern void FreeClassDef(struct ClassDef * def);
2942 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2944 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2946 extern char * strcpy(char * , const char * );
2948 extern void MangleClassName(char * className);
2950 extern void DeclareClass(struct Symbol * classSym, char * className);
2952 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2954 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2956 void DeclareStruct(char * name, unsigned int skipNoHead)
2958 struct External * external = (((void *)0));
2959 struct Symbol * classSym = FindClass(name);
2961 if(!inCompiler || !classSym)
2963 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2965 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2967 struct Declaration * decl;
2968 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2969 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2970 char structName[1024];
2972 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2973 classSym->declaring++;
2974 if(strchr(classSym->string, '<'))
2976 if(classSym->registered->templateClass)
2978 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2979 classSym->declaring--;
2983 DeclareMembers(classSym->registered, 0x0);
2984 structName[0] = (char)0;
2985 FullClassNameCat(structName, name, 0x0);
2988 unsigned int addedPadding = 0x0;
2990 classSym->declaredStructSym = 0x1;
2991 declarations = MkList();
2992 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2993 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2995 FreeList(declarations, FreeClassDef);
2996 declarations = (((void *)0));
2999 if(skipNoHead || declarations)
3001 if(external && external->declaration)
3003 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3004 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3006 if(classSym->structExternal)
3007 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3008 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3009 classSym->id = curExternal->symbol->idCode;
3010 classSym->idCode = curExternal->symbol->idCode;
3016 external = MkExternalDeclaration((((void *)0)));
3017 specifiers = MkList();
3018 declarators = MkList();
3019 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3020 external->declaration = decl = MkDeclaration(specifiers, declarators);
3021 if(decl->symbol && !decl->symbol->pointerExternal)
3022 decl->symbol->pointerExternal = external;
3023 if(classSym->registered && classSym->registered->type == 1)
3025 char className[1024];
3027 strcpy(className, "__ecereClass_");
3028 FullClassNameCat(className, classSym->string, 0x1);
3029 MangleClassName(className);
3030 DeclareClass(classSym, className);
3031 external->symbol = classSym;
3032 classSym->pointerExternal = external;
3033 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3034 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3038 char className[1024];
3040 strcpy(className, "__ecereClass_");
3041 FullClassNameCat(className, classSym->string, 0x1);
3042 MangleClassName(className);
3043 classSym->structExternal = external;
3044 DeclareClass(classSym, className);
3045 external->symbol = classSym;
3047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3050 classSym->declaring--;
3052 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3054 classSym->declaring++;
3056 if(classSym->registered)
3057 DeclareMembers(classSym->registered, 0x0);
3059 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3061 if(classSym->structExternal)
3062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3063 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3064 classSym->id = curExternal->symbol->idCode;
3065 classSym->idCode = curExternal->symbol->idCode;
3067 classSym->declaring--;
3071 extern char * strcat(char * , const char * );
3073 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3075 extern struct ModuleImport * mainModule;
3077 extern struct Specifier * MkSpecifierName(char * name);
3079 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3081 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3083 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3085 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3087 extern void FreeDeclarator(struct Declarator * decl);
3089 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3091 struct PropertyImport
3093 struct PropertyImport * prev;
3094 struct PropertyImport * next;
3096 unsigned int isVirtual;
3097 unsigned int hasSet;
3098 unsigned int hasGet;
3099 } __attribute__ ((gcc_struct));
3101 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3103 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3105 struct Symbol * symbol = prop->symbol;
3106 char propName[1024];
3108 strcpy(setName, "__ecereProp_");
3109 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3110 strcat(setName, "_Set_");
3111 FullClassNameCat(setName, prop->name, 0x1);
3112 strcpy(getName, "__ecereProp_");
3113 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3114 strcat(getName, "_Get_");
3115 FullClassNameCat(getName, prop->name, 0x1);
3116 strcpy(propName, "__ecereProp_");
3117 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3118 strcat(propName, "_");
3119 FullClassNameCat(propName, prop->name, 0x1);
3120 MangleClassName(getName);
3121 MangleClassName(setName);
3122 MangleClassName(propName);
3123 if(prop->_class->type == 1)
3124 DeclareStruct(prop->_class->fullName, 0x0);
3125 if(!symbol || curExternal->symbol->idCode < symbol->id)
3127 unsigned int imported = 0x0;
3128 unsigned int dllImport = 0x0;
3130 if(!symbol || symbol->_import)
3134 struct Symbol * classSym;
3136 if(!prop->_class->symbol)
3137 prop->_class->symbol = FindClass(prop->_class->fullName);
3138 classSym = prop->_class->symbol;
3139 if(classSym && !classSym->_import)
3141 struct ModuleImport * module;
3143 if(prop->_class->module)
3144 module = FindModule(prop->_class->module);
3146 module = mainModule;
3147 classSym->_import = __extension__ ({
3148 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3150 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3154 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3155 symbol->_import = (struct ClassImport *)__extension__ ({
3156 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3158 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3161 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3164 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3169 struct Context * context = SetupTemplatesContext(prop->_class);
3171 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3172 FinishTemplatesContext(context);
3176 if(!symbol->externalGet || symbol->externalGet->type == 0)
3178 struct Declaration * decl;
3179 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3180 struct Declarator * d;
3181 struct __ecereNameSpace__ecere__sys__OldList * params;
3182 struct Specifier * spec;
3183 struct External * external;
3184 struct Declarator * typeDecl;
3185 unsigned int simple = 0x0;
3187 specifiers = MkList();
3188 declarators = MkList();
3190 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3191 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3193 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3195 struct Context * context = SetupTemplatesContext(prop->_class);
3197 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3198 FinishTemplatesContext(context);
3200 for(spec = (*specifiers).first; spec; spec = spec->next)
3204 if((!typeDecl || typeDecl->type == 1))
3206 struct Symbol * classSym = spec->symbol;
3208 symbol->_class = classSym->registered;
3209 if(classSym->registered && classSym->registered->type == 1)
3211 DeclareStruct(spec->name, 0x0);
3218 d = PlugDeclarator(typeDecl, d);
3221 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3222 specifiers = MkList();
3224 d = MkDeclaratorFunction(d, params);
3226 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3227 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3230 ListAdd(specifiers, MkSpecifier(VOID));
3231 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3232 decl = MkDeclaration(specifiers, declarators);
3233 external = MkExternalDeclaration(decl);
3234 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3235 external->symbol = symbol;
3236 symbol->externalGet = external;
3237 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3239 FreeDeclarator(typeDecl);
3243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3248 if(!symbol->externalSet || symbol->externalSet->type == 0)
3250 struct Declaration * decl;
3251 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3252 struct Declarator * d;
3253 struct __ecereNameSpace__ecere__sys__OldList * params;
3254 struct Specifier * spec;
3255 struct External * external;
3256 struct Declarator * typeDecl;
3258 declarators = MkList();
3260 if(!prop->conversion || prop->_class->type == 1)
3262 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3264 specifiers = MkList();
3266 struct Context * context = SetupTemplatesContext(prop->_class);
3268 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3269 FinishTemplatesContext(context);
3271 ListAdd(params, MkTypeName(specifiers, d));
3272 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3274 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3275 d = MkDeclaratorFunction(d, params);
3276 for(spec = (*specifiers).first; spec; spec = spec->next)
3280 if((!typeDecl || typeDecl->type == 1))
3282 struct Symbol * classSym = spec->symbol;
3284 symbol->_class = classSym->registered;
3285 if(classSym->registered && classSym->registered->type == 1)
3286 DeclareStruct(spec->name, 0x0);
3290 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3291 specifiers = MkList();
3293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3294 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3296 if(!prop->conversion || prop->_class->type == 1)
3297 ListAdd(specifiers, MkSpecifier(VOID));
3299 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3300 decl = MkDeclaration(specifiers, declarators);
3301 external = MkExternalDeclaration(decl);
3302 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3303 external->symbol = symbol;
3304 symbol->externalSet = external;
3305 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3309 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3312 if(!symbol->externalPtr)
3314 struct Declaration * decl;
3315 struct External * external;
3316 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3319 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3322 ListAdd(specifiers, MkSpecifierName("Property"));
3324 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3326 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3329 strcpy(propName, "__ecerePropM_");
3330 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3331 strcat(propName, "_");
3332 FullClassNameCat(propName, prop->name, 0x1);
3333 MangleClassName(propName);
3334 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3336 decl = MkDeclaration(specifiers, list);
3338 external = MkExternalDeclaration(decl);
3339 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3340 external->symbol = symbol;
3341 symbol->externalPtr = external;
3345 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3347 symbol->id = curExternal->symbol->idCode;
3351 struct Type * Dereference(struct Type * source)
3353 struct Type * type = (((void *)0));
3357 if(source->kind == 13 || source->kind == 12)
3359 type = source->type;
3360 source->type->refCount++;
3362 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3364 type = __extension__ ({
3365 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3367 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3370 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3376 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot dereference type\n", (((void *)0))));
3381 static struct Type * Reference(struct Type * source)
3383 struct Type * type = (((void *)0));
3387 type = __extension__ ({
3388 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3390 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3397 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);
3399 extern void * memcpy(void * , const void * , size_t size);
3401 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3403 extern void FreeExpression(struct Expression * exp);
3405 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3407 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);
3409 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3411 extern struct Type * MkClassType(char * name);
3413 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);
3415 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)
3417 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3418 unsigned int found = 0x0;
3419 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3420 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3421 unsigned int freeType = 0x0;
3423 yylloc = member->loc;
3428 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3432 dataMember = *curMember;
3438 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3439 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3440 int _subMemberStackPos = 0;
3443 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3446 dataMember = thisMember;
3447 if(curMember && thisMember->memberAccess == 1)
3449 *curMember = thisMember;
3450 *curClass = thisMember->_class;
3451 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3452 *subMemberStackPos = _subMemberStackPos;
3458 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3459 if(method && method->type == 1)
3462 method = (((void *)0));
3467 struct Type * type = (((void *)0));
3471 if(!dataMember->dataType && dataMember->dataTypeString)
3473 struct Context * context = SetupTemplatesContext(_class);
3475 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3476 FinishTemplatesContext(context);
3478 type = dataMember->dataType;
3482 if(!method->dataType)
3483 ProcessMethodType(method);
3484 type = method->dataType;
3486 if(ident && ident->next)
3488 for(ident = ident->next; ident && type; ident = ident->next)
3492 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3494 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3496 type = dataMember->dataType;
3498 else if(type->kind == 9 || type->kind == 10)
3500 struct Type * memberType;
3502 for(memberType = type->members.first; memberType; memberType = memberType->next)
3504 if(!strcmp(memberType->name, ident->string))
3513 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3516 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3517 struct __ecereNameSpace__ecere__com__Class * sClass;
3519 for(sClass = _class; sClass; sClass = sClass->base)
3522 if(sClass->templateClass)
3523 sClass = sClass->templateClass;
3524 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3526 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3528 for(sClass = sClass->base; sClass; sClass = sClass->base)
3530 if(sClass->templateClass)
3531 sClass = sClass->templateClass;
3532 id += sClass->templateParams.count;
3543 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3545 if(arg.dataTypeString)
3547 type = ProcessTypeString(arg.dataTypeString, 0x0);
3549 if(type && _class->templateClass)
3550 type->passAsTemplate = 0x1;
3557 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3559 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3560 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3564 char templateString[1024];
3565 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3567 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3568 for(cClass = expClass; cClass; cClass = cClass->base)
3572 if(cClass->templateClass)
3573 cClass = cClass->templateClass;
3574 for(param = cClass->templateParams.first; param; param = param->next)
3577 struct __ecereNameSpace__ecere__com__Class * sClass;
3578 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3580 for(sClass = cClass->base; sClass; sClass = sClass->base)
3582 if(sClass->templateClass)
3583 sClass = sClass->templateClass;
3584 id += sClass->templateParams.count;
3586 arg = expClass->templateArgs[id];
3587 for(sClass = _class; sClass; sClass = sClass->base)
3589 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3591 struct __ecereNameSpace__ecere__com__Class * nextClass;
3593 if(sClass->templateClass)
3594 sClass = sClass->templateClass;
3595 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3597 if(nextClass->templateClass)
3598 nextClass = nextClass->templateClass;
3599 p += nextClass->templateParams.count;
3601 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3603 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3605 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3607 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3608 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3622 char expString[1024];
3623 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3624 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3625 struct Expression * exp;
3626 char * string = PrintHexUInt64(arg.expression.ui64);
3628 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3629 ProcessExpressionType(exp);
3630 ComputeExpression(exp);
3631 expString[0] = '\0';
3632 PrintExpression(exp, expString);
3633 strcat(argument, expString);
3634 FreeExpression(exp);
3639 strcat(argument, arg.member->name);
3644 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3645 strcat(argument, arg.dataTypeString);
3652 strcat(templateString, ", ");
3653 if(lastParam != p - 1)
3655 strcat(templateString, param->name);
3656 strcat(templateString, " = ");
3658 strcat(templateString, argument);
3667 int len = strlen(templateString);
3669 if(templateString[len - 1] == '<')
3673 if(templateString[len - 1] == '>')
3674 templateString[len++] = ' ';
3675 templateString[len++] = '>';
3677 templateString[len++] = '\0';
3680 struct Context * context = SetupTemplatesContext(_class);
3684 type = ProcessTypeString(templateString, 0x0);
3686 FinishTemplatesContext(context);
3689 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3691 ProcessExpressionType(member->initializer->exp);
3692 if(!member->initializer->exp->expType)
3696 char expString[10240];
3698 expString[0] = '\0';
3699 PrintExpression(member->initializer->exp, expString);
3700 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3701 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3704 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3706 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible instance method %s\n", (((void *)0))), ident->string);
3709 else if(member->initializer)
3711 ProcessInitializer(member->initializer, type);
3718 if(_class && _class->type == 3)
3720 if(member->initializer)
3722 struct Type * type = MkClassType(_class->fullName);
3724 ProcessInitializer(member->initializer, type);
3730 if(member->initializer)
3732 ProcessInitializer(member->initializer, (((void *)0)));
3738 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3742 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3744 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3748 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3753 extern struct Identifier * GetDeclId(struct Declarator * decl);
3755 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);
3757 extern void FreeSpecifier(struct Specifier * spec);
3759 static void ProcessFunction(struct FunctionDefinition * function);
3761 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3763 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3765 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3767 extern void FreeClassFunction(struct ClassFunction * func);
3769 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3771 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3773 void ProcessInstantiationType(struct Instantiation * inst)
3778 struct MembersInit * members;
3779 struct Symbol * classSym;
3780 struct __ecereNameSpace__ecere__com__Class * _class;
3782 classSym = inst->_class->symbol;
3783 _class = classSym ? classSym->registered : (((void *)0));
3784 if(!_class || _class->type != 5)
3785 DeclareStruct(inst->_class->name, 0x0);
3786 afterExternal = afterExternal ? afterExternal : curExternal;
3788 ProcessExpressionType(inst->exp);
3789 inst->isConstant = 0x1;
3792 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3793 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3794 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3795 int subMemberStackPos = 0;
3797 for(members = (*inst->members).first; members; members = members->next)
3799 switch(members->type)
3804 static unsigned int instMethodID = 0;
3805 struct External * external = curExternal;
3806 struct Context * context = curContext;
3807 struct Declarator * declarator = members->function->declarator;
3808 struct Identifier * nameID = GetDeclId(declarator);
3809 char * unmangled = nameID ? nameID->string : (((void *)0));
3810 struct Expression * exp;
3811 struct External * createdExternal = (((void *)0));
3817 strcpy(name, "__ecereInstMeth_");
3818 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3820 strcat(name, nameID->string);
3822 sprintf(number, "_%08d", instMethodID++);
3823 strcat(name, number);
3824 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3828 struct Symbol * symbol = declarator->symbol;
3829 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3831 if(method && method->type == 1)
3833 symbol->method = method;
3834 ProcessMethodType(method);
3835 if(!symbol->type->thisClass)
3837 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3839 if(!currentClass->symbol)
3840 currentClass->symbol = FindClass(currentClass->fullName);
3841 symbol->type->thisClass = currentClass->symbol;
3846 _class->symbol = FindClass(_class->fullName);
3847 symbol->type->thisClass = _class->symbol;
3850 DeclareType(symbol->type, 0x1, 0x1);
3854 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3857 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3860 FreeSpecifier(nameID->_class);
3861 nameID->_class = (((void *)0));
3865 struct Type * type = declarator->symbol->type;
3866 struct External * oldExternal = curExternal;
3868 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3870 struct External * externalDecl;
3872 externalDecl = MkExternalDeclaration((((void *)0)));
3873 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3874 if(createdExternal->function)
3876 ProcessFunction(createdExternal->function);
3878 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3880 externalDecl->declaration = decl;
3881 if(decl->symbol && !decl->symbol->pointerExternal)
3882 decl->symbol->pointerExternal = externalDecl;
3883 declarator->symbol->pointerExternal = externalDecl;
3890 curExternal = declarator->symbol->pointerExternal;
3891 ProcessFunction((struct FunctionDefinition *)members->function);
3893 curExternal = external;
3894 curContext = context;
3897 FreeClassFunction(members->function);
3898 exp = QMkExpId(name);
3900 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3901 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3907 if(members->dataMembers && classSym)
3909 struct MemberInit * member;
3910 struct Location oldyyloc = yylloc;
3912 for(member = (*members->dataMembers).first; member; member = member->next)
3914 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3915 if(member->initializer && !member->initializer->isConstant)
3916 inst->isConstant = 0x0;
3928 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3932 if(type->kind == 11)
3934 struct Type * param;
3938 for(param = type->params.first; param; param = param->next)
3939 DeclareType(param, declarePointers, 0x1);
3941 DeclareType(type->returnType, declarePointers, 0x1);
3943 else if(type->kind == 13 && declarePointers)
3944 DeclareType(type->type, declarePointers, 0x0);
3945 else if(type->kind == 8)
3947 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3948 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3950 else if(type->kind == 9 || type->kind == 10)
3952 struct Type * member;
3954 for(member = type->members.first; member; member = member->next)
3955 DeclareType(member, 0x0, 0x0);
3957 else if(type->kind == 12)
3958 DeclareType(type->arrayType, declarePointers, 0x0);
3962 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3964 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3966 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3968 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3969 struct __ecereNameSpace__ecere__com__Class * sClass;
3971 for(sClass = _class; sClass; sClass = sClass->base)
3974 if(sClass->templateClass)
3975 sClass = sClass->templateClass;
3976 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3978 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3980 for(sClass = sClass->base; sClass; sClass = sClass->base)
3982 if(sClass->templateClass)
3983 sClass = sClass->templateClass;
3984 id += sClass->templateParams.count;
3995 arg = &_class->templateArgs[id];
3996 if(arg && param->type == 0)
3997 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4002 extern struct Context * PushContext(void);
4004 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4006 struct TemplatedType
4009 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4010 struct __ecereNameSpace__ecere__sys__BTNode * left;
4011 struct __ecereNameSpace__ecere__sys__BTNode * right;
4013 struct TemplateParameter * param;
4014 } __attribute__ ((gcc_struct));
4016 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4018 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4020 struct Context * context = PushContext();
4022 context->templateTypesOnly = 0x1;
4023 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4025 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4027 for(; param; param = param->next)
4029 if(param->type == 0 && param->identifier)
4031 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4033 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4039 struct __ecereNameSpace__ecere__com__Class * sClass;
4041 for(sClass = _class; sClass; sClass = sClass->base)
4043 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4045 for(p = sClass->templateParams.first; p; p = p->next)
4049 struct TemplateParameter * param = p->param;
4050 struct TemplatedType * type;
4054 p->param = param = __extension__ ({
4055 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4057 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4060 type = __extension__ ({
4061 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4063 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4065 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4073 extern void PopContext(struct Context * ctx);
4075 extern void FreeContext(struct Context * context);
4077 void FinishTemplatesContext(struct Context * context)
4079 PopContext(context);
4080 FreeContext(context);
4081 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4084 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4086 if(!method->dataType)
4088 struct Context * context = SetupTemplatesContext(method->_class);
4090 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4091 FinishTemplatesContext(context);
4092 if(method->type != 1 && method->dataType)
4094 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4096 if(!method->_class->symbol)
4097 method->_class->symbol = FindClass(method->_class->fullName);
4098 method->dataType->thisClass = method->_class->symbol;
4104 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4108 struct Context * context = SetupTemplatesContext(prop->_class);
4110 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4111 FinishTemplatesContext(context);
4115 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4117 extern void FreeTypeName(struct TypeName * typeName);
4119 static void ProcessDeclarator(struct Declarator * decl);
4121 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4123 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4127 struct MethodImport * prev;
4128 struct MethodImport * next;
4130 unsigned int isVirtual;
4131 } __attribute__ ((gcc_struct));
4133 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4135 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4137 struct Symbol * symbol = method->symbol;
4139 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4141 unsigned int imported = 0x0;
4142 unsigned int dllImport = 0x0;
4144 if(!method->dataType)
4145 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4146 if(!symbol || symbol->_import || method->type == 1)
4148 if(!symbol || method->type == 1)
4150 struct Symbol * classSym;
4152 if(!method->_class->symbol)
4153 method->_class->symbol = FindClass(method->_class->fullName);
4154 classSym = method->_class->symbol;
4155 if(!classSym->_import)
4157 struct ModuleImport * module;
4159 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4160 module = FindModule(method->_class->module);
4162 module = mainModule;
4163 classSym->_import = __extension__ ({
4164 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4166 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4168 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4172 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4174 if(!symbol->_import)
4176 symbol->_import = (struct ClassImport *)__extension__ ({
4177 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4179 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4181 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4185 symbol->type = method->dataType;
4187 symbol->type->refCount++;
4190 if(!method->dataType->dllExport)
4193 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4197 if(method->type != 1 && method->dataType)
4198 DeclareType(method->dataType, 0x1, 0x1);
4199 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4201 struct Declaration * decl;
4202 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4203 struct Declarator * d;
4204 struct Declarator * funcDecl;
4205 struct External * external;
4207 specifiers = MkList();
4208 declarators = MkList();
4210 ListAdd(specifiers, MkSpecifier(EXTERN));
4211 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4212 ListAdd(specifiers, MkSpecifier(STATIC));
4213 if(method->type == 1)
4215 ListAdd(specifiers, MkSpecifier(INT));
4216 d = MkDeclaratorIdentifier(MkIdentifier(name));
4220 d = MkDeclaratorIdentifier(MkIdentifier(name));
4222 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4224 struct Context * context = SetupTemplatesContext(method->_class);
4226 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4227 FinishTemplatesContext(context);
4229 funcDecl = GetFuncDecl(d);
4232 struct Specifier * spec, * next;
4234 for(spec = (*specifiers).first; spec; spec = next)
4239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4240 FreeSpecifier(spec);
4244 if(method->dataType && !method->dataType->staticMethod)
4246 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4248 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4249 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")));
4250 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4251 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4253 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4255 struct TypeName * param = (*funcDecl->function.parameters).first;
4257 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4258 FreeTypeName(param);
4260 if(!funcDecl->function.parameters)
4261 funcDecl->function.parameters = MkList();
4262 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4266 ProcessDeclarator(d);
4267 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4268 decl = MkDeclaration(specifiers, declarators);
4269 ReplaceThisClassSpecifiers(specifiers, method->_class);
4270 if(symbol->pointerExternal)
4272 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4275 *functionSymbol = *symbol;
4276 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4277 if(functionSymbol->type)
4278 functionSymbol->type->refCount++;
4280 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4281 symbol->pointerExternal->symbol = functionSymbol;
4283 external = MkExternalDeclaration(decl);
4285 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4286 external->symbol = symbol;
4287 symbol->pointerExternal = external;
4291 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4293 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4297 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4299 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4301 unsigned int first = 0x1;
4303 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4305 char className[1024];
4307 strcpy(className, _class->fullName);
4308 for(param = _class->templateParams.first; param; param = param->next)
4312 strcat(className, "<");
4314 strcat(className, ", ");
4315 if(lastParam + 1 != p)
4317 strcat(className, param->name);
4318 strcat(className, " = ");
4320 strcat(className, param->name);
4328 int len = strlen(className);
4330 if(className[len - 1] == '>')
4331 className[len++] = ' ';
4332 className[len++] = '>';
4333 className[len++] = '\0';
4335 return __ecereNameSpace__ecere__sys__CopyString(className);
4338 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4341 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4343 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4345 unsigned int first = 0x1;
4347 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4349 char className[1024];
4351 strcpy(className, _class->fullName);
4352 for(param = _class->templateParams.first; param; param = param->next)
4356 strcat(className, "<");
4358 strcat(className, ", ");
4359 if(lastParam + 1 != p)
4361 strcat(className, param->name);
4362 strcat(className, " = ");
4364 strcat(className, param->name);
4372 int len = strlen(className);
4374 if(className[len - 1] == '>')
4375 className[len++] = ' ';
4376 className[len++] = '>';
4377 className[len++] = '\0';
4379 return MkClassType(className);
4383 return MkClassType(_class->fullName);
4387 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4389 if(specs != (((void *)0)) && _class)
4391 struct Specifier * spec;
4393 for(spec = specs->first; spec; spec = spec->next)
4395 if(spec->type == 0 && spec->specifier == THISCLASS)
4398 spec->name = ReplaceThisClass(_class);
4399 spec->symbol = FindClass(spec->name);
4405 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4407 struct __ecereNameSpace__ecere__com__GlobalFunction
4409 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4410 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4413 struct __ecereNameSpace__ecere__com__Instance * module;
4414 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4415 char * dataTypeString;
4416 struct Type * dataType;
4418 } __attribute__ ((gcc_struct));
4420 extern struct Context * globalContext;
4422 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4424 struct FunctionImport
4426 struct FunctionImport * prev;
4427 struct FunctionImport * next;
4429 } __attribute__ ((gcc_struct));
4431 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4433 struct Symbol * symbol = function->symbol;
4435 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4437 unsigned int imported = 0x0;
4438 unsigned int dllImport = 0x0;
4440 if(!function->dataType)
4442 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4443 if(!function->dataType->thisClass)
4444 function->dataType->staticMethod = 0x1;
4450 struct ModuleImport * module = FindModule(function->module);
4452 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4455 if(!function->dataType->dllExport)
4457 symbol->_import = (struct ClassImport *)__extension__ ({
4458 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4460 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4462 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4466 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4467 if(!symbol->type->thisClass)
4468 symbol->type->staticMethod = 0x1;
4471 imported = symbol->_import ? 0x1 : 0x0;
4472 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4475 DeclareType(function->dataType, 0x1, 0x1);
4478 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4480 struct Declaration * decl;
4481 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4482 struct Declarator * d;
4483 struct Declarator * funcDecl;
4484 struct External * external;
4486 specifiers = MkList();
4487 declarators = MkList();
4488 ListAdd(specifiers, MkSpecifier(EXTERN));
4489 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4491 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4492 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4493 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4495 struct Specifier * spec;
4497 for(spec = (*specifiers).first; spec; spec = spec->next)
4498 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4500 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4501 FreeSpecifier(spec);
4505 funcDecl = GetFuncDecl(d);
4506 if(funcDecl && !funcDecl->function.parameters)
4508 funcDecl->function.parameters = MkList();
4509 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4511 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4513 struct Context * oldCtx = curContext;
4515 curContext = globalContext;
4516 decl = MkDeclaration(specifiers, declarators);
4517 curContext = oldCtx;
4519 if(symbol->pointerExternal)
4521 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4524 *functionSymbol = *symbol;
4525 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4526 if(functionSymbol->type)
4527 functionSymbol->type->refCount++;
4529 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4530 symbol->pointerExternal->symbol = functionSymbol;
4532 external = MkExternalDeclaration(decl);
4534 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4535 external->symbol = symbol;
4536 symbol->pointerExternal = external;
4540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4543 symbol->id = curExternal->symbol->idCode;
4546 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4549 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4554 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4555 struct __ecereNameSpace__ecere__sys__BTNode * left;
4556 struct __ecereNameSpace__ecere__sys__BTNode * right;
4558 struct __ecereNameSpace__ecere__com__Instance * module;
4559 char * dataTypeString;
4560 struct Type * dataType;
4563 } __attribute__ ((gcc_struct));
4565 void DeclareGlobalData(struct GlobalData * data)
4567 struct Symbol * symbol = data->symbol;
4569 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4574 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4577 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4578 DeclareType(data->dataType, 0x1, 0x1);
4581 if(!symbol->pointerExternal)
4583 struct Declaration * decl;
4584 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4585 struct Declarator * d;
4586 struct External * external;
4588 specifiers = MkList();
4589 declarators = MkList();
4590 ListAdd(specifiers, MkSpecifier(EXTERN));
4591 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4592 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4593 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4594 decl = MkDeclaration(specifiers, declarators);
4595 external = MkExternalDeclaration(decl);
4597 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4598 external->symbol = symbol;
4599 symbol->pointerExternal = external;
4603 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4606 symbol->id = curExternal->symbol->idCode;
4613 struct Conversion * prev, * next;
4614 struct __ecereNameSpace__ecere__com__Property * convert;
4616 struct Type * resultType;
4617 } __attribute__ ((gcc_struct));
4619 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4621 extern void Compiler_Warning(char * format, ...);
4623 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4625 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)
4629 if(source->kind == 20 && dest->kind != 20)
4631 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4636 if(dest->kind == 20 && source->kind != 20)
4638 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4643 if(dest->classObjectType == 2)
4645 if(source->classObjectType != 3)
4649 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4657 if(source->classObjectType == 3)
4659 if(dest->classObjectType == 3 && source->classObjectType != 2)
4662 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4664 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4667 if(dest->kind == 14 && source->kind != 0)
4669 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))
4671 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))
4673 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4675 if(source->_class->registered && source->_class->registered->type == 3)
4677 if(conversions != (((void *)0)))
4679 if(source->_class->registered == dest->_class->registered)
4684 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4686 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4688 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4690 if(sourceBase == destBase)
4694 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))
4698 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))
4700 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4707 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4711 if(source->kind == 8)
4713 struct __ecereNameSpace__ecere__com__Class * _class;
4715 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4717 struct __ecereNameSpace__ecere__com__Property * convert;
4719 for(convert = _class->conversions.first; convert; convert = convert->next)
4721 if(convert->memberAccess == 1 || _class->module == privateModule)
4723 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4725 if(!convert->dataType)
4726 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4727 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4729 if(!conversions && !convert->Get)
4731 else if(conversions != (((void *)0)))
4733 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))
4737 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4739 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4750 struct __ecereNameSpace__ecere__com__Class * _class;
4752 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4754 struct __ecereNameSpace__ecere__com__Property * convert;
4756 for(convert = _class->conversions.first; convert; convert = convert->next)
4758 if(convert->memberAccess == 1 || _class->module == privateModule)
4760 if(!convert->dataType)
4761 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4762 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4764 if(!conversions && !convert->Set)
4766 else if(conversions != (((void *)0)))
4768 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))
4772 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4774 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4782 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4784 if(!dest->_class->registered->dataType)
4785 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4786 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4788 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4795 if(source->kind == 8)
4797 struct __ecereNameSpace__ecere__com__Class * _class;
4799 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4801 struct __ecereNameSpace__ecere__com__Property * convert;
4803 for(convert = _class->conversions.first; convert; convert = convert->next)
4805 if(convert->memberAccess == 1 || _class->module == privateModule)
4807 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4809 if(!convert->dataType)
4810 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4811 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4813 if(!conversions && !convert->Get)
4815 else if(conversions != (((void *)0)))
4817 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))
4821 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4823 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4831 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4833 if(!source->_class->registered->dataType)
4834 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4835 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4842 if(source->kind == 8 || source->kind == 19)
4844 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4846 else if(dest->kind == 7 && source->kind == 6)
4848 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4850 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4852 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4854 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4856 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4858 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))
4860 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))
4862 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)))
4864 struct Type * paramSource, * paramDest;
4866 if(dest->kind == 16)
4867 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4868 if(source->kind == 16)
4869 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4870 if(dest->kind == 13 && dest->type->kind == 11)
4872 if(source->kind == 13 && source->type->kind == 11)
4873 source = source->type;
4874 if(dest->kind == 16)
4875 dest = dest->method->dataType;
4876 if(source->kind == 16)
4877 source = source->method->dataType;
4878 paramSource = source->params.first;
4879 if(paramSource && paramSource->kind == 0)
4880 paramSource = (((void *)0));
4881 paramDest = dest->params.first;
4882 if(paramDest && paramDest->kind == 0)
4883 paramDest = (((void *)0));
4884 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4886 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))))
4888 if(paramDest && paramDest->kind == 8)
4889 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class should not take an object\n", (((void *)0))));
4894 paramDest = paramDest->next;
4896 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4898 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4902 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4910 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "overriding class expected to be derived from method class\n", (((void *)0))));
4919 paramSource = paramSource->next;
4925 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4927 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4933 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4935 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4941 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4943 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible return type for function\n", (((void *)0))));
4946 for(; paramDest; paramDest = paramDest->next)
4950 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "not enough parameters\n", (((void *)0))));
4954 struct Type * paramDestType = paramDest;
4955 struct Type * paramSourceType = paramSource;
4956 struct Type * type = paramDestType;
4958 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4961 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4962 struct __ecereNameSpace__ecere__com__Class * sClass;
4964 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4967 if(sClass->templateClass)
4968 sClass = sClass->templateClass;
4969 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4971 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4973 for(sClass = sClass->base; sClass; sClass = sClass->base)
4975 if(sClass->templateClass)
4976 sClass = sClass->templateClass;
4977 id += sClass->templateParams.count;
4988 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4990 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4993 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)))
4998 PrintType(paramDest, type, 0x0, 0x1);
4999 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5000 if(paramDestType != paramDest)
5001 FreeType(paramDestType);
5004 if(paramDestType != paramDest)
5005 FreeType(paramDestType);
5007 paramSource = paramSource->next;
5011 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many parameters\n", (((void *)0))));
5016 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5020 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5022 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5029 static void FreeConvert(struct Conversion * convert)
5031 if(convert->resultType)
5032 FreeType(convert->resultType);
5035 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5037 struct __ecereNameSpace__ecere__com__BTNamedLink
5040 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5041 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5042 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5045 } __attribute__ ((gcc_struct));
5047 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5049 struct __ecereNameSpace__ecere__com__EnumClassData
5051 struct __ecereNameSpace__ecere__sys__OldList values;
5053 } __attribute__ ((gcc_struct));
5055 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5057 struct __ecereNameSpace__ecere__sys__NamedLink
5059 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5060 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5063 } __attribute__ ((gcc_struct));
5065 extern void FreeExpContents(struct Expression * exp);
5067 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5069 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5071 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5073 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5075 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5077 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5079 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5081 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)))
5083 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5085 if(_class->type == 4)
5087 struct __ecereNameSpace__ecere__sys__OldList converts =
5091 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5095 _class->symbol = FindClass(_class->fullName);
5096 type->_class = _class->symbol;
5097 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5099 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5100 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5104 struct __ecereNameSpace__ecere__com__Class * baseClass;
5106 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5108 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5110 for(value = e->values.first; value; value = value->next)
5112 if(!strcmp(value->name, string))
5117 FreeExpContents(sourceExp);
5118 FreeType(sourceExp->expType);
5119 sourceExp->isConstant = 0x1;
5120 sourceExp->expType = MkClassType(baseClass->fullName);
5124 sourceExp->type = 2;
5125 if(!strcmp(baseClass->dataTypeString, "int"))
5126 sprintf(constant, "%d", (int)value->data);
5128 sprintf(constant, "0x%X", (int)value->data);
5129 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5131 while(converts.first)
5133 struct Conversion * convert = converts.first;
5135 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5138 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5145 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5146 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5149 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)))
5150 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5155 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5157 struct __ecereNameSpace__ecere__com__SubModule
5159 struct __ecereNameSpace__ecere__com__SubModule * prev;
5160 struct __ecereNameSpace__ecere__com__SubModule * next;
5161 struct __ecereNameSpace__ecere__com__Instance * module;
5163 } __attribute__ ((gcc_struct));
5165 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5167 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5169 if(searchFor == searchIn)
5171 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5173 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5175 if(ModuleVisibility(subModule->module, searchFor))
5182 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5184 struct __ecereNameSpace__ecere__com__Application
5189 unsigned int isGUIApp;
5190 struct __ecereNameSpace__ecere__sys__OldList allModules;
5191 char * parsedCommand;
5192 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5193 } __attribute__ ((gcc_struct));
5195 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5197 struct __ecereNameSpace__ecere__com__Instance * module;
5199 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))
5201 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))
5203 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))
5205 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)
5207 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5213 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5215 void ReadString(char * output, char * string);
5217 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5219 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5221 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5223 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5225 struct Type * source = sourceExp->expType;
5226 struct Type * realDest = dest;
5227 struct Type * backupSourceExpType = (((void *)0));
5229 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5231 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5233 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5235 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5237 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5239 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5241 if(sourceBase == destBase)
5247 struct __ecereNameSpace__ecere__sys__OldList * specs;
5248 unsigned int flag = 0x0;
5249 long long value = (((int)0x7fffffff));
5253 if(sourceExp->type == 2)
5255 if(source->isSigned)
5256 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5258 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5260 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5262 if(source->isSigned)
5263 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5265 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5267 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5270 source = __extension__ ({
5271 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5273 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5278 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5280 if(_class && _class->type == 3)
5282 if(source->kind != 8)
5284 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5285 struct Type * tempDest, * tempSource;
5287 for(; _class->base->type != 1000; _class = _class->base)
5290 tempDest = tempType;
5293 _class->symbol = FindClass(_class->fullName);
5294 tempType->_class = _class->symbol;
5295 tempType->truth = dest->truth;
5296 if(tempType->_class)
5297 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5298 backupSourceExpType = sourceExp->expType;
5299 sourceExp->expType = dest;
5302 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5305 if(_class && _class->type == 2 && source->kind != 8)
5307 if(!dest->_class->registered->dataType)
5308 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5309 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5312 FreeType(sourceExp->expType);
5313 source = sourceExp->expType = MkClassType(dest->_class->string);
5317 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5319 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5320 struct Declarator * decl;
5323 ReadString(string, sourceExp->string);
5324 decl = SpecDeclFromString(string, specs, (((void *)0)));
5325 FreeExpContents(sourceExp);
5326 FreeType(sourceExp->expType);
5327 sourceExp->type = 26;
5328 sourceExp->_classExp.specifiers = specs;
5329 sourceExp->_classExp.decl = decl;
5330 sourceExp->expType = dest;
5334 if(backupSourceExpType)
5335 FreeType(backupSourceExpType);
5339 else if(source->kind == 8)
5341 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5343 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5347 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5348 struct Type * tempDest, * tempSource;
5350 if(!source->_class->registered->dataType)
5351 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5352 for(; _class->base->type != 1000; _class = _class->base)
5355 tempSource = tempType;
5357 tempType->_class = FindClass(_class->fullName);
5358 tempType->truth = source->truth;
5359 tempType->classObjectType = source->classObjectType;
5360 if(tempType->_class)
5361 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5362 if(conversions->last)
5364 ((struct Conversion *)conversions->last)->resultType = dest;
5367 FreeType(sourceExp->expType);
5368 sourceExp->expType = MkClassType(_class->fullName);
5369 sourceExp->expType->truth = source->truth;
5370 sourceExp->expType->classObjectType = source->classObjectType;
5371 if(!sourceExp->destType)
5373 FreeType(sourceExp->destType);
5374 sourceExp->destType = sourceExp->expType;
5375 if(sourceExp->expType)
5376 sourceExp->expType->refCount++;
5378 if(!_class->dataType)
5379 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5381 dest = MkClassType(source->_class->string);
5382 dest->truth = source->truth;
5383 dest->classObjectType = source->classObjectType;
5385 source = _class->dataType;
5387 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5393 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5402 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5404 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5406 if(_class->type == 0 || _class->type == 5)
5408 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5410 *newExp = *sourceExp;
5411 if(sourceExp->destType)
5412 sourceExp->destType->refCount++;
5413 if(sourceExp->expType)
5414 sourceExp->expType->refCount++;
5415 sourceExp->type = 11;
5416 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5417 sourceExp->cast.exp = newExp;
5418 FreeType(sourceExp->expType);
5419 sourceExp->expType = (((void *)0));
5420 ProcessExpressionType(sourceExp);
5423 FreeType(sourceExp->expType);
5424 sourceExp->expType = dest;
5429 if(backupSourceExpType)
5430 FreeType(backupSourceExpType);
5433 if(!_class->dataType)
5434 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5436 dest = _class->dataType;
5439 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))
5441 specs = MkListOne(MkSpecifier(DOUBLE));
5443 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))
5445 specs = MkListOne(MkSpecifier(FLOAT));
5447 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))
5451 ListAdd(specs, MkSpecifier(UNSIGNED));
5452 ListAdd(specs, MkSpecifier(INT64));
5454 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5458 ListAdd(specs, MkSpecifier(UNSIGNED));
5459 ListAdd(specs, MkSpecifier(INT));
5461 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5465 ListAdd(specs, MkSpecifier(UNSIGNED));
5466 ListAdd(specs, MkSpecifier(SHORT));
5468 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5472 ListAdd(specs, MkSpecifier(UNSIGNED));
5473 ListAdd(specs, MkSpecifier(CHAR));
5479 if(backupSourceExpType)
5481 if(sourceExp->expType)
5482 FreeType(sourceExp->expType);
5483 sourceExp->expType = backupSourceExpType;
5488 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))
5490 specs = MkListOne(MkSpecifier(DOUBLE));
5492 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))
5494 specs = MkListOne(MkSpecifier(FLOAT));
5496 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5499 ListAdd(specs, MkSpecifier(BOOL));
5501 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)))
5505 ListAdd(specs, MkSpecifier(UNSIGNED));
5506 ListAdd(specs, MkSpecifier(CHAR));
5508 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)))))
5512 ListAdd(specs, MkSpecifier(UNSIGNED));
5513 ListAdd(specs, MkSpecifier(SHORT));
5515 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5519 ListAdd(specs, MkSpecifier(UNSIGNED));
5520 ListAdd(specs, MkSpecifier(INT));
5522 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5526 ListAdd(specs, MkSpecifier(UNSIGNED));
5527 ListAdd(specs, MkSpecifier(INT64));
5529 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5531 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5537 if(backupSourceExpType)
5539 if(sourceExp->expType)
5540 FreeType(sourceExp->expType);
5541 sourceExp->expType = backupSourceExpType;
5547 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5549 *newExp = *sourceExp;
5550 newExp->prev = (((void *)0));
5551 newExp->next = (((void *)0));
5552 if(sourceExp->destType)
5553 sourceExp->destType->refCount++;
5554 if(sourceExp->expType)
5555 sourceExp->expType->refCount++;
5556 sourceExp->type = 11;
5557 if(realDest->kind == 8)
5559 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5560 FreeList(specs, FreeSpecifier);
5563 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5564 if(newExp->type == 4)
5566 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5569 sourceExp->cast.exp = newExp;
5570 FreeType(sourceExp->expType);
5571 sourceExp->expType = (((void *)0));
5572 ProcessExpressionType(sourceExp);
5575 FreeList(specs, FreeSpecifier);
5578 if(backupSourceExpType)
5579 FreeType(backupSourceExpType);
5584 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5585 sourceExp = (*sourceExp->list).last;
5586 if(sourceExp->type == 0)
5588 struct Identifier * id = sourceExp->identifier;
5592 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5594 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5595 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5599 for(; _class && _class->type == 4; _class = _class->base)
5601 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5602 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5604 for(value = e->values.first; value; value = value->next)
5606 if(!strcmp(value->name, id->string))
5611 FreeExpContents(sourceExp);
5612 FreeType(sourceExp->expType);
5613 sourceExp->isConstant = 0x1;
5614 sourceExp->expType = MkClassType(_class->fullName);
5618 sourceExp->type = 2;
5619 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5620 sprintf(constant, "%d", (int)value->data);
5622 sprintf(constant, "0x%X", (int)value->data);
5623 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5631 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5638 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5640 int value2 = op2->i;
5643 exp->string = PrintInt(op1->i + value2);
5646 exp->expType = op1->type;
5648 op1->type->refCount++;
5653 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5655 unsigned int value2 = op2->ui;
5658 exp->string = PrintUInt(op1->ui + value2);
5661 exp->expType = op1->type;
5663 op1->type->refCount++;
5668 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5670 int value2 = op2->i;
5673 exp->string = PrintInt64(op1->i + value2);
5676 exp->expType = op1->type;
5678 op1->type->refCount++;
5683 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5685 unsigned int value2 = op2->ui;
5688 exp->string = PrintUInt64(op1->ui + value2);
5691 exp->expType = op1->type;
5693 op1->type->refCount++;
5698 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5700 short value2 = op2->s;
5703 exp->string = PrintShort(op1->s + value2);
5706 exp->expType = op1->type;
5708 op1->type->refCount++;
5713 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5715 unsigned short value2 = op2->us;
5718 exp->string = PrintUShort(op1->us + value2);
5721 exp->expType = op1->type;
5723 op1->type->refCount++;
5728 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5730 char value2 = op2->c;
5733 exp->string = PrintChar(op1->c + value2);
5736 exp->expType = op1->type;
5738 op1->type->refCount++;
5743 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5745 unsigned char value2 = op2->uc;
5748 exp->string = PrintUChar(op1->uc + value2);
5751 exp->expType = op1->type;
5753 op1->type->refCount++;
5758 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5760 float value2 = op2->f;
5763 exp->string = PrintFloat(op1->f + value2);
5766 exp->expType = op1->type;
5768 op1->type->refCount++;
5773 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5775 double value2 = op2->d;
5778 exp->string = PrintDouble(op1->d + value2);
5781 exp->expType = op1->type;
5783 op1->type->refCount++;
5788 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5790 int value2 = op2->i;
5793 exp->string = PrintInt(op1->i - value2);
5796 exp->expType = op1->type;
5798 op1->type->refCount++;
5803 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5805 unsigned int value2 = op2->ui;
5808 exp->string = PrintUInt(op1->ui - value2);
5811 exp->expType = op1->type;
5813 op1->type->refCount++;
5818 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5820 int value2 = op2->i;
5823 exp->string = PrintInt64(op1->i - value2);
5826 exp->expType = op1->type;
5828 op1->type->refCount++;
5833 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5835 unsigned int value2 = op2->ui;
5838 exp->string = PrintUInt64(op1->ui - value2);
5841 exp->expType = op1->type;
5843 op1->type->refCount++;
5848 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5850 short value2 = op2->s;
5853 exp->string = PrintShort(op1->s - value2);
5856 exp->expType = op1->type;
5858 op1->type->refCount++;
5863 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5865 unsigned short value2 = op2->us;
5868 exp->string = PrintUShort(op1->us - value2);
5871 exp->expType = op1->type;
5873 op1->type->refCount++;
5878 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5880 char value2 = op2->c;
5883 exp->string = PrintChar(op1->c - value2);
5886 exp->expType = op1->type;
5888 op1->type->refCount++;
5893 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5895 unsigned char value2 = op2->uc;
5898 exp->string = PrintUChar(op1->uc - value2);
5901 exp->expType = op1->type;
5903 op1->type->refCount++;
5908 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5910 float value2 = op2->f;
5913 exp->string = PrintFloat(op1->f - value2);
5916 exp->expType = op1->type;
5918 op1->type->refCount++;
5923 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5925 double value2 = op2->d;
5928 exp->string = PrintDouble(op1->d - value2);
5931 exp->expType = op1->type;
5933 op1->type->refCount++;
5938 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5940 int value2 = op2->i;
5943 exp->string = PrintInt(op1->i * value2);
5946 exp->expType = op1->type;
5948 op1->type->refCount++;
5953 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5955 unsigned int value2 = op2->ui;
5958 exp->string = PrintUInt(op1->ui * value2);
5961 exp->expType = op1->type;
5963 op1->type->refCount++;
5968 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5970 int value2 = op2->i;
5973 exp->string = PrintInt64(op1->i * value2);
5976 exp->expType = op1->type;
5978 op1->type->refCount++;
5983 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5985 unsigned int value2 = op2->ui;
5988 exp->string = PrintUInt64(op1->ui * value2);
5991 exp->expType = op1->type;
5993 op1->type->refCount++;
5998 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6000 short value2 = op2->s;
6003 exp->string = PrintShort(op1->s * value2);
6006 exp->expType = op1->type;
6008 op1->type->refCount++;
6013 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6015 unsigned short value2 = op2->us;
6018 exp->string = PrintUShort(op1->us * value2);
6021 exp->expType = op1->type;
6023 op1->type->refCount++;
6028 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6030 char value2 = op2->c;
6033 exp->string = PrintChar(op1->c * value2);
6036 exp->expType = op1->type;
6038 op1->type->refCount++;
6043 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6045 unsigned char value2 = op2->uc;
6048 exp->string = PrintUChar(op1->uc * value2);
6051 exp->expType = op1->type;
6053 op1->type->refCount++;
6058 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6060 float value2 = op2->f;
6063 exp->string = PrintFloat(op1->f * value2);
6066 exp->expType = op1->type;
6068 op1->type->refCount++;
6073 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6075 double value2 = op2->d;
6078 exp->string = PrintDouble(op1->d * value2);
6081 exp->expType = op1->type;
6083 op1->type->refCount++;
6088 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6090 int value2 = op2->i;
6093 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6096 exp->expType = op1->type;
6098 op1->type->refCount++;
6103 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6105 unsigned int value2 = op2->ui;
6108 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6111 exp->expType = op1->type;
6113 op1->type->refCount++;
6118 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6120 int value2 = op2->i;
6123 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6126 exp->expType = op1->type;
6128 op1->type->refCount++;
6133 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6135 unsigned int value2 = op2->ui;
6138 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
6141 exp->expType = op1->type;
6143 op1->type->refCount++;
6148 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6150 short value2 = op2->s;
6153 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6156 exp->expType = op1->type;
6158 op1->type->refCount++;
6163 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6165 unsigned short value2 = op2->us;
6168 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6171 exp->expType = op1->type;
6173 op1->type->refCount++;
6178 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6180 char value2 = op2->c;
6183 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6186 exp->expType = op1->type;
6188 op1->type->refCount++;
6193 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6195 unsigned char value2 = op2->uc;
6198 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6201 exp->expType = op1->type;
6203 op1->type->refCount++;
6208 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6210 float value2 = op2->f;
6213 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6216 exp->expType = op1->type;
6218 op1->type->refCount++;
6223 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6225 double value2 = op2->d;
6228 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6231 exp->expType = op1->type;
6233 op1->type->refCount++;
6238 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6240 int value2 = op2->i;
6243 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6246 exp->expType = op1->type;
6248 op1->type->refCount++;
6253 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6255 unsigned int value2 = op2->ui;
6258 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6261 exp->expType = op1->type;
6263 op1->type->refCount++;
6268 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6270 int value2 = op2->i;
6273 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6276 exp->expType = op1->type;
6278 op1->type->refCount++;
6283 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6285 unsigned int value2 = op2->ui;
6288 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6291 exp->expType = op1->type;
6293 op1->type->refCount++;
6298 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6300 short value2 = op2->s;
6303 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6306 exp->expType = op1->type;
6308 op1->type->refCount++;
6313 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6315 unsigned short value2 = op2->us;
6318 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6321 exp->expType = op1->type;
6323 op1->type->refCount++;
6328 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6330 char value2 = op2->c;
6333 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6345 unsigned char value2 = op2->uc;
6348 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6351 exp->expType = op1->type;
6353 op1->type->refCount++;
6358 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6361 exp->string = PrintInt((-op1->i));
6364 exp->expType = op1->type;
6366 op1->type->refCount++;
6371 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6374 exp->string = PrintUInt((unsigned int)(-op1->ui));
6377 exp->expType = op1->type;
6379 op1->type->refCount++;
6384 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6387 exp->string = PrintInt64((-op1->i));
6390 exp->expType = op1->type;
6392 op1->type->refCount++;
6397 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6400 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6403 exp->expType = op1->type;
6405 op1->type->refCount++;
6410 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6413 exp->string = PrintShort((-op1->s));
6416 exp->expType = op1->type;
6418 op1->type->refCount++;
6423 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6426 exp->string = PrintUShort((unsigned short)(-op1->us));
6429 exp->expType = op1->type;
6431 op1->type->refCount++;
6436 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6439 exp->string = PrintChar((-op1->c));
6442 exp->expType = op1->type;
6444 op1->type->refCount++;
6449 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6452 exp->string = PrintUChar((unsigned char)(-op1->uc));
6455 exp->expType = op1->type;
6457 op1->type->refCount++;
6462 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6465 exp->string = PrintFloat((float)(-op1->f));
6468 exp->expType = op1->type;
6470 op1->type->refCount++;
6475 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6478 exp->string = PrintDouble((double)(-op1->d));
6481 exp->expType = op1->type;
6483 op1->type->refCount++;
6488 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6491 exp->string = PrintInt((++op1->i));
6494 exp->expType = op1->type;
6496 op1->type->refCount++;
6501 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6504 exp->string = PrintUInt((++op1->ui));
6507 exp->expType = op1->type;
6509 op1->type->refCount++;
6514 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6517 exp->string = PrintInt64((++op1->i));
6520 exp->expType = op1->type;
6522 op1->type->refCount++;
6527 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6530 exp->string = PrintUInt64((++op1->ui));
6533 exp->expType = op1->type;
6535 op1->type->refCount++;
6540 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6543 exp->string = PrintShort((++op1->s));
6546 exp->expType = op1->type;
6548 op1->type->refCount++;
6553 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6556 exp->string = PrintUShort((++op1->us));
6559 exp->expType = op1->type;
6561 op1->type->refCount++;
6566 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6569 exp->string = PrintChar((++op1->c));
6572 exp->expType = op1->type;
6574 op1->type->refCount++;
6579 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6582 exp->string = PrintUChar((++op1->uc));
6585 exp->expType = op1->type;
6587 op1->type->refCount++;
6592 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6595 exp->string = PrintFloat((float)(++op1->f));
6598 exp->expType = op1->type;
6600 op1->type->refCount++;
6605 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6608 exp->string = PrintDouble((double)(++op1->d));
6611 exp->expType = op1->type;
6613 op1->type->refCount++;
6618 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6621 exp->string = PrintInt((--op1->i));
6624 exp->expType = op1->type;
6626 op1->type->refCount++;
6631 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6634 exp->string = PrintUInt((--op1->ui));
6637 exp->expType = op1->type;
6639 op1->type->refCount++;
6644 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6647 exp->string = PrintInt64((--op1->i));
6650 exp->expType = op1->type;
6652 op1->type->refCount++;
6657 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6660 exp->string = PrintUInt64((--op1->ui));
6663 exp->expType = op1->type;
6665 op1->type->refCount++;
6670 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6673 exp->string = PrintShort((--op1->s));
6676 exp->expType = op1->type;
6678 op1->type->refCount++;
6683 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6686 exp->string = PrintUShort((--op1->us));
6689 exp->expType = op1->type;
6691 op1->type->refCount++;
6696 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6699 exp->string = PrintChar((--op1->c));
6702 exp->expType = op1->type;
6704 op1->type->refCount++;
6709 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6712 exp->string = PrintUChar((--op1->uc));
6715 exp->expType = op1->type;
6717 op1->type->refCount++;
6722 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6725 exp->string = PrintFloat((float)(--op1->f));
6728 exp->expType = op1->type;
6730 op1->type->refCount++;
6735 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6738 exp->string = PrintDouble((double)(--op1->d));
6741 exp->expType = op1->type;
6743 op1->type->refCount++;
6748 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6750 int value2 = op2->i;
6753 exp->string = PrintInt(op1->i = value2);
6756 exp->expType = op1->type;
6758 op1->type->refCount++;
6763 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6765 unsigned int value2 = op2->ui;
6768 exp->string = PrintUInt(op1->ui = value2);
6771 exp->expType = op1->type;
6773 op1->type->refCount++;
6778 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6780 int value2 = op2->i;
6783 exp->string = PrintInt64(op1->i = value2);
6786 exp->expType = op1->type;
6788 op1->type->refCount++;
6793 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6795 unsigned int value2 = op2->ui;
6798 exp->string = PrintUInt64(op1->ui = value2);
6801 exp->expType = op1->type;
6803 op1->type->refCount++;
6808 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6810 short value2 = op2->s;
6813 exp->string = PrintShort(op1->s = value2);
6816 exp->expType = op1->type;
6818 op1->type->refCount++;
6823 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6825 unsigned short value2 = op2->us;
6828 exp->string = PrintUShort(op1->us = value2);
6831 exp->expType = op1->type;
6833 op1->type->refCount++;
6838 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6840 char value2 = op2->c;
6843 exp->string = PrintChar(op1->c = value2);
6846 exp->expType = op1->type;
6848 op1->type->refCount++;
6853 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6855 unsigned char value2 = op2->uc;
6858 exp->string = PrintUChar(op1->uc = value2);
6861 exp->expType = op1->type;
6863 op1->type->refCount++;
6868 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6870 float value2 = op2->f;
6873 exp->string = PrintFloat(op1->f = value2);
6876 exp->expType = op1->type;
6878 op1->type->refCount++;
6883 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6885 double value2 = op2->d;
6888 exp->string = PrintDouble(op1->d = value2);
6891 exp->expType = op1->type;
6893 op1->type->refCount++;
6898 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6900 int value2 = op2->i;
6903 exp->string = PrintInt(op1->i += value2);
6906 exp->expType = op1->type;
6908 op1->type->refCount++;
6913 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6915 unsigned int value2 = op2->ui;
6918 exp->string = PrintUInt(op1->ui += value2);
6921 exp->expType = op1->type;
6923 op1->type->refCount++;
6928 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6930 int value2 = op2->i;
6933 exp->string = PrintInt64(op1->i += value2);
6936 exp->expType = op1->type;
6938 op1->type->refCount++;
6943 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6945 unsigned int value2 = op2->ui;
6948 exp->string = PrintUInt64(op1->ui += value2);
6951 exp->expType = op1->type;
6953 op1->type->refCount++;
6958 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6960 short value2 = op2->s;
6963 exp->string = PrintShort(op1->s += value2);
6966 exp->expType = op1->type;
6968 op1->type->refCount++;
6973 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6975 unsigned short value2 = op2->us;
6978 exp->string = PrintUShort(op1->us += value2);
6981 exp->expType = op1->type;
6983 op1->type->refCount++;
6988 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6990 char value2 = op2->c;
6993 exp->string = PrintChar(op1->c += value2);
6996 exp->expType = op1->type;
6998 op1->type->refCount++;
7003 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7005 unsigned char value2 = op2->uc;
7008 exp->string = PrintUChar(op1->uc += value2);
7011 exp->expType = op1->type;
7013 op1->type->refCount++;
7018 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7020 float value2 = op2->f;
7023 exp->string = PrintFloat(op1->f += value2);
7026 exp->expType = op1->type;
7028 op1->type->refCount++;
7033 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7035 double value2 = op2->d;
7038 exp->string = PrintDouble(op1->d += value2);
7041 exp->expType = op1->type;
7043 op1->type->refCount++;
7048 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7050 int value2 = op2->i;
7053 exp->string = PrintInt(op1->i -= value2);
7056 exp->expType = op1->type;
7058 op1->type->refCount++;
7063 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7065 unsigned int value2 = op2->ui;
7068 exp->string = PrintUInt(op1->ui -= value2);
7071 exp->expType = op1->type;
7073 op1->type->refCount++;
7078 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7080 int value2 = op2->i;
7083 exp->string = PrintInt64(op1->i -= value2);
7086 exp->expType = op1->type;
7088 op1->type->refCount++;
7093 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7095 unsigned int value2 = op2->ui;
7098 exp->string = PrintUInt64(op1->ui -= value2);
7101 exp->expType = op1->type;
7103 op1->type->refCount++;
7108 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7110 short value2 = op2->s;
7113 exp->string = PrintShort(op1->s -= value2);
7116 exp->expType = op1->type;
7118 op1->type->refCount++;
7123 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7125 unsigned short value2 = op2->us;
7128 exp->string = PrintUShort(op1->us -= value2);
7131 exp->expType = op1->type;
7133 op1->type->refCount++;
7138 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7140 char value2 = op2->c;
7143 exp->string = PrintChar(op1->c -= value2);
7146 exp->expType = op1->type;
7148 op1->type->refCount++;
7153 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7155 unsigned char value2 = op2->uc;
7158 exp->string = PrintUChar(op1->uc -= value2);
7161 exp->expType = op1->type;
7163 op1->type->refCount++;
7168 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7170 float value2 = op2->f;
7173 exp->string = PrintFloat(op1->f -= value2);
7176 exp->expType = op1->type;
7178 op1->type->refCount++;
7183 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7185 double value2 = op2->d;
7188 exp->string = PrintDouble(op1->d -= value2);
7191 exp->expType = op1->type;
7193 op1->type->refCount++;
7198 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7200 int value2 = op2->i;
7203 exp->string = PrintInt(op1->i *= value2);
7206 exp->expType = op1->type;
7208 op1->type->refCount++;
7213 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7215 unsigned int value2 = op2->ui;
7218 exp->string = PrintUInt(op1->ui *= value2);
7221 exp->expType = op1->type;
7223 op1->type->refCount++;
7228 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7230 int value2 = op2->i;
7233 exp->string = PrintInt64(op1->i *= value2);
7236 exp->expType = op1->type;
7238 op1->type->refCount++;
7243 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7245 unsigned int value2 = op2->ui;
7248 exp->string = PrintUInt64(op1->ui *= value2);
7251 exp->expType = op1->type;
7253 op1->type->refCount++;
7258 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7260 short value2 = op2->s;
7263 exp->string = PrintShort(op1->s *= value2);
7266 exp->expType = op1->type;
7268 op1->type->refCount++;
7273 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7275 unsigned short value2 = op2->us;
7278 exp->string = PrintUShort(op1->us *= value2);
7281 exp->expType = op1->type;
7283 op1->type->refCount++;
7288 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7290 char value2 = op2->c;
7293 exp->string = PrintChar(op1->c *= value2);
7296 exp->expType = op1->type;
7298 op1->type->refCount++;
7303 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7305 unsigned char value2 = op2->uc;
7308 exp->string = PrintUChar(op1->uc *= value2);
7311 exp->expType = op1->type;
7313 op1->type->refCount++;
7318 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7320 float value2 = op2->f;
7323 exp->string = PrintFloat(op1->f *= value2);
7326 exp->expType = op1->type;
7328 op1->type->refCount++;
7333 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7335 double value2 = op2->d;
7338 exp->string = PrintDouble(op1->d *= value2);
7341 exp->expType = op1->type;
7343 op1->type->refCount++;
7348 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7350 int value2 = op2->i;
7353 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7356 exp->expType = op1->type;
7358 op1->type->refCount++;
7363 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7365 unsigned int value2 = op2->ui;
7368 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7371 exp->expType = op1->type;
7373 op1->type->refCount++;
7378 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7380 int value2 = op2->i;
7383 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7386 exp->expType = op1->type;
7388 op1->type->refCount++;
7393 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7395 unsigned int value2 = op2->ui;
7398 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7401 exp->expType = op1->type;
7403 op1->type->refCount++;
7408 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7410 short value2 = op2->s;
7413 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7416 exp->expType = op1->type;
7418 op1->type->refCount++;
7423 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7425 unsigned short value2 = op2->us;
7428 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7431 exp->expType = op1->type;
7433 op1->type->refCount++;
7438 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7440 char value2 = op2->c;
7443 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7446 exp->expType = op1->type;
7448 op1->type->refCount++;
7453 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7455 unsigned char value2 = op2->uc;
7458 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7461 exp->expType = op1->type;
7463 op1->type->refCount++;
7468 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7470 float value2 = op2->f;
7473 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7476 exp->expType = op1->type;
7478 op1->type->refCount++;
7483 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7485 double value2 = op2->d;
7488 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7491 exp->expType = op1->type;
7493 op1->type->refCount++;
7498 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7500 int value2 = op2->i;
7503 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7506 exp->expType = op1->type;
7508 op1->type->refCount++;
7513 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7515 unsigned int value2 = op2->ui;
7518 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7521 exp->expType = op1->type;
7523 op1->type->refCount++;
7528 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7530 int value2 = op2->i;
7533 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7536 exp->expType = op1->type;
7538 op1->type->refCount++;
7543 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7545 unsigned int value2 = op2->ui;
7548 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7551 exp->expType = op1->type;
7553 op1->type->refCount++;
7558 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7560 short value2 = op2->s;
7563 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7566 exp->expType = op1->type;
7568 op1->type->refCount++;
7573 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7575 unsigned short value2 = op2->us;
7578 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7581 exp->expType = op1->type;
7583 op1->type->refCount++;
7588 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7590 char value2 = op2->c;
7593 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7596 exp->expType = op1->type;
7598 op1->type->refCount++;
7603 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7605 unsigned char value2 = op2->uc;
7608 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7611 exp->expType = op1->type;
7613 op1->type->refCount++;
7618 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7620 int value2 = op2->i;
7623 exp->string = PrintInt(op1->i & value2);
7626 exp->expType = op1->type;
7628 op1->type->refCount++;
7633 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7635 unsigned int value2 = op2->ui;
7638 exp->string = PrintUInt(op1->ui & value2);
7641 exp->expType = op1->type;
7643 op1->type->refCount++;
7648 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7650 int value2 = op2->i;
7653 exp->string = PrintInt64(op1->i & value2);
7656 exp->expType = op1->type;
7658 op1->type->refCount++;
7663 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7665 unsigned int value2 = op2->ui;
7668 exp->string = PrintUInt64(op1->ui & value2);
7671 exp->expType = op1->type;
7673 op1->type->refCount++;
7678 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7680 short value2 = op2->s;
7683 exp->string = PrintShort(op1->s & value2);
7686 exp->expType = op1->type;
7688 op1->type->refCount++;
7693 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7695 unsigned short value2 = op2->us;
7698 exp->string = PrintUShort(op1->us & value2);
7701 exp->expType = op1->type;
7703 op1->type->refCount++;
7708 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7710 char value2 = op2->c;
7713 exp->string = PrintChar(op1->c & value2);
7716 exp->expType = op1->type;
7718 op1->type->refCount++;
7723 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7725 unsigned char value2 = op2->uc;
7728 exp->string = PrintUChar(op1->uc & value2);
7731 exp->expType = op1->type;
7733 op1->type->refCount++;
7738 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7740 int value2 = op2->i;
7743 exp->string = PrintInt(op1->i | value2);
7746 exp->expType = op1->type;
7748 op1->type->refCount++;
7753 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7755 unsigned int value2 = op2->ui;
7758 exp->string = PrintUInt(op1->ui | value2);
7761 exp->expType = op1->type;
7763 op1->type->refCount++;
7768 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7770 int value2 = op2->i;
7773 exp->string = PrintInt64(op1->i | value2);
7776 exp->expType = op1->type;
7778 op1->type->refCount++;
7783 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7785 unsigned int value2 = op2->ui;
7788 exp->string = PrintUInt64(op1->ui | value2);
7791 exp->expType = op1->type;
7793 op1->type->refCount++;
7798 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7800 short value2 = op2->s;
7803 exp->string = PrintShort(op1->s | value2);
7806 exp->expType = op1->type;
7808 op1->type->refCount++;
7813 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7815 unsigned short value2 = op2->us;
7818 exp->string = PrintUShort(op1->us | value2);
7821 exp->expType = op1->type;
7823 op1->type->refCount++;
7828 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7830 char value2 = op2->c;
7833 exp->string = PrintChar(op1->c | value2);
7836 exp->expType = op1->type;
7838 op1->type->refCount++;
7843 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7845 unsigned char value2 = op2->uc;
7848 exp->string = PrintUChar(op1->uc | value2);
7851 exp->expType = op1->type;
7853 op1->type->refCount++;
7858 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7860 int value2 = op2->i;
7863 exp->string = PrintInt(op1->i ^ value2);
7866 exp->expType = op1->type;
7868 op1->type->refCount++;
7873 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7875 unsigned int value2 = op2->ui;
7878 exp->string = PrintUInt(op1->ui ^ value2);
7881 exp->expType = op1->type;
7883 op1->type->refCount++;
7888 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7890 int value2 = op2->i;
7893 exp->string = PrintInt64(op1->i ^ value2);
7896 exp->expType = op1->type;
7898 op1->type->refCount++;
7903 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7905 unsigned int value2 = op2->ui;
7908 exp->string = PrintUInt64(op1->ui ^ value2);
7911 exp->expType = op1->type;
7913 op1->type->refCount++;
7918 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7920 short value2 = op2->s;
7923 exp->string = PrintShort(op1->s ^ value2);
7926 exp->expType = op1->type;
7928 op1->type->refCount++;
7933 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7935 unsigned short value2 = op2->us;
7938 exp->string = PrintUShort(op1->us ^ value2);
7941 exp->expType = op1->type;
7943 op1->type->refCount++;
7948 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7950 char value2 = op2->c;
7953 exp->string = PrintChar(op1->c ^ value2);
7956 exp->expType = op1->type;
7958 op1->type->refCount++;
7963 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7965 unsigned char value2 = op2->uc;
7968 exp->string = PrintUChar(op1->uc ^ value2);
7971 exp->expType = op1->type;
7973 op1->type->refCount++;
7978 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7980 int value2 = op2->i;
7983 exp->string = PrintInt(op1->i << value2);
7986 exp->expType = op1->type;
7988 op1->type->refCount++;
7993 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7995 unsigned int value2 = op2->ui;
7998 exp->string = PrintUInt(op1->ui << value2);
8001 exp->expType = op1->type;
8003 op1->type->refCount++;
8008 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8010 int value2 = op2->i;
8013 exp->string = PrintInt64(op1->i << value2);
8016 exp->expType = op1->type;
8018 op1->type->refCount++;
8023 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8025 unsigned int value2 = op2->ui;
8028 exp->string = PrintUInt64(op1->ui << value2);
8031 exp->expType = op1->type;
8033 op1->type->refCount++;
8038 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8040 short value2 = op2->s;
8043 exp->string = PrintShort(op1->s << value2);
8046 exp->expType = op1->type;
8048 op1->type->refCount++;
8053 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8055 unsigned short value2 = op2->us;
8058 exp->string = PrintUShort(op1->us << value2);
8061 exp->expType = op1->type;
8063 op1->type->refCount++;
8068 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8070 char value2 = op2->c;
8073 exp->string = PrintChar(op1->c << value2);
8076 exp->expType = op1->type;
8078 op1->type->refCount++;
8083 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8085 unsigned char value2 = op2->uc;
8088 exp->string = PrintUChar(op1->uc << value2);
8091 exp->expType = op1->type;
8093 op1->type->refCount++;
8098 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8100 int value2 = op2->i;
8103 exp->string = PrintInt(op1->i >> value2);
8106 exp->expType = op1->type;
8108 op1->type->refCount++;
8113 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8115 unsigned int value2 = op2->ui;
8118 exp->string = PrintUInt(op1->ui >> value2);
8121 exp->expType = op1->type;
8123 op1->type->refCount++;
8128 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8130 int value2 = op2->i;
8133 exp->string = PrintInt64(op1->i >> value2);
8136 exp->expType = op1->type;
8138 op1->type->refCount++;
8143 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8145 unsigned int value2 = op2->ui;
8148 exp->string = PrintUInt64(op1->ui >> value2);
8151 exp->expType = op1->type;
8153 op1->type->refCount++;
8158 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8160 short value2 = op2->s;
8163 exp->string = PrintShort(op1->s >> value2);
8166 exp->expType = op1->type;
8168 op1->type->refCount++;
8173 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 unsigned short value2 = op2->us;
8178 exp->string = PrintUShort(op1->us >> value2);
8181 exp->expType = op1->type;
8183 op1->type->refCount++;
8188 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 char value2 = op2->c;
8193 exp->string = PrintChar(op1->c >> value2);
8196 exp->expType = op1->type;
8198 op1->type->refCount++;
8203 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 unsigned char value2 = op2->uc;
8208 exp->string = PrintUChar(op1->uc >> value2);
8211 exp->expType = op1->type;
8213 op1->type->refCount++;
8218 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8221 exp->string = PrintInt((~op1->i));
8224 exp->expType = op1->type;
8226 op1->type->refCount++;
8231 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8234 exp->string = PrintUInt((unsigned int)(~op1->ui));
8237 exp->expType = op1->type;
8239 op1->type->refCount++;
8244 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8247 exp->string = PrintInt64((~op1->i));
8250 exp->expType = op1->type;
8252 op1->type->refCount++;
8257 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8260 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8263 exp->expType = op1->type;
8265 op1->type->refCount++;
8270 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8273 exp->string = PrintShort((short)(~op1->s));
8276 exp->expType = op1->type;
8278 op1->type->refCount++;
8283 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8286 exp->string = PrintUShort((unsigned short)(~op1->us));
8289 exp->expType = op1->type;
8291 op1->type->refCount++;
8296 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8299 exp->string = PrintChar((char)(~op1->c));
8302 exp->expType = op1->type;
8304 op1->type->refCount++;
8309 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8312 exp->string = PrintUChar((unsigned char)(~op1->uc));
8315 exp->expType = op1->type;
8317 op1->type->refCount++;
8322 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 int value2 = op2->i;
8327 exp->string = PrintInt(op1->i &= value2);
8330 exp->expType = op1->type;
8332 op1->type->refCount++;
8337 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 unsigned int value2 = op2->ui;
8342 exp->string = PrintUInt(op1->ui &= value2);
8345 exp->expType = op1->type;
8347 op1->type->refCount++;
8352 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 int value2 = op2->i;
8357 exp->string = PrintInt64(op1->i &= value2);
8360 exp->expType = op1->type;
8362 op1->type->refCount++;
8367 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 unsigned int value2 = op2->ui;
8372 exp->string = PrintUInt64(op1->ui &= value2);
8375 exp->expType = op1->type;
8377 op1->type->refCount++;
8382 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 short value2 = op2->s;
8387 exp->string = PrintShort(op1->s &= value2);
8390 exp->expType = op1->type;
8392 op1->type->refCount++;
8397 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 unsigned short value2 = op2->us;
8402 exp->string = PrintUShort(op1->us &= value2);
8405 exp->expType = op1->type;
8407 op1->type->refCount++;
8412 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 char value2 = op2->c;
8417 exp->string = PrintChar(op1->c &= value2);
8420 exp->expType = op1->type;
8422 op1->type->refCount++;
8427 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 unsigned char value2 = op2->uc;
8432 exp->string = PrintUChar(op1->uc &= value2);
8435 exp->expType = op1->type;
8437 op1->type->refCount++;
8442 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 int value2 = op2->i;
8447 exp->string = PrintInt(op1->i |= value2);
8450 exp->expType = op1->type;
8452 op1->type->refCount++;
8457 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 unsigned int value2 = op2->ui;
8462 exp->string = PrintUInt(op1->ui |= value2);
8465 exp->expType = op1->type;
8467 op1->type->refCount++;
8472 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 int value2 = op2->i;
8477 exp->string = PrintInt64(op1->i |= value2);
8480 exp->expType = op1->type;
8482 op1->type->refCount++;
8487 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 unsigned int value2 = op2->ui;
8492 exp->string = PrintUInt64(op1->ui |= value2);
8495 exp->expType = op1->type;
8497 op1->type->refCount++;
8502 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 short value2 = op2->s;
8507 exp->string = PrintShort(op1->s |= value2);
8510 exp->expType = op1->type;
8512 op1->type->refCount++;
8517 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 unsigned short value2 = op2->us;
8522 exp->string = PrintUShort(op1->us |= value2);
8525 exp->expType = op1->type;
8527 op1->type->refCount++;
8532 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 char value2 = op2->c;
8537 exp->string = PrintChar(op1->c |= value2);
8540 exp->expType = op1->type;
8542 op1->type->refCount++;
8547 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 unsigned char value2 = op2->uc;
8552 exp->string = PrintUChar(op1->uc |= value2);
8555 exp->expType = op1->type;
8557 op1->type->refCount++;
8562 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 int value2 = op2->i;
8567 exp->string = PrintInt(op1->i ^= value2);
8570 exp->expType = op1->type;
8572 op1->type->refCount++;
8577 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 unsigned int value2 = op2->ui;
8582 exp->string = PrintUInt(op1->ui ^= value2);
8585 exp->expType = op1->type;
8587 op1->type->refCount++;
8592 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 int value2 = op2->i;
8597 exp->string = PrintInt64(op1->i ^= value2);
8600 exp->expType = op1->type;
8602 op1->type->refCount++;
8607 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 unsigned int value2 = op2->ui;
8612 exp->string = PrintUInt64(op1->ui ^= value2);
8615 exp->expType = op1->type;
8617 op1->type->refCount++;
8622 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 short value2 = op2->s;
8627 exp->string = PrintShort(op1->s ^= value2);
8630 exp->expType = op1->type;
8632 op1->type->refCount++;
8637 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8639 unsigned short value2 = op2->us;
8642 exp->string = PrintUShort(op1->us ^= value2);
8645 exp->expType = op1->type;
8647 op1->type->refCount++;
8652 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8654 char value2 = op2->c;
8657 exp->string = PrintChar(op1->c ^= value2);
8660 exp->expType = op1->type;
8662 op1->type->refCount++;
8667 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8669 unsigned char value2 = op2->uc;
8672 exp->string = PrintUChar(op1->uc ^= value2);
8675 exp->expType = op1->type;
8677 op1->type->refCount++;
8682 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 int value2 = op2->i;
8687 exp->string = PrintInt(op1->i <<= value2);
8690 exp->expType = op1->type;
8692 op1->type->refCount++;
8697 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 unsigned int value2 = op2->ui;
8702 exp->string = PrintUInt(op1->ui <<= value2);
8705 exp->expType = op1->type;
8707 op1->type->refCount++;
8712 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 int value2 = op2->i;
8717 exp->string = PrintInt64(op1->i <<= value2);
8720 exp->expType = op1->type;
8722 op1->type->refCount++;
8727 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 unsigned int value2 = op2->ui;
8732 exp->string = PrintUInt64(op1->ui <<= value2);
8735 exp->expType = op1->type;
8737 op1->type->refCount++;
8742 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 short value2 = op2->s;
8747 exp->string = PrintShort(op1->s <<= value2);
8750 exp->expType = op1->type;
8752 op1->type->refCount++;
8757 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 unsigned short value2 = op2->us;
8762 exp->string = PrintUShort(op1->us <<= value2);
8765 exp->expType = op1->type;
8767 op1->type->refCount++;
8772 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 char value2 = op2->c;
8777 exp->string = PrintChar(op1->c <<= value2);
8780 exp->expType = op1->type;
8782 op1->type->refCount++;
8787 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 unsigned char value2 = op2->uc;
8792 exp->string = PrintUChar(op1->uc <<= value2);
8795 exp->expType = op1->type;
8797 op1->type->refCount++;
8802 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 int value2 = op2->i;
8807 exp->string = PrintInt(op1->i >>= value2);
8810 exp->expType = op1->type;
8812 op1->type->refCount++;
8817 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 unsigned int value2 = op2->ui;
8822 exp->string = PrintUInt(op1->ui >>= value2);
8825 exp->expType = op1->type;
8827 op1->type->refCount++;
8832 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 int value2 = op2->i;
8837 exp->string = PrintInt64(op1->i >>= value2);
8840 exp->expType = op1->type;
8842 op1->type->refCount++;
8847 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 unsigned int value2 = op2->ui;
8852 exp->string = PrintUInt64(op1->ui >>= value2);
8855 exp->expType = op1->type;
8857 op1->type->refCount++;
8862 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 short value2 = op2->s;
8867 exp->string = PrintShort(op1->s >>= value2);
8870 exp->expType = op1->type;
8872 op1->type->refCount++;
8877 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 unsigned short value2 = op2->us;
8882 exp->string = PrintUShort(op1->us >>= value2);
8885 exp->expType = op1->type;
8887 op1->type->refCount++;
8892 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 char value2 = op2->c;
8897 exp->string = PrintChar(op1->c >>= value2);
8900 exp->expType = op1->type;
8902 op1->type->refCount++;
8907 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 unsigned char value2 = op2->uc;
8912 exp->string = PrintUChar(op1->uc >>= value2);
8915 exp->expType = op1->type;
8917 op1->type->refCount++;
8922 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8925 exp->string = PrintInt((int)(!op1->i));
8928 exp->expType = op1->type;
8930 op1->type->refCount++;
8935 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8938 exp->string = PrintUInt((unsigned int)(!op1->ui));
8941 exp->expType = op1->type;
8943 op1->type->refCount++;
8948 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8951 exp->string = PrintInt64((int)(!op1->i));
8954 exp->expType = op1->type;
8956 op1->type->refCount++;
8961 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8964 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8967 exp->expType = op1->type;
8969 op1->type->refCount++;
8974 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8977 exp->string = PrintShort((short)(!op1->s));
8980 exp->expType = op1->type;
8982 op1->type->refCount++;
8987 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8990 exp->string = PrintUShort((unsigned short)(!op1->us));
8993 exp->expType = op1->type;
8995 op1->type->refCount++;
9000 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9003 exp->string = PrintChar((char)(!op1->c));
9006 exp->expType = op1->type;
9008 op1->type->refCount++;
9013 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9016 exp->string = PrintUChar((unsigned char)(!op1->uc));
9019 exp->expType = op1->type;
9021 op1->type->refCount++;
9026 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9028 int value2 = op2->i;
9031 exp->string = PrintInt(op1->i == value2);
9034 exp->expType = op1->type;
9036 op1->type->refCount++;
9041 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9043 unsigned int value2 = op2->ui;
9046 exp->string = PrintUInt(op1->ui == value2);
9049 exp->expType = op1->type;
9051 op1->type->refCount++;
9056 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9058 int value2 = op2->i;
9061 exp->string = PrintInt64(op1->i == value2);
9064 exp->expType = op1->type;
9066 op1->type->refCount++;
9071 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9073 unsigned int value2 = op2->ui;
9076 exp->string = PrintUInt64(op1->ui == value2);
9079 exp->expType = op1->type;
9081 op1->type->refCount++;
9086 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9088 short value2 = op2->s;
9091 exp->string = PrintShort(op1->s == value2);
9094 exp->expType = op1->type;
9096 op1->type->refCount++;
9101 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9103 unsigned short value2 = op2->us;
9106 exp->string = PrintUShort(op1->us == value2);
9109 exp->expType = op1->type;
9111 op1->type->refCount++;
9116 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9118 char value2 = op2->c;
9121 exp->string = PrintChar(op1->c == value2);
9124 exp->expType = op1->type;
9126 op1->type->refCount++;
9131 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9133 unsigned char value2 = op2->uc;
9136 exp->string = PrintUChar(op1->uc == value2);
9139 exp->expType = op1->type;
9141 op1->type->refCount++;
9146 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9148 float value2 = op2->f;
9151 exp->string = PrintFloat(op1->f == value2);
9154 exp->expType = op1->type;
9156 op1->type->refCount++;
9161 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9163 double value2 = op2->d;
9166 exp->string = PrintDouble(op1->d == value2);
9169 exp->expType = op1->type;
9171 op1->type->refCount++;
9176 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9178 int value2 = op2->i;
9181 exp->string = PrintInt(op1->i != value2);
9184 exp->expType = op1->type;
9186 op1->type->refCount++;
9191 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9193 unsigned int value2 = op2->ui;
9196 exp->string = PrintUInt(op1->ui != value2);
9199 exp->expType = op1->type;
9201 op1->type->refCount++;
9206 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9208 int value2 = op2->i;
9211 exp->string = PrintInt64(op1->i != value2);
9214 exp->expType = op1->type;
9216 op1->type->refCount++;
9221 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9223 unsigned int value2 = op2->ui;
9226 exp->string = PrintUInt64(op1->ui != value2);
9229 exp->expType = op1->type;
9231 op1->type->refCount++;
9236 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9238 short value2 = op2->s;
9241 exp->string = PrintShort(op1->s != value2);
9244 exp->expType = op1->type;
9246 op1->type->refCount++;
9251 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9253 unsigned short value2 = op2->us;
9256 exp->string = PrintUShort(op1->us != value2);
9259 exp->expType = op1->type;
9261 op1->type->refCount++;
9266 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9268 char value2 = op2->c;
9271 exp->string = PrintChar(op1->c != value2);
9274 exp->expType = op1->type;
9276 op1->type->refCount++;
9281 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9283 unsigned char value2 = op2->uc;
9286 exp->string = PrintUChar(op1->uc != value2);
9289 exp->expType = op1->type;
9291 op1->type->refCount++;
9296 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9298 float value2 = op2->f;
9301 exp->string = PrintFloat(op1->f != value2);
9304 exp->expType = op1->type;
9306 op1->type->refCount++;
9311 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9313 double value2 = op2->d;
9316 exp->string = PrintDouble(op1->d != value2);
9319 exp->expType = op1->type;
9321 op1->type->refCount++;
9326 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9328 int value2 = op2->i;
9331 exp->string = PrintInt(op1->i && value2);
9334 exp->expType = op1->type;
9336 op1->type->refCount++;
9341 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9343 unsigned int value2 = op2->ui;
9346 exp->string = PrintUInt(op1->ui && value2);
9349 exp->expType = op1->type;
9351 op1->type->refCount++;
9356 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9358 int value2 = op2->i;
9361 exp->string = PrintInt64(op1->i && value2);
9364 exp->expType = op1->type;
9366 op1->type->refCount++;
9371 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9373 unsigned int value2 = op2->ui;
9376 exp->string = PrintUInt64(op1->ui && value2);
9379 exp->expType = op1->type;
9381 op1->type->refCount++;
9386 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9388 short value2 = op2->s;
9391 exp->string = PrintShort(op1->s && value2);
9394 exp->expType = op1->type;
9396 op1->type->refCount++;
9401 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9403 unsigned short value2 = op2->us;
9406 exp->string = PrintUShort(op1->us && value2);
9409 exp->expType = op1->type;
9411 op1->type->refCount++;
9416 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9418 char value2 = op2->c;
9421 exp->string = PrintChar(op1->c && value2);
9424 exp->expType = op1->type;
9426 op1->type->refCount++;
9431 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9433 unsigned char value2 = op2->uc;
9436 exp->string = PrintUChar(op1->uc && value2);
9439 exp->expType = op1->type;
9441 op1->type->refCount++;
9446 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9448 float value2 = op2->f;
9451 exp->string = PrintFloat(op1->f && value2);
9454 exp->expType = op1->type;
9456 op1->type->refCount++;
9461 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9463 double value2 = op2->d;
9466 exp->string = PrintDouble(op1->d && value2);
9469 exp->expType = op1->type;
9471 op1->type->refCount++;
9476 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9478 int value2 = op2->i;
9481 exp->string = PrintInt(op1->i || value2);
9484 exp->expType = op1->type;
9486 op1->type->refCount++;
9491 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9493 unsigned int value2 = op2->ui;
9496 exp->string = PrintUInt(op1->ui || value2);
9499 exp->expType = op1->type;
9501 op1->type->refCount++;
9506 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9508 int value2 = op2->i;
9511 exp->string = PrintInt64(op1->i || value2);
9514 exp->expType = op1->type;
9516 op1->type->refCount++;
9521 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9523 unsigned int value2 = op2->ui;
9526 exp->string = PrintUInt64(op1->ui || value2);
9529 exp->expType = op1->type;
9531 op1->type->refCount++;
9536 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9538 short value2 = op2->s;
9541 exp->string = PrintShort(op1->s || value2);
9544 exp->expType = op1->type;
9546 op1->type->refCount++;
9551 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9553 unsigned short value2 = op2->us;
9556 exp->string = PrintUShort(op1->us || value2);
9559 exp->expType = op1->type;
9561 op1->type->refCount++;
9566 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9568 char value2 = op2->c;
9571 exp->string = PrintChar(op1->c || value2);
9574 exp->expType = op1->type;
9576 op1->type->refCount++;
9581 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9583 unsigned char value2 = op2->uc;
9586 exp->string = PrintUChar(op1->uc || value2);
9589 exp->expType = op1->type;
9591 op1->type->refCount++;
9596 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9598 float value2 = op2->f;
9601 exp->string = PrintFloat(op1->f || value2);
9604 exp->expType = op1->type;
9606 op1->type->refCount++;
9611 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9613 double value2 = op2->d;
9616 exp->string = PrintDouble(op1->d || value2);
9619 exp->expType = op1->type;
9621 op1->type->refCount++;
9626 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9628 int value2 = op2->i;
9631 exp->string = PrintInt(op1->i > value2);
9634 exp->expType = op1->type;
9636 op1->type->refCount++;
9641 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9643 unsigned int value2 = op2->ui;
9646 exp->string = PrintUInt(op1->ui > value2);
9649 exp->expType = op1->type;
9651 op1->type->refCount++;
9656 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9658 int value2 = op2->i;
9661 exp->string = PrintInt64(op1->i > value2);
9664 exp->expType = op1->type;
9666 op1->type->refCount++;
9671 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9673 unsigned int value2 = op2->ui;
9676 exp->string = PrintUInt64(op1->ui > value2);
9679 exp->expType = op1->type;
9681 op1->type->refCount++;
9686 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9688 short value2 = op2->s;
9691 exp->string = PrintShort(op1->s > value2);
9694 exp->expType = op1->type;
9696 op1->type->refCount++;
9701 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9703 unsigned short value2 = op2->us;
9706 exp->string = PrintUShort(op1->us > value2);
9709 exp->expType = op1->type;
9711 op1->type->refCount++;
9716 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9718 char value2 = op2->c;
9721 exp->string = PrintChar(op1->c > value2);
9724 exp->expType = op1->type;
9726 op1->type->refCount++;
9731 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9733 unsigned char value2 = op2->uc;
9736 exp->string = PrintUChar(op1->uc > value2);
9739 exp->expType = op1->type;
9741 op1->type->refCount++;
9746 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9748 float value2 = op2->f;
9751 exp->string = PrintFloat(op1->f > value2);
9754 exp->expType = op1->type;
9756 op1->type->refCount++;
9761 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9763 double value2 = op2->d;
9766 exp->string = PrintDouble(op1->d > value2);
9769 exp->expType = op1->type;
9771 op1->type->refCount++;
9776 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9778 int value2 = op2->i;
9781 exp->string = PrintInt(op1->i < value2);
9784 exp->expType = op1->type;
9786 op1->type->refCount++;
9791 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9793 unsigned int value2 = op2->ui;
9796 exp->string = PrintUInt(op1->ui < value2);
9799 exp->expType = op1->type;
9801 op1->type->refCount++;
9806 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9808 int value2 = op2->i;
9811 exp->string = PrintInt64(op1->i < value2);
9814 exp->expType = op1->type;
9816 op1->type->refCount++;
9821 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9823 unsigned int value2 = op2->ui;
9826 exp->string = PrintUInt64(op1->ui < value2);
9829 exp->expType = op1->type;
9831 op1->type->refCount++;
9836 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9838 short value2 = op2->s;
9841 exp->string = PrintShort(op1->s < value2);
9844 exp->expType = op1->type;
9846 op1->type->refCount++;
9851 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9853 unsigned short value2 = op2->us;
9856 exp->string = PrintUShort(op1->us < value2);
9859 exp->expType = op1->type;
9861 op1->type->refCount++;
9866 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9868 char value2 = op2->c;
9871 exp->string = PrintChar(op1->c < value2);
9874 exp->expType = op1->type;
9876 op1->type->refCount++;
9881 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9883 unsigned char value2 = op2->uc;
9886 exp->string = PrintUChar(op1->uc < value2);
9889 exp->expType = op1->type;
9891 op1->type->refCount++;
9896 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9898 float value2 = op2->f;
9901 exp->string = PrintFloat(op1->f < value2);
9904 exp->expType = op1->type;
9906 op1->type->refCount++;
9911 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9913 double value2 = op2->d;
9916 exp->string = PrintDouble(op1->d < value2);
9919 exp->expType = op1->type;
9921 op1->type->refCount++;
9926 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9928 int value2 = op2->i;
9931 exp->string = PrintInt(op1->i >= value2);
9934 exp->expType = op1->type;
9936 op1->type->refCount++;
9941 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9943 unsigned int value2 = op2->ui;
9946 exp->string = PrintUInt(op1->ui >= value2);
9949 exp->expType = op1->type;
9951 op1->type->refCount++;
9956 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9958 int value2 = op2->i;
9961 exp->string = PrintInt64(op1->i >= value2);
9964 exp->expType = op1->type;
9966 op1->type->refCount++;
9971 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9973 unsigned int value2 = op2->ui;
9976 exp->string = PrintUInt64(op1->ui >= value2);
9979 exp->expType = op1->type;
9981 op1->type->refCount++;
9986 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9988 short value2 = op2->s;
9991 exp->string = PrintShort(op1->s >= value2);
9994 exp->expType = op1->type;
9996 op1->type->refCount++;
10001 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10003 unsigned short value2 = op2->us;
10006 exp->string = PrintUShort(op1->us >= value2);
10009 exp->expType = op1->type;
10011 op1->type->refCount++;
10016 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10018 char value2 = op2->c;
10021 exp->string = PrintChar(op1->c >= value2);
10024 exp->expType = op1->type;
10026 op1->type->refCount++;
10031 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10033 unsigned char value2 = op2->uc;
10036 exp->string = PrintUChar(op1->uc >= value2);
10039 exp->expType = op1->type;
10041 op1->type->refCount++;
10046 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10048 float value2 = op2->f;
10051 exp->string = PrintFloat(op1->f >= value2);
10054 exp->expType = op1->type;
10056 op1->type->refCount++;
10061 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10063 double value2 = op2->d;
10066 exp->string = PrintDouble(op1->d >= value2);
10069 exp->expType = op1->type;
10071 op1->type->refCount++;
10076 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10078 int value2 = op2->i;
10081 exp->string = PrintInt(op1->i <= value2);
10084 exp->expType = op1->type;
10086 op1->type->refCount++;
10091 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10093 unsigned int value2 = op2->ui;
10096 exp->string = PrintUInt(op1->ui <= value2);
10099 exp->expType = op1->type;
10101 op1->type->refCount++;
10106 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10108 int value2 = op2->i;
10111 exp->string = PrintInt64(op1->i <= value2);
10114 exp->expType = op1->type;
10116 op1->type->refCount++;
10121 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10123 unsigned int value2 = op2->ui;
10126 exp->string = PrintUInt64(op1->ui <= value2);
10129 exp->expType = op1->type;
10131 op1->type->refCount++;
10136 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10138 short value2 = op2->s;
10141 exp->string = PrintShort(op1->s <= value2);
10144 exp->expType = op1->type;
10146 op1->type->refCount++;
10151 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10153 unsigned short value2 = op2->us;
10156 exp->string = PrintUShort(op1->us <= value2);
10159 exp->expType = op1->type;
10161 op1->type->refCount++;
10166 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10168 char value2 = op2->c;
10171 exp->string = PrintChar(op1->c <= value2);
10174 exp->expType = op1->type;
10176 op1->type->refCount++;
10181 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10183 unsigned char value2 = op2->uc;
10186 exp->string = PrintUChar(op1->uc <= value2);
10189 exp->expType = op1->type;
10191 op1->type->refCount++;
10196 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10198 float value2 = op2->f;
10201 exp->string = PrintFloat(op1->f <= value2);
10204 exp->expType = op1->type;
10206 op1->type->refCount++;
10211 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10213 double value2 = op2->d;
10216 exp->string = PrintDouble(op1->d <= value2);
10219 exp->expType = op1->type;
10221 op1->type->refCount++;
10226 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10229 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10232 exp->expType = op1->type;
10234 op1->type->refCount++;
10239 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10242 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10245 exp->expType = op1->type;
10247 op1->type->refCount++;
10252 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10255 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10258 exp->expType = op1->type;
10260 op1->type->refCount++;
10265 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10268 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10271 exp->expType = op1->type;
10273 op1->type->refCount++;
10278 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10281 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10284 exp->expType = op1->type;
10286 op1->type->refCount++;
10291 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10294 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10297 exp->expType = op1->type;
10299 op1->type->refCount++;
10304 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10307 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10310 exp->expType = op1->type;
10312 op1->type->refCount++;
10317 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10320 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10323 exp->expType = op1->type;
10325 op1->type->refCount++;
10330 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10333 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10336 exp->expType = op1->type;
10338 op1->type->refCount++;
10343 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10346 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10349 exp->expType = op1->type;
10351 op1->type->refCount++;
10356 struct OpTable intOps =
10358 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
10361 struct OpTable uintOps =
10363 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
10366 struct OpTable int64Ops =
10368 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
10371 struct OpTable uint64Ops =
10373 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
10376 struct OpTable shortOps =
10378 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
10381 struct OpTable ushortOps =
10383 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
10386 struct OpTable floatOps =
10388 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
10391 struct OpTable doubleOps =
10393 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
10396 struct OpTable charOps =
10398 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
10401 struct OpTable ucharOps =
10403 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
10406 void ReadString(char * output, char * string)
10408 int len = strlen(string);
10410 unsigned int quoted = 0x0, escaped = 0x0;
10412 for(c = 0; c < len; c++)
10414 char ch = string[c];
10448 output[d++] = '\\';
10470 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10472 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10474 extern double strtod(char * , char * * );
10476 struct Operand GetOperand(struct Expression * exp)
10478 struct Operand op =
10482 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
10485 struct Type * type = exp->expType;
10489 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10491 if(!type->_class->registered->dataType)
10492 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10493 type = type->_class->registered->dataType;
10495 op.kind = type->kind;
10496 op.type = exp->expType;
10497 if(exp->isConstant && exp->type == 2)
10504 if(exp->constant[0] == '\'')
10505 op.c = exp->constant[1];
10506 else if(type->isSigned)
10508 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10513 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10521 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10526 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10527 op.ops = ushortOps;
10534 op.i = strtol(exp->constant, (((void *)0)), 0);
10539 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10547 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10552 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10560 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10565 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10566 op.ops = uint64Ops;
10573 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10578 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10579 op.ops = uint64Ops;
10584 op.f = (float)strtod(exp->constant, (((void *)0)));
10588 op.d = (double)strtod(exp->constant, (((void *)0)));
10589 op.ops = doubleOps;
10594 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10604 int __ecereVMethodID_class_OnGetString;
10606 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10608 static void UnusedFunction()
10612 ((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);
10615 extern int __ecereVMethodID_class_OnGetString;
10617 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10619 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10621 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10623 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10624 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10627 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10628 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10629 struct Type * type;
10630 void * ptr = inst->data + dataMember->offset + offset;
10631 char * result = (((void *)0));
10633 exp->loc = member->loc = inst->loc;
10634 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10635 if(!dataMember->dataType)
10636 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10637 type = dataMember->dataType;
10638 if(type->kind == 8)
10640 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10642 if(_class->type == 4)
10644 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10648 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10649 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10651 for(item = e->values.first; item; item = item->next)
10653 if((int)item->data == *(int *)ptr)
10655 result = item->name;
10661 exp->identifier = MkIdentifier(result);
10663 exp->destType = MkClassType(_class->fullName);
10664 ProcessExpressionType(exp);
10668 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10670 if(!_class->dataType)
10671 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10672 type = _class->dataType;
10681 FreeExpContents(exp);
10682 exp->constant = PrintFloat(*(float *)ptr);
10688 FreeExpContents(exp);
10689 exp->constant = PrintDouble(*(double *)ptr);
10695 FreeExpContents(exp);
10696 exp->constant = PrintInt(*(int *)ptr);
10702 FreeExpContents(exp);
10703 exp->constant = PrintInt64(*(long long *)ptr);
10709 FreeExpContents(exp);
10710 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10716 FreeExpContents(exp);
10717 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10722 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10725 ListAdd(memberList, member);
10727 if(parentDataMember->type == 1)
10732 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10734 void PopulateInstance(struct Instantiation * inst)
10736 struct Symbol * classSym = inst->_class->symbol;
10737 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10738 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10739 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10742 inst->members = MkListOne(MkMembersInitList(memberList));
10744 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10745 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10747 if(!dataMember->isProperty)
10749 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10750 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10753 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10754 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10755 struct Type * type;
10756 void * ptr = inst->data + dataMember->offset;
10757 char * result = (((void *)0));
10759 exp->loc = member->loc = inst->loc;
10760 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10761 if(!dataMember->dataType)
10762 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10763 type = dataMember->dataType;
10764 if(type->kind == 8)
10766 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10768 if(_class->type == 4)
10770 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10774 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10775 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10777 for(item = e->values.first; item; item = item->next)
10779 if((int)item->data == *(int *)ptr)
10781 result = item->name;
10788 exp->identifier = MkIdentifier(result);
10790 exp->destType = MkClassType(_class->fullName);
10791 ProcessExpressionType(exp);
10794 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10796 if(!_class->dataType)
10797 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10798 type = _class->dataType;
10807 exp->constant = PrintFloat(*(float *)ptr);
10813 exp->constant = PrintDouble(*(double *)ptr);
10819 exp->constant = PrintInt(*(int *)ptr);
10825 exp->constant = PrintInt64(*(long long *)ptr);
10831 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10836 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unhandled type populating instance\n", (((void *)0))));
10839 ListAdd(memberList, member);
10845 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);
10847 extern void FreeInstance(struct Instantiation * inst);
10849 void ComputeInstantiation(struct Expression * exp)
10851 struct Instantiation * inst = exp->instance;
10852 struct MembersInit * members;
10853 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10854 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10855 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10856 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10857 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10858 int subMemberStackPos = 0;
10861 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10865 if(_class->type == 0 || _class->type == 5)
10867 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10868 if(_class->type == 0)
10869 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10872 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10876 for(members = (*inst->members).first; members; members = members->next)
10878 switch(members->type)
10882 if(members->dataMembers)
10884 struct MemberInit * member;
10886 for(member = (*members->dataMembers).first; member; member = member->next)
10888 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10889 unsigned int found = 0x0;
10890 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10891 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10892 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10893 unsigned int dataMemberOffset;
10897 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10900 if(curMember->isProperty)
10901 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10904 dataMember = curMember;
10905 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10906 if(_class->type == 0)
10907 dataMemberOffset += _class->base->structSize;
10914 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10918 if(prop->memberAccess == 1)
10920 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10921 curClass = prop->_class;
10926 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10927 int _subMemberStackPos = 0;
10929 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10933 if(dataMember->memberAccess == 1)
10935 curMember = dataMember;
10936 curClass = dataMember->_class;
10937 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10938 subMemberStackPos = _subMemberStackPos;
10943 if(found && member->initializer && member->initializer->type == 0)
10945 struct Expression * value = member->initializer->exp;
10946 struct Type * type = (((void *)0));
10947 unsigned int deepMember = 0x0;
10951 type = prop->dataType;
10953 else if(dataMember)
10955 if(!dataMember->dataType)
10956 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10957 type = dataMember->dataType;
10959 if(ident && ident->next)
10962 for(ident = ident->next; ident && type; ident = ident->next)
10964 if(type->kind == 8)
10966 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10968 type = prop->dataType;
10971 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10973 type = dataMember->dataType;
10976 else if(type->kind == 9 || type->kind == 10)
10978 struct Type * memberType;
10980 for(memberType = type->members.first; memberType; memberType = memberType->next)
10982 if(!strcmp(memberType->name, ident->string))
10993 FreeType(value->destType);
10994 value->destType = type;
10997 ComputeExpression(value);
10999 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11001 if(type->kind == 8)
11003 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11005 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11007 if(!_class->dataType)
11008 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11009 type = _class->dataType;
11014 void * ptr = inst->data + dataMemberOffset;
11016 if(value->type == 2)
11022 GetInt(value, (int *)ptr);
11027 GetInt64(value, (long long *)ptr);
11032 GetIntPtr(value, (intptr_t *)ptr);
11037 GetIntSize(value, (ssize_t *)ptr);
11042 GetFloat(value, (float *)ptr);
11047 GetDouble(value, (double *)ptr);
11052 else if(value->type == 1)
11054 if(type->kind == 8)
11056 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11058 if(_class->type == 1)
11060 ComputeTypeSize(type);
11061 if(value->instance->data)
11062 memcpy(ptr, value->instance->data, type->size);
11069 if(value->type == 1 && value->instance->data)
11071 if(type->kind == 8)
11073 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11075 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)))
11077 void (* Set)(void *, void *) = (void *)prop->Set;
11079 Set(inst->data, value->instance->data);
11080 PopulateInstance(inst);
11084 else if(value->type == 2)
11090 void (* Set)(void *, double) = (void *)prop->Set;
11092 Set(inst->data, strtod(value->constant, (((void *)0))));
11097 void (* Set)(void *, float) = (void *)prop->Set;
11099 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11104 void (* Set)(void *, int) = (void *)prop->Set;
11106 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11111 void (* Set)(void *, long long) = (void *)prop->Set;
11113 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11118 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11120 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11125 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11127 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11132 else if(value->type == 3)
11136 ReadString(temp, value->string);
11137 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11141 else if(!deepMember && type && _class->type == 3)
11145 if(value->type == 2)
11147 if(type->kind == 8)
11149 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11151 if(_class->type == 3)
11153 if(!_class->dataType)
11154 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11155 type = _class->dataType;
11163 float (* Set)(float) = (void *)prop->Set;
11165 GetFloat(member->initializer->exp, &fValue);
11166 exp->constant = PrintFloat(Set(fValue));
11173 double (* Set)(double) = (void *)prop->Set;
11175 GetDouble(member->initializer->exp, &dValue);
11176 exp->constant = PrintDouble(Set(dValue));
11184 else if(!deepMember && type && _class->type == 2)
11188 if(value->type == 1 && value->instance->data)
11190 unsigned int (* Set)(void *) = (void *)prop->Set;
11192 bits = Set(value->instance->data);
11194 else if(value->type == 2)
11198 else if(dataMember)
11200 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11201 struct Type * type;
11204 GetInt(value, &part);
11205 bits = (bits & ~bitMember->mask);
11206 if(!bitMember->dataType)
11207 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11208 type = bitMember->dataType;
11209 if(type->kind == 8 && type->_class && type->_class->registered)
11211 if(!type->_class->registered->dataType)
11212 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11213 type = type->_class->registered->dataType;
11220 bits |= ((char)part << bitMember->pos);
11222 bits |= ((unsigned char)part << bitMember->pos);
11226 bits |= ((short)part << bitMember->pos);
11228 bits |= ((unsigned short)part << bitMember->pos);
11233 bits |= (part << bitMember->pos);
11235 bits |= ((unsigned int)part << bitMember->pos);
11239 bits |= ((long long)part << bitMember->pos);
11241 bits |= ((uint64)part << bitMember->pos);
11246 bits |= ((intptr_t)part << bitMember->pos);
11250 bits |= ((uintptr_t)part << bitMember->pos);
11256 bits |= ((ssize_t)part << bitMember->pos);
11260 bits |= ((size_t)part << bitMember->pos);
11269 if(_class && _class->type == 3)
11271 ComputeExpression(member->initializer->exp);
11272 exp->constant = member->initializer->exp->constant;
11274 member->initializer->exp->constant = (((void *)0));
11284 if(_class && _class->type == 2)
11286 exp->constant = PrintHexUInt(bits);
11291 FreeInstance(inst);
11295 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11297 if(exp->op.op == SIZEOF)
11299 FreeExpContents(exp);
11301 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11311 struct Expression * exp2 = exp->op.exp2;
11313 exp->op.exp2 = (((void *)0));
11314 FreeExpContents(exp);
11315 FreeType(exp->expType);
11316 FreeType(exp->destType);
11318 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11324 FreeExpContents(exp);
11325 op1->ops.Neg(exp, op1);
11329 if(op1->ops.BitNot)
11331 FreeExpContents(exp);
11332 op1->ops.BitNot(exp, op1);
11338 FreeExpContents(exp);
11339 op1->ops.Not(exp, op1);
11351 FreeExpContents(exp);
11352 op1->ops.Add(exp, op1, op2);
11358 FreeExpContents(exp);
11359 op1->ops.Sub(exp, op1, op2);
11365 FreeExpContents(exp);
11366 op1->ops.Mul(exp, op1, op2);
11372 FreeExpContents(exp);
11373 op1->ops.Div(exp, op1, op2);
11379 FreeExpContents(exp);
11380 op1->ops.Mod(exp, op1, op2);
11386 if(op1->ops.BitAnd)
11388 FreeExpContents(exp);
11389 op1->ops.BitAnd(exp, op1, op2);
11396 FreeExpContents(exp);
11397 op1->ops.BitOr(exp, op1, op2);
11401 if(op1->ops.BitXor)
11403 FreeExpContents(exp);
11404 op1->ops.BitXor(exp, op1, op2);
11408 if(op1->ops.LShift)
11410 FreeExpContents(exp);
11411 op1->ops.LShift(exp, op1, op2);
11415 if(op1->ops.RShift)
11417 FreeExpContents(exp);
11418 op1->ops.RShift(exp, op1, op2);
11424 FreeExpContents(exp);
11425 op1->ops.Equ(exp, op1, op2);
11431 FreeExpContents(exp);
11432 op1->ops.Nqu(exp, op1, op2);
11438 FreeExpContents(exp);
11439 op1->ops.And(exp, op1, op2);
11445 FreeExpContents(exp);
11446 op1->ops.Or(exp, op1, op2);
11452 FreeExpContents(exp);
11453 op1->ops.Grt(exp, op1, op2);
11459 FreeExpContents(exp);
11460 op1->ops.Sma(exp, op1, op2);
11464 if(op1->ops.GrtEqu)
11466 FreeExpContents(exp);
11467 op1->ops.GrtEqu(exp, op1, op2);
11471 if(op1->ops.SmaEqu)
11473 FreeExpContents(exp);
11474 op1->ops.SmaEqu(exp, op1, op2);
11482 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11484 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11486 void ComputeExpression(struct Expression * exp)
11488 char expString[10240];
11490 expString[0] = '\0';
11495 ComputeInstantiation(exp);
11500 struct Expression * exp1, * exp2 = (((void *)0));
11501 struct Operand op1 =
11505 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
11508 struct Operand op2 =
11512 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
11517 ComputeExpression(exp->op.exp2);
11520 ComputeExpression(exp->op.exp1);
11521 exp1 = exp->op.exp1;
11522 exp2 = exp->op.exp2;
11523 op1 = GetOperand(exp1);
11525 op1.type->refCount++;
11528 op2 = GetOperand(exp2);
11530 op2.type->refCount++;
11535 exp1 = exp->op.exp2;
11536 op1 = GetOperand(exp1);
11538 op1.type->refCount++;
11540 CallOperator(exp, exp1, exp2, &op1, &op2);
11542 FreeType(op1.type);
11544 FreeType(op2.type);
11550 struct Expression * e, * n;
11552 for(e = (*exp->list).first; e; e = n)
11557 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11559 ComputeExpression(e);
11560 FreeType(exp->expType);
11561 FreeType(exp->destType);
11563 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11564 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11575 struct Expression * memberExp = exp->member.exp;
11576 struct Identifier * memberID = exp->member.member;
11577 struct Type * type;
11579 ComputeExpression(exp->member.exp);
11580 type = exp->member.exp->expType;
11583 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)));
11584 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11585 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11586 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11588 if(type->kind == 19 && exp->member.exp->type == 26)
11589 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11593 struct Symbol * classSym;
11596 PrintTypeNoConst(type, string, 0x0, 0x1);
11597 classSym = FindClass(string);
11598 _class = classSym ? classSym->registered : (((void *)0));
11600 if(exp->member.member)
11602 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11604 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11606 if(!prop && !member && _class && exp->member.member)
11608 struct Symbol * classSym = FindClass(exp->member.member->string);
11610 convertTo = _class;
11611 _class = classSym ? classSym->registered : (((void *)0));
11612 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11618 struct Type * type = prop->dataType;
11620 if(_class->type == 3)
11622 if(type->kind == 8)
11624 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11626 if(_class->type == 3)
11628 if(!_class->dataType)
11629 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11630 type = _class->dataType;
11638 float (* Get)(float) = (void *)prop->Get;
11640 GetFloat(exp->member.exp, &value);
11641 exp->constant = PrintFloat(Get ? Get(value) : value);
11648 double (* Get)(double);
11650 GetDouble(exp->member.exp, &value);
11652 Get = (void *)prop->Set;
11654 Get = (void *)prop->Get;
11655 exp->constant = PrintDouble(Get ? Get(value) : value);
11665 struct Expression * value = exp->member.exp;
11666 struct Type * type;
11668 if(!prop->dataType)
11669 ProcessPropertyType(prop);
11670 type = prop->dataType;
11674 else if(_class->type == 1)
11680 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11682 if(propertyClass->type == 1 && value->type == 1)
11684 void (* Set)(void *, void *) = (void *)prop->Set;
11686 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11687 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11688 exp->instance->_class = MkSpecifierName(_class->fullName);
11689 exp->instance->loc = exp->loc;
11691 Set(exp->instance->data, value->instance->data);
11692 PopulateInstance(exp->instance);
11699 void (* Set)(void *, int) = (void *)prop->Set;
11701 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11702 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11703 exp->instance->_class = MkSpecifierName(_class->fullName);
11704 exp->instance->loc = exp->loc;
11706 GetInt(value, &intValue);
11707 Set(exp->instance->data, intValue);
11708 PopulateInstance(exp->instance);
11713 long long intValue;
11714 void (* Set)(void *, long long) = (void *)prop->Set;
11716 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11717 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11718 exp->instance->_class = MkSpecifierName(_class->fullName);
11719 exp->instance->loc = exp->loc;
11721 GetInt64(value, &intValue);
11722 Set(exp->instance->data, intValue);
11723 PopulateInstance(exp->instance);
11729 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11731 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11732 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11733 exp->instance->_class = MkSpecifierName(_class->fullName);
11734 exp->instance->loc = exp->loc;
11736 GetIntPtr(value, &intValue);
11737 Set(exp->instance->data, intValue);
11738 PopulateInstance(exp->instance);
11744 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11746 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11747 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11748 exp->instance->_class = MkSpecifierName(_class->fullName);
11749 exp->instance->loc = exp->loc;
11751 GetIntSize(value, &intValue);
11752 Set(exp->instance->data, intValue);
11753 PopulateInstance(exp->instance);
11758 double doubleValue;
11759 void (* Set)(void *, double) = (void *)prop->Set;
11761 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11762 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11763 exp->instance->_class = MkSpecifierName(_class->fullName);
11764 exp->instance->loc = exp->loc;
11766 GetDouble(value, &doubleValue);
11767 Set(exp->instance->data, doubleValue);
11768 PopulateInstance(exp->instance);
11773 else if(_class->type == 2)
11779 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11781 if(propertyClass->type == 1 && value->instance->data)
11783 unsigned int (* Set)(void *) = (void *)prop->Set;
11784 unsigned int bits = Set(value->instance->data);
11786 exp->constant = PrintHexUInt(bits);
11790 else if(_class->type == 2)
11792 unsigned int value;
11793 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11796 GetUInt(exp->member.exp, &value);
11798 exp->constant = PrintHexUInt(bits);
11807 if(_class->type == 2)
11809 unsigned int value;
11811 GetUInt(exp->member.exp, &value);
11816 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11818 if(_class->type == 1)
11820 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11822 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11823 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11824 exp->instance->_class = MkSpecifierName(_class->fullName);
11825 exp->instance->loc = exp->loc;
11827 Get(value, exp->instance->data);
11828 PopulateInstance(exp->instance);
11830 else if(_class->type == 2)
11832 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11833 uint64 bits = Get(value);
11835 exp->constant = PrintHexUInt64(bits);
11842 else if(_class->type == 1)
11844 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11850 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11852 if(_class->type == 1 && value)
11854 void (* Get)(void *, void *) = (void *)prop->Get;
11856 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11857 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11858 exp->instance->_class = MkSpecifierName(_class->fullName);
11859 exp->instance->loc = exp->loc;
11861 Get(value, exp->instance->data);
11862 PopulateInstance(exp->instance);
11873 exp->isConstant = 0x0;
11882 FreeExpression(memberExp);
11883 FreeIdentifier(memberID);
11889 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11891 FreeExpContents(exp);
11892 exp->constant = PrintUInt(ComputeTypeSize(type));
11899 struct Symbol * classSym = exp->_class->symbol;
11901 if(classSym && classSym->registered)
11903 if(classSym->registered->fixed)
11905 FreeSpecifier(exp->_class);
11906 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11911 char className[1024];
11913 strcpy(className, "__ecereClass_");
11914 FullClassNameCat(className, classSym->string, 0x1);
11915 MangleClassName(className);
11916 DeclareClass(classSym, className);
11917 FreeExpContents(exp);
11919 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11920 exp->member.member = MkIdentifier("structSize");
11927 struct Type * type;
11928 struct Expression * e = exp;
11930 if(exp->type == 11)
11933 ComputeExpression(exp->cast.exp);
11936 if(e && exp->expType)
11938 type = exp->expType;
11939 if(type->kind == 8)
11941 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11943 if(_class && (_class->type == 3 || _class->type == 2))
11945 if(!_class->dataType)
11946 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11947 type = _class->dataType;
11958 GetChar(e, &value);
11959 FreeExpContents(exp);
11960 exp->constant = PrintChar(value);
11965 unsigned char value;
11967 GetUChar(e, &value);
11968 FreeExpContents(exp);
11969 exp->constant = PrintUChar(value);
11978 GetShort(e, &value);
11979 FreeExpContents(exp);
11980 exp->constant = PrintShort(value);
11985 unsigned short value;
11987 GetUShort(e, &value);
11988 FreeExpContents(exp);
11989 exp->constant = PrintUShort(value);
11999 FreeExpContents(exp);
12000 exp->constant = PrintInt(value);
12005 unsigned int value;
12007 GetUInt(e, &value);
12008 FreeExpContents(exp);
12009 exp->constant = PrintUInt(value);
12018 GetInt64(e, &value);
12019 FreeExpContents(exp);
12020 exp->constant = PrintInt64(value);
12027 GetUInt64(e, &value);
12028 FreeExpContents(exp);
12029 exp->constant = PrintUInt64(value);
12038 GetIntPtr(e, &value);
12039 FreeExpContents(exp);
12040 exp->constant = PrintInt64((long long)value);
12047 GetUIntPtr(e, &value);
12048 FreeExpContents(exp);
12049 exp->constant = PrintUInt64((uint64)value);
12058 GetIntSize(e, &value);
12059 FreeExpContents(exp);
12060 exp->constant = PrintInt64((long long)value);
12067 GetUIntSize(e, &value);
12068 FreeExpContents(exp);
12069 exp->constant = PrintUInt64((uint64)value);
12077 GetFloat(e, &value);
12078 FreeExpContents(exp);
12079 exp->constant = PrintFloat(value);
12087 GetDouble(e, &value);
12088 FreeExpContents(exp);
12089 exp->constant = PrintDouble(value);
12099 struct Operand op1 =
12103 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
12106 struct Operand op2 =
12110 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
12113 struct Operand op3 =
12117 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
12122 ComputeExpression((*exp->cond.exp).last);
12123 if(exp->cond.elseExp)
12124 ComputeExpression(exp->cond.elseExp);
12126 ComputeExpression(exp->cond.cond);
12127 op1 = GetOperand(exp->cond.cond);
12129 op1.type->refCount++;
12130 op2 = GetOperand((*exp->cond.exp).last);
12132 op2.type->refCount++;
12133 op3 = GetOperand(exp->cond.elseExp);
12135 op3.type->refCount++;
12138 FreeExpContents(exp);
12139 op1.ops.Cond(exp, &op1, &op2, &op3);
12142 FreeType(op1.type);
12144 FreeType(op2.type);
12146 FreeType(op3.type);
12152 void ApplyAnyObjectLogic(struct Expression * e);
12154 extern void CopyTypeInto(struct Type * type, struct Type * src);
12156 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12158 unsigned int result = 0x1;
12162 struct __ecereNameSpace__ecere__sys__OldList converts =
12166 struct Conversion * convert;
12168 if(destType->kind == 0)
12170 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12174 for(convert = converts.first; convert; convert = convert->next)
12176 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12180 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12181 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12184 newExp->destType = (((void *)0));
12188 exp->addedThis = 0x1;
12189 exp->member.exp = newExp;
12190 FreeType(exp->member.exp->expType);
12191 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12192 exp->member.exp->expType->classObjectType = objectType;
12193 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12194 exp->member.memberType = 1;
12195 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12196 exp->needCast = 0x1;
12198 exp->expType->refCount++;
12199 ApplyAnyObjectLogic(exp->member.exp);
12205 exp->addedThis = 0x1;
12206 exp->member.exp = newExp;
12207 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12209 newExp->byReference = 0x1;
12211 FreeType(exp->member.exp->expType);
12212 exp->member.exp->expType = (((void *)0));
12213 if(convert->convert->dataType)
12215 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12216 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12217 exp->member.exp->expType->refCount = 1;
12218 exp->member.exp->expType->classObjectType = objectType;
12219 ApplyAnyObjectLogic(exp->member.exp);
12221 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12222 exp->member.memberType = 4;
12223 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12224 exp->needCast = 0x1;
12225 if(convert->resultType)
12226 convert->resultType->refCount++;
12232 FreeType(exp->expType);
12235 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12236 exp->needCast = 0x1;
12238 exp->expType->refCount++;
12242 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12243 exp->needCast = 0x1;
12244 if(convert->resultType)
12245 convert->resultType->refCount++;
12249 if(exp->isConstant && inCompiler)
12250 ComputeExpression(exp);
12251 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12253 if(!result && exp->expType && converts.count)
12255 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12257 if(!result && exp->expType && exp->destType)
12259 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))
12266 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12268 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12270 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12272 void CheckTemplateTypes(struct Expression * exp)
12274 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12276 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12277 struct Statement * compound;
12278 struct Context * context;
12282 exp->destType->refCount++;
12284 exp->expType->refCount++;
12285 newExp->prev = (((void *)0));
12286 newExp->next = (((void *)0));
12287 switch(exp->expType->kind)
12290 if(exp->destType->classObjectType)
12293 exp->destType->refCount--;
12295 exp->expType->refCount--;
12296 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12300 struct __ecereNameSpace__ecere__sys__OldList * specs;
12301 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12302 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12304 context = PushContext();
12305 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12306 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12307 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12309 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12310 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12311 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12312 exp->compound->compound.context = context;
12313 PopContext(context);
12318 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12319 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12323 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12325 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12326 struct Statement * compound;
12327 struct Context * context;
12331 exp->destType->refCount++;
12333 exp->expType->refCount++;
12334 newExp->prev = (((void *)0));
12335 newExp->next = (((void *)0));
12336 switch(exp->expType->kind)
12339 if(exp->destType->classObjectType)
12342 exp->destType->refCount--;
12344 exp->expType->refCount--;
12345 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12349 struct __ecereNameSpace__ecere__sys__OldList * specs;
12350 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12351 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12353 context = PushContext();
12354 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12355 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12356 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12358 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12359 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12360 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12361 exp->compound->compound.context = context;
12362 PopContext(context);
12367 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12370 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12371 ProcessExpressionType((*exp->list).first);
12377 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12378 newExp->needCast = 0x1;
12379 ProcessExpressionType((*exp->list).first);
12385 if(exp->expType->kind == 20)
12387 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12391 FreeType(exp->destType);
12392 FreeType(exp->expType);
12393 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12397 if(newExp->type == 8 && newExp->member.memberType == 3)
12401 exp->op.exp1 = (((void *)0));
12402 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12406 char typeString[1024];
12407 struct Declarator * decl;
12408 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12410 typeString[0] = '\0';
12411 PrintType(exp->expType, typeString, 0x0, 0x0);
12412 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12414 exp->cast.typeName = MkTypeName(specs, decl);
12415 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12416 exp->cast.exp->needCast = 0x1;
12424 extern int strncmp(const char * , const char * , size_t n);
12426 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12428 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12430 int nsLen = strlen(nameSpace);
12431 struct Symbol * symbol;
12433 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)))
12435 char * s = symbol->string;
12437 if(!strncmp(s, nameSpace, nsLen))
12442 for(c = strlen(s) - 1; c >= 0; c--)
12445 namePart = s + c + 1;
12446 if(!strcmp(namePart, name))
12454 return (((void *)0));
12457 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12460 char nameSpace[1024];
12462 unsigned int gotColon = 0x0;
12464 nameSpace[0] = '\0';
12465 for(c = strlen(name) - 1; c >= 0; c--)
12471 namePart = name + c + 1;
12472 while(c >= 0 && name[c] == ':')
12476 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12480 memcpy(nameSpace, name, c + 1);
12481 nameSpace[c + 1] = (char)0;
12482 return ScanWithNameSpace(tree, nameSpace, namePart);
12486 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12492 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12496 return ScanWithNameSpace(tree, "", namePart);
12498 return (((void *)0));
12501 static void ProcessDeclaration(struct Declaration * decl);
12503 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12505 struct Context * ctx;
12506 struct Symbol * symbol = (((void *)0));
12508 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12510 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12512 symbol = (((void *)0));
12515 char curName[1024];
12517 strcpy(curName, thisNameSpace);
12518 strcat(curName, "::");
12519 strcat(curName, name);
12520 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12523 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12526 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12527 if(symbol || ctx == endContext)
12530 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12532 if(symbol->pointerExternal->type == 0)
12534 struct FunctionDefinition * function = symbol->pointerExternal->function;
12535 struct Context * tmpContext = curContext;
12537 curContext = (((void *)0));
12538 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12539 curContext = tmpContext;
12540 symbol->pointerExternal->symbol = symbol;
12541 DeclareType(symbol->type, 0x1, 0x1);
12542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12543 symbol->id = curExternal->symbol->idCode;
12545 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12547 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12548 symbol->id = curExternal->symbol->idCode;
12554 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12556 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12557 ListAdd(specs, MkSpecifier(UNSIGNED));
12562 if(type->_class->registered)
12564 if(!type->_class->registered->dataType)
12565 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12566 GetTypeSpecs(type->_class->registered->dataType, specs);
12571 ListAdd(specs, MkSpecifier(DOUBLE));
12574 ListAdd(specs, MkSpecifier(FLOAT));
12577 ListAdd(specs, MkSpecifier(CHAR));
12580 ListAdd(specs, MkSpecifier(_BOOL));
12583 ListAdd(specs, MkSpecifier(SHORT));
12586 ListAdd(specs, MkSpecifier(INT64));
12589 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12592 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12596 ListAdd(specs, MkSpecifier(INT));
12601 static void PrintArraySize(struct Type * arrayType, char * string)
12607 if(arrayType->enumClass)
12608 strcat(size, arrayType->enumClass->string);
12609 else if(arrayType->arraySizeExp)
12610 PrintExpression(arrayType->arraySizeExp, size);
12612 strcat(string, size);
12615 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12619 if(printConst && type->constant)
12620 strcat(string, "const ");
12625 struct Symbol * c = type->_class;
12627 if(type->classObjectType == 2)
12628 strcat(string, "typed_object");
12629 else if(type->classObjectType == 3)
12630 strcat(string, "any_object");
12634 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12636 if(type->byReference)
12637 strcat(string, " &");
12641 strcat(string, "void");
12644 strcat(string, type->isSigned ? "int" : "uint");
12647 strcat(string, type->isSigned ? "int64" : "uint64");
12650 strcat(string, type->isSigned ? "intptr" : "uintptr");
12653 strcat(string, type->isSigned ? "intsize" : "uintsize");
12656 strcat(string, type->isSigned ? "char" : "byte");
12659 strcat(string, "_Bool");
12662 strcat(string, type->isSigned ? "short" : "uint16");
12665 strcat(string, "float");
12668 strcat(string, "double");
12673 strcat(string, "struct ");
12674 strcat(string, type->enumName);
12676 else if(type->typeName)
12677 strcat(string, type->typeName);
12680 struct Type * member;
12682 strcat(string, "struct { ");
12683 for(member = type->members.first; member; member = member->next)
12685 PrintType(member, string, 0x1, fullName);
12686 strcat(string, "; ");
12688 strcat(string, "}");
12694 strcat(string, "union ");
12695 strcat(string, type->enumName);
12697 else if(type->typeName)
12698 strcat(string, type->typeName);
12701 strcat(string, "union ");
12702 strcat(string, "(unnamed)");
12708 strcat(string, "enum ");
12709 strcat(string, type->enumName);
12711 else if(type->typeName)
12712 strcat(string, type->typeName);
12714 strcat(string, "int");
12717 strcat(string, "...");
12720 strcat(string, "subclass(");
12721 strcat(string, type->_class ? type->_class->string : "int");
12722 strcat(string, ")");
12725 strcat(string, type->templateParameter->identifier->string);
12728 strcat(string, "thisclass");
12731 strcat(string, "__builtin_va_list");
12737 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12739 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12741 if(type->name && type->name[0])
12744 strcat(string, type->name);
12747 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12753 strcat(string, name);
12758 static void PrintAttribs(struct Type * type, char * string)
12762 if(type->dllExport)
12763 strcat(string, "dllexport ");
12764 if(type->attrStdcall)
12765 strcat(string, "stdcall ");
12769 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12771 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12773 struct Type * attrType = (((void *)0));
12775 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12776 PrintAttribs(type, string);
12777 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12778 strcat(string, " const");
12779 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12780 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12781 strcat(string, " (");
12782 if(type->kind == 13)
12784 if(type->type->kind == 11 || type->type->kind == 16)
12785 PrintAttribs(type->type, string);
12787 if(type->kind == 13)
12789 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12790 strcat(string, "*");
12792 strcat(string, " *");
12794 if(printConst && type->constant && type->kind == 13)
12795 strcat(string, " const");
12798 PrintTypeSpecs(type, string, fullName, printConst);
12801 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12803 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12804 strcat(string, ")");
12805 if(type->kind == 12)
12806 PrintArraySize(type, string);
12807 else if(type->kind == 11)
12809 struct Type * param;
12811 strcat(string, "(");
12812 for(param = type->params.first; param; param = param->next)
12814 PrintType(param, string, 0x1, fullName);
12816 strcat(string, ", ");
12818 strcat(string, ")");
12820 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12821 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12824 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12826 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12827 if(type->thisClass || (printName && type->name && type->name[0]))
12828 strcat(string, " ");
12829 if((type->thisClass || type->staticMethod))
12831 struct Symbol * _class = type->thisClass;
12833 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12835 if(type->classObjectType == 1)
12836 strcat(string, "class");
12838 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12840 else if(_class && _class->string)
12842 char * s = _class->string;
12848 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12854 strcat(string, name);
12857 strcat(string, "::");
12859 if(printName && type->name)
12860 PrintName(type, string, fullName);
12861 PostPrintType(type, string, fullName);
12862 if(type->bitFieldCount)
12866 sprintf(count, ":%d", type->bitFieldCount);
12867 strcat(string, count);
12871 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12873 _PrintType(type, string, printName, fullName, 0x1);
12876 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12878 _PrintType(type, string, printName, fullName, 0x0);
12881 static struct Type * FindMember(struct Type * type, char * string)
12883 struct Type * memberType;
12885 for(memberType = type->members.first; memberType; memberType = memberType->next)
12887 if(!memberType->name)
12889 struct Type * subType = FindMember(memberType, string);
12894 else if(!strcmp(memberType->name, string))
12897 return (((void *)0));
12900 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12902 struct Type * memberType;
12904 for(memberType = type->members.first; memberType; memberType = memberType->next)
12906 if(!memberType->name)
12908 struct Type * subType = FindMember(memberType, string);
12912 *offset += memberType->offset;
12916 else if(!strcmp(memberType->name, string))
12918 *offset += memberType->offset;
12922 return (((void *)0));
12925 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12927 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12929 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12931 struct Expression * ParseExpressionString(char * expression)
12933 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12934 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
12935 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12937 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12938 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12939 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12940 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12942 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12943 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12945 parsedExpression = (((void *)0));
12947 expression_yyparse();
12948 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12949 return parsedExpression;
12952 extern char * QMkString(char * source);
12954 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12956 struct Identifier * id = exp->identifier;
12957 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12958 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12959 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12960 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12962 if(_class && _class->type == 4)
12964 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12965 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12969 struct __ecereNameSpace__ecere__com__Class * baseClass;
12971 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12973 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12975 for(value = e->values.first; value; value = value->next)
12977 if(!strcmp(value->name, id->string))
12982 char constant[256];
12984 FreeExpContents(exp);
12986 exp->isConstant = 0x1;
12987 if(!strcmp(baseClass->dataTypeString, "int"))
12988 sprintf(constant, "%d", (int)value->data);
12990 sprintf(constant, "0x%X", (int)value->data);
12991 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12992 exp->expType = MkClassType(baseClass->fullName);
13000 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13002 ProcessMethodType(method);
13003 exp->expType = __extension__ ({
13004 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13006 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13010 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13012 if(!prop->dataType)
13013 ProcessPropertyType(prop);
13014 exp->expType = prop->dataType;
13016 prop->dataType->refCount++;
13019 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13021 if(!member->dataType)
13022 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13023 exp->expType = member->dataType;
13024 if(member->dataType)
13025 member->dataType->refCount++;
13028 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13030 if(!classProp->dataType)
13031 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13032 if(classProp->constant)
13034 FreeExpContents(exp);
13035 exp->isConstant = 0x1;
13036 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13039 exp->constant = QMkString((char *)classProp->Get(_class));
13043 char constant[256];
13046 sprintf(constant, "%d", (int)classProp->Get(_class));
13047 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13053 exp->expType = classProp->dataType;
13054 if(classProp->dataType)
13055 classProp->dataType->refCount++;
13061 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13063 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13064 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13065 struct __ecereNameSpace__ecere__com__NameSpace * child;
13069 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)))
13071 data = ScanGlobalData(child, name);
13079 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13081 extern char * strncpy(char * , const char * , size_t n);
13083 static struct GlobalData * FindGlobalData(char * name)
13086 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13088 nameSpace = globalData;
13089 for(c = 0; name[c]; c++)
13091 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13093 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13094 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13096 strncpy(spaceName, name + start, c - start);
13097 spaceName[c - start] = '\0';
13098 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13099 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13101 return (((void *)0));
13102 nameSpace = newSpace;
13110 return ScanGlobalData(nameSpace, name + start);
13112 return (((void *)0));
13115 static int definedExpStackPos;
13117 static void * definedExpStack[512];
13119 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13121 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13123 FreeExpContents(checkedExp);
13124 FreeType(checkedExp->expType);
13125 FreeType(checkedExp->destType);
13126 *checkedExp = *newExp;
13127 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13128 checkedExp->prev = prev;
13129 checkedExp->next = next;
13132 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13134 extern int printf(char * , ...);
13136 void __ecereMethod_Expression_Clear();
13138 void ApplyAnyObjectLogic(struct Expression * e)
13140 struct Type * destType = e->destType;
13142 if(destType && (destType->classObjectType == 3))
13144 if(e && e->expType)
13146 struct Type * type = e->expType;
13147 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13149 if(type->kind == 8 && type->_class && type->_class->registered)
13151 _class = type->_class->registered;
13153 else if(type->kind == 19)
13155 _class = FindClass("ecere::com::Class")->registered;
13159 char string[1024] = "";
13160 struct Symbol * classSym;
13162 PrintTypeNoConst(type, string, 0x0, 0x1);
13163 classSym = FindClass(string);
13165 _class = classSym->registered;
13167 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)))
13169 if(!_class || strcmp(_class->fullName, "char *"))
13171 struct Expression * checkedExp = e, * newExp;
13173 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13175 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13177 if(checkedExp->type == 25)
13179 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13182 checkedExp = (*checkedExp->list).last;
13184 else if(checkedExp->type == 11)
13185 checkedExp = checkedExp->cast.exp;
13187 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13189 newExp = checkedExp->op.exp2;
13190 checkedExp->op.exp2 = (((void *)0));
13191 FreeExpContents(checkedExp);
13192 if(e->expType && e->expType->passAsTemplate)
13196 ComputeTypeSize(e->expType);
13197 sprintf(size, "%d", e->expType->size);
13198 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))))));
13200 ReplaceExpContents(checkedExp, newExp);
13201 e->byReference = 0x1;
13203 else if(!e->byReference || (_class && _class->type == 5))
13205 struct Expression * checkedExp, * newExp;
13208 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;
13210 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13212 struct Context * context = PushContext();
13213 struct Declarator * decl;
13214 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13215 char typeString[1024];
13216 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13218 typeString[0] = '\0';
13220 newExp->prev = (((void *)0));
13221 newExp->next = (((void *)0));
13222 newExp->expType = (((void *)0));
13223 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13224 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13225 newExp->destType = ProcessType(specs, decl);
13226 curContext = context;
13230 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13233 sprintf(name, "__internalValue%03X", internalValueCounter++);
13234 if(!curCompound->compound.declarations)
13235 curCompound->compound.declarations = MkList();
13236 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13237 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13238 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13239 e->compound = MkCompoundStmt((((void *)0)), stmts);
13242 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13244 struct Type * type = e->destType;
13246 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13247 CopyTypeInto(e->destType, type);
13248 e->destType->refCount = 1;
13249 e->destType->classObjectType = 0;
13252 e->compound->compound.context = context;
13253 PopContext(context);
13254 curContext = context->parent;
13258 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13260 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13262 if(checkedExp->type == 25)
13264 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13267 checkedExp = (*checkedExp->list).last;
13269 else if(checkedExp->type == 11)
13270 checkedExp = checkedExp->cast.exp;
13273 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13275 *operand = *checkedExp;
13276 checkedExp->destType = (((void *)0));
13277 checkedExp->expType = (((void *)0));
13278 __ecereMethod_Expression_Clear(checkedExp);
13279 checkedExp->type = 4;
13280 checkedExp->op.op = '&';
13281 checkedExp->op.exp1 = (((void *)0));
13282 checkedExp->op.exp2 = operand;
13291 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))))
13293 if(e->expType->classObjectType && destType && destType->classObjectType)
13299 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13302 thisExp->prev = (((void *)0));
13303 thisExp->next = (((void *)0));
13304 __ecereMethod_Expression_Clear(e);
13306 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13307 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13308 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13310 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13311 CopyTypeInto(e->expType, thisExp->expType);
13312 e->expType->byReference = 0x0;
13313 e->expType->refCount = 1;
13314 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))
13316 e->expType->classObjectType = 0;
13321 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13323 if(destType->kind == 14)
13325 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Unspecified type\n", (((void *)0))));
13327 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13329 unsigned int byReference = e->expType->byReference;
13330 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13331 struct Declarator * decl;
13332 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13333 char typeString[1024];
13334 struct Type * type;
13335 int backupClassObjectType;
13336 unsigned int backupByReference;
13338 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13342 backupClassObjectType = type->classObjectType;
13343 backupByReference = type->byReference;
13344 type->classObjectType = 0;
13345 type->byReference = 0x0;
13346 typeString[0] = '\0';
13347 PrintType(type, typeString, 0x0, 0x1);
13348 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13349 type->classObjectType = backupClassObjectType;
13350 type->byReference = backupByReference;
13352 thisExp->prev = (((void *)0));
13353 thisExp->next = (((void *)0));
13354 __ecereMethod_Expression_Clear(e);
13355 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)))
13359 e->op.exp1 = (((void *)0));
13360 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13361 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13362 CopyTypeInto(e->expType, type);
13363 e->expType->byReference = 0x0;
13364 e->expType->refCount = 1;
13369 e->cast.typeName = MkTypeName(specs, decl);
13370 e->cast.exp = thisExp;
13371 e->byReference = 0x1;
13375 e->destType = destType;
13376 destType->refCount++;
13381 extern char * strstr(const char * , const char * );
13383 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13385 struct __ecereNameSpace__ecere__com__DefinedExpression
13387 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13388 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13391 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13392 } __attribute__ ((gcc_struct));
13394 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13396 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13398 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13400 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13402 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13404 extern struct Expression * CopyExpression(struct Expression * exp);
13406 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13408 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13410 static void ProcessStatement(struct Statement * stmt);
13412 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13414 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13416 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13418 extern char * sourceFile;
13420 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13422 void ProcessExpressionType(struct Expression * exp)
13424 unsigned int unresolved = 0x0;
13425 struct Location oldyylloc = yylloc;
13426 unsigned int notByReference = 0x0;
13428 if(!exp || exp->expType)
13435 struct Identifier * id = exp->identifier;
13439 if(id->_class && id->_class->name)
13441 id->classSym = id->_class->symbol;
13443 if(strstr(id->string, "__ecereClass") == id->string)
13445 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13448 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13450 ReplaceClassMembers(exp, thisClass);
13453 ProcessExpressionType(exp);
13456 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13461 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13465 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13471 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13474 ProcessExpressionType(exp);
13478 else if(currentClass && !id->_class)
13480 if(ResolveIdWithClass(exp, currentClass, 0x1))
13483 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13488 struct Type * type = symbol->type;
13489 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13491 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13493 struct Context * context = SetupTemplatesContext(_class);
13495 type = ReplaceThisClassType(_class);
13496 FinishTemplatesContext(context);
13498 type->refCount = 0;
13500 FreeSpecifier(id->_class);
13501 id->_class = (((void *)0));
13502 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13503 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13504 id->classSym = (((void *)0));
13505 exp->expType = type;
13508 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13509 exp->isConstant = 0x1;
13510 if(symbol->isParam || !strcmp(id->string, "this"))
13512 if(_class && _class->type == 1 && !type->declaredWithStruct)
13513 exp->byReference = 0x1;
13515 if(symbol->isIterator)
13517 if(symbol->isIterator == 3)
13520 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13521 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13522 exp->expType = (((void *)0));
13523 ProcessExpressionType(exp);
13525 else if(symbol->isIterator != 4)
13528 exp->member.exp = MkExpIdentifier(exp->identifier);
13529 exp->member.exp->expType = exp->expType;
13530 exp->member.member = MkIdentifier("data");
13531 exp->expType = (((void *)0));
13532 ProcessExpressionType(exp);
13539 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13541 if(thisNameSpace && !(id->_class && !id->_class->name))
13545 strcpy(name, thisNameSpace);
13546 strcat(name, "::");
13547 strcat(name, id->string);
13548 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13551 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13556 for(c = 0; c < definedExpStackPos; c++)
13557 if(definedExpStack[c] == definedExp)
13559 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13561 struct Location backupYylloc = yylloc;
13563 definedExpStack[definedExpStackPos++] = definedExp;
13564 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13565 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13566 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13568 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13569 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13570 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13571 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13573 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13574 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13576 parsedExpression = (((void *)0));
13578 expression_yyparse();
13579 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13580 yylloc = backupYylloc;
13581 if(parsedExpression)
13583 FreeIdentifier(id);
13585 exp->list = MkListOne(parsedExpression);
13586 parsedExpression->loc = yylloc;
13587 ProcessExpressionType(exp);
13588 definedExpStackPos--;
13591 definedExpStackPos--;
13597 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Recursion in defined expression %s\n", (((void *)0))), id->string);
13603 struct GlobalData * data = (((void *)0));
13605 if(thisNameSpace && !(id->_class && !id->_class->name))
13609 strcpy(name, thisNameSpace);
13610 strcat(name, "::");
13611 strcat(name, id->string);
13612 data = FindGlobalData(name);
13615 data = FindGlobalData(id->string);
13618 DeclareGlobalData(data);
13619 exp->expType = data->dataType;
13621 data->dataType->refCount++;
13622 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13623 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13624 FreeSpecifier(id->_class);
13625 id->_class = (((void *)0));
13630 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13632 if(thisNameSpace && !(id->_class && !id->_class->name))
13636 strcpy(name, thisNameSpace);
13637 strcat(name, "::");
13638 strcat(name, id->string);
13639 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13642 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13647 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13648 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13650 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13651 strcpy(name, "__ecereFunction_");
13652 FullClassNameCat(name, id->string, 0x0);
13653 if(DeclareFunction(function, name))
13655 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13656 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13658 exp->expType = function->dataType;
13659 if(function->dataType)
13660 function->dataType->refCount++;
13661 FreeSpecifier(id->_class);
13662 id->_class = (((void *)0));
13674 struct __ecereNameSpace__ecere__com__Class * _class;
13676 if(!exp->instance->_class)
13678 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13680 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13683 ProcessInstantiationType(exp->instance);
13684 exp->isConstant = exp->instance->isConstant;
13685 if(exp->instance->_class)
13687 exp->expType = MkClassType(exp->instance->_class->name);
13695 char * constant = exp->constant;
13696 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13698 exp->expType = type;
13699 if(constant[0] == '\'')
13701 if((int)((unsigned char *)constant)[1] > 127)
13704 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13708 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13709 exp->constant = PrintUInt(ch);
13711 type->_class = FindClass("unichar");
13712 type->isSigned = 0x0;
13717 type->isSigned = 0x1;
13722 char * dot = strchr(constant, '.');
13723 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13728 exponent = strchr(constant, 'p');
13730 exponent = strchr(constant, 'P');
13734 exponent = strchr(constant, 'e');
13736 exponent = strchr(constant, 'E');
13738 if(dot || exponent)
13740 if(strchr(constant, 'f') || strchr(constant, 'F'))
13744 type->isSigned = 0x1;
13748 unsigned int isSigned = constant[0] == '-';
13749 long long i64 = strtoll(constant, (((void *)0)), 0);
13750 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13751 unsigned int is64Bit = 0x0;
13755 if(i64 < (((int)0x80000000)))
13760 if(ui64 > (((int)0x7fffffff)))
13762 if(ui64 > (0xffffffff))
13765 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13769 else if(constant[0] != '0' || !constant[1])
13772 type->kind = is64Bit ? 4 : 3;
13773 type->isSigned = isSigned;
13776 exp->isConstant = 0x1;
13777 if(exp->destType && exp->destType->kind == 7)
13779 else if(exp->destType && exp->destType->kind == 6)
13781 else if(exp->destType && exp->destType->kind == 4)
13788 exp->isConstant = 0x1;
13789 exp->expType = __extension__ ({
13790 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13792 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13793 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13795 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13796 }), __ecereInstance2;
13802 ProcessExpressionType(exp->_new.size);
13803 exp->expType = __extension__ ({
13804 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13806 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13808 DeclareType(exp->expType->type, 0x0, 0x0);
13812 ProcessExpressionType(exp->_renew.size);
13813 ProcessExpressionType(exp->_renew.exp);
13814 exp->expType = __extension__ ({
13815 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13817 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13819 DeclareType(exp->expType->type, 0x0, 0x0);
13823 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13824 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13825 unsigned int useDestType = 0x0, useSideType = 0x0;
13826 struct Location oldyylloc = yylloc;
13827 unsigned int useSideUnit = 0x0;
13828 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13870 if(exp->op.op != '*' || exp->op.exp1)
13877 if(exp->op.op == '&')
13879 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13881 struct Identifier * id = exp->op.exp2->identifier;
13882 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13884 if(symbol && symbol->isIterator == 2)
13887 exp->member.exp = exp->op.exp2;
13888 exp->member.member = MkIdentifier("key");
13889 exp->expType = (((void *)0));
13890 exp->op.exp2->expType = symbol->type;
13891 symbol->type->refCount++;
13892 ProcessExpressionType(exp);
13900 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))
13902 if(exp->op.exp1->destType)
13903 FreeType(exp->op.exp1->destType);
13904 exp->op.exp1->destType = exp->destType;
13906 exp->destType->refCount++;
13910 if(exp->op.exp1->destType)
13911 FreeType(exp->op.exp1->destType);
13912 exp->op.exp1->destType = dummy;
13915 if(exp->op.exp1->destType && exp->op.op != '=')
13916 exp->op.exp1->destType->count++;
13917 ProcessExpressionType(exp->op.exp1);
13918 if(exp->op.exp1->destType && exp->op.op != '=')
13919 exp->op.exp1->destType->count--;
13920 if(exp->op.exp1->destType == dummy)
13923 exp->op.exp1->destType = (((void *)0));
13925 type1 = exp->op.exp1->expType;
13929 char expString[10240];
13931 expString[0] = '\0';
13932 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13936 exp->op.exp2->destType = exp->op.exp1->expType;
13937 if(exp->op.exp1->expType)
13938 exp->op.exp1->expType->refCount++;
13942 exp->op.exp2->destType = exp->destType;
13944 exp->destType->refCount++;
13948 exp->expType = type1;
13953 PrintExpression(exp->op.exp2, expString);
13954 if(type1 && type1->kind == 13)
13956 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)
13957 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13958 else if(exp->op.op == '=')
13960 if(exp->op.exp2->destType)
13961 FreeType(exp->op.exp2->destType);
13962 exp->op.exp2->destType = type1;
13969 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)
13973 if(exp->op.exp2->destType)
13974 FreeType(exp->op.exp2->destType);
13975 exp->op.exp2->destType = type1;
13982 exp->expType = type1;
13984 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)))
13986 if(exp->op.exp2->destType)
13987 FreeType(exp->op.exp2->destType);
13988 exp->op.exp2->destType = exp->destType;
13990 exp->destType->refCount++;
13994 if(exp->op.exp2->destType)
13995 FreeType(exp->op.exp2->destType);
13996 exp->op.exp2->destType = dummy;
13999 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14001 FreeType(exp->op.exp2->destType);
14002 exp->op.exp2->destType = type1;
14005 if(exp->op.exp2->destType && exp->op.op != '=')
14006 exp->op.exp2->destType->count++;
14007 ProcessExpressionType(exp->op.exp2);
14008 if(exp->op.exp2->destType && exp->op.op != '=')
14009 exp->op.exp2->destType->count--;
14010 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14012 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)
14014 if(exp->op.op != '=' && type1->type->kind == 0)
14015 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14017 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)))
14019 if(exp->op.op == ADD_ASSIGN)
14020 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14022 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))
14024 if(exp->op.op == ADD_ASSIGN)
14025 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14027 else if(inCompiler)
14029 char type1String[1024];
14030 char type2String[1024];
14032 type1String[0] = '\0';
14033 type2String[0] = '\0';
14034 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14035 PrintType(type1, type2String, 0x0, 0x1);
14036 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14037 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14040 if(exp->op.exp2->destType == dummy)
14043 exp->op.exp2->destType = (((void *)0));
14045 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14047 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14048 type2->refCount = 1;
14049 CopyTypeInto(type2, exp->op.exp2->expType);
14050 type2->isSigned = 0x1;
14052 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14054 type2 = __extension__ ({
14055 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14057 __ecereInstance1->kind = 3, __ecereInstance1;
14059 type2->refCount = 1;
14060 type2->isSigned = 0x1;
14063 type2 = exp->op.exp2->expType;
14066 if(exp->op.op == SIZEOF)
14068 exp->expType = __extension__ ({
14069 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14071 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14073 exp->isConstant = 0x1;
14075 else if(exp->op.op == '*' && !exp->op.exp1)
14077 exp->expType = Dereference(type2);
14078 if(type2 && type2->kind == 8)
14079 notByReference = 0x1;
14081 else if(exp->op.op == '&' && !exp->op.exp1)
14082 exp->expType = Reference(type2);
14089 if(exp->op.exp1->destType)
14090 FreeType(exp->op.exp1->destType);
14091 exp->op.exp1->destType = MkClassType("bool");
14092 exp->op.exp1->destType->truth = 0x1;
14093 if(!exp->op.exp1->expType)
14094 ProcessExpressionType(exp->op.exp1);
14096 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14097 FreeType(exp->op.exp1->expType);
14098 exp->op.exp1->expType = MkClassType("bool");
14099 exp->op.exp1->expType->truth = 0x1;
14103 if(exp->op.exp2->destType)
14104 FreeType(exp->op.exp2->destType);
14105 exp->op.exp2->destType = MkClassType("bool");
14106 exp->op.exp2->destType->truth = 0x1;
14107 if(!exp->op.exp2->expType)
14108 ProcessExpressionType(exp->op.exp2);
14110 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14111 FreeType(exp->op.exp2->expType);
14112 exp->op.exp2->expType = MkClassType("bool");
14113 exp->op.exp2->expType->truth = 0x1;
14116 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")))))
14118 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14120 if(exp->op.exp2->destType)
14121 FreeType(exp->op.exp2->destType);
14122 exp->op.exp2->destType = type1;
14124 if(exp->op.exp1->destType)
14125 FreeType(exp->op.exp1->destType);
14126 exp->op.exp1->destType = type2;
14128 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)
14129 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14130 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14132 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14136 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14138 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14139 ProcessExpressionType(exp->op.exp1);
14140 if(type2->kind != 13)
14142 ProcessExpressionType(classExp);
14143 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"))))))));
14144 if(!exp->op.exp2->expType)
14145 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14146 ProcessExpressionType(exp->op.exp2);
14150 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)))
14152 if(type1->kind != 8 && type1->type->kind == 0)
14153 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14154 exp->expType = type1;
14158 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)))
14160 if(type2->kind != 8 && type2->type->kind == 0)
14161 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "void *: unknown size\n", (((void *)0))));
14162 exp->expType = type2;
14166 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))
14168 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "different levels of indirection\n", (((void *)0))));
14172 unsigned int success = 0x0;
14174 if(type1->kind == 13 && type2->kind == 13)
14176 if(exp->op.op == '+')
14177 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "cannot add two pointers\n", (((void *)0))));
14178 else if(exp->op.op == '-')
14180 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14182 exp->expType = __extension__ ({
14183 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14185 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14188 if(type1->type->kind == 20)
14190 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14194 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14196 ProcessExpressionType(classExp);
14198 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")))))));
14199 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14207 if(!success && exp->op.exp1->type == 2)
14209 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14212 FreeType(exp->expType);
14213 exp->expType = exp->op.exp1->destType;
14214 if(exp->op.exp1->destType)
14215 exp->op.exp1->destType->refCount++;
14218 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14221 FreeType(exp->expType);
14222 exp->expType = exp->op.exp2->destType;
14223 if(exp->op.exp2->destType)
14224 exp->op.exp2->destType->refCount++;
14230 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14233 FreeType(exp->expType);
14234 exp->expType = exp->op.exp2->destType;
14235 if(exp->op.exp2->destType)
14236 exp->op.exp2->destType->refCount++;
14239 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14242 FreeType(exp->expType);
14243 exp->expType = exp->op.exp1->destType;
14244 if(exp->op.exp1->destType)
14245 exp->op.exp1->destType->refCount++;
14251 char expString1[10240];
14252 char expString2[10240];
14256 expString1[0] = '\0';
14257 expString2[0] = '\0';
14262 PrintExpression(exp->op.exp1, expString1);
14263 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14264 PrintExpression(exp->op.exp2, expString2);
14265 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14266 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14267 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14269 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14273 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14275 if(exp->op.exp1->destType)
14276 FreeType(exp->op.exp1->destType);
14277 exp->op.exp1->destType = type2->_class->registered->dataType;
14278 if(type2->_class->registered->dataType)
14279 type2->_class->registered->dataType->refCount++;
14280 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14281 exp->expType = type2;
14285 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14287 if(exp->op.exp2->destType)
14288 FreeType(exp->op.exp2->destType);
14289 exp->op.exp2->destType = type1->_class->registered->dataType;
14290 if(type1->_class->registered->dataType)
14291 type1->_class->registered->dataType->refCount++;
14292 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14293 exp->expType = type1;
14299 unsigned int valid = 0x0;
14301 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14303 if(exp->op.exp2->destType)
14304 FreeType(exp->op.exp2->destType);
14305 if(!type1->_class->registered->dataType)
14306 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14307 exp->op.exp2->destType = type1->_class->registered->dataType;
14308 exp->op.exp2->destType->refCount++;
14309 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14310 type2 = exp->op.exp2->destType;
14311 exp->expType = type2;
14314 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14316 if(exp->op.exp1->destType)
14317 FreeType(exp->op.exp1->destType);
14318 if(!type2->_class->registered->dataType)
14319 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14320 exp->op.exp1->destType = type2->_class->registered->dataType;
14321 exp->op.exp1->destType->refCount++;
14322 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14323 type1 = exp->op.exp1->destType;
14324 exp->expType = type1;
14327 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14329 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14331 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14334 FreeType(exp->expType);
14335 exp->expType = exp->op.exp1->expType;
14336 if(exp->op.exp2->expType)
14337 exp->op.exp1->expType->refCount++;
14341 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14343 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14346 FreeType(exp->expType);
14347 exp->expType = exp->op.exp2->expType;
14348 if(exp->op.exp2->expType)
14349 exp->op.exp2->expType->refCount++;
14356 if(exp->op.exp2->destType)
14357 FreeType(exp->op.exp2->destType);
14358 exp->op.exp2->destType = type1;
14360 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14363 FreeType(exp->expType);
14364 exp->expType = exp->op.exp2->destType;
14365 if(exp->op.exp2->destType)
14366 exp->op.exp2->destType->refCount++;
14368 else if(type1 && type2)
14370 char expString1[10240];
14371 char expString2[10240];
14372 char type1String[1024];
14373 char type2String[1024];
14375 expString1[0] = '\0';
14376 expString2[0] = '\0';
14377 type1String[0] = '\0';
14378 type2String[0] = '\0';
14381 PrintExpression(exp->op.exp1, expString1);
14382 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14383 PrintExpression(exp->op.exp2, expString2);
14384 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14385 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14386 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14388 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14389 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14391 exp->expType = exp->op.exp1->expType;
14392 if(exp->op.exp1->expType)
14393 exp->op.exp1->expType->refCount++;
14395 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14397 exp->expType = exp->op.exp2->expType;
14398 if(exp->op.exp2->expType)
14399 exp->op.exp2->expType->refCount++;
14406 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14408 struct Type * oldType = exp->op.exp1->expType;
14410 exp->op.exp1->expType = (((void *)0));
14411 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14414 exp->op.exp1->expType = oldType;
14416 if(exp->op.exp1->destType)
14417 FreeType(exp->op.exp1->destType);
14418 exp->op.exp1->destType = type2;
14420 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14423 FreeType(exp->expType);
14424 exp->expType = exp->op.exp1->destType;
14425 if(exp->op.exp1->destType)
14426 exp->op.exp1->destType->refCount++;
14430 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14432 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14434 if(exp->op.exp1->destType)
14435 FreeType(exp->op.exp1->destType);
14436 exp->op.exp1->destType = type2->_class->registered->dataType;
14437 if(type2->_class->registered->dataType)
14438 type2->_class->registered->dataType->refCount++;
14439 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14441 if(exp->op.op == '!')
14443 exp->expType = MkClassType("bool");
14444 exp->expType->truth = 0x1;
14448 exp->expType = type2;
14453 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14455 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14457 if(exp->op.exp2->destType)
14458 FreeType(exp->op.exp2->destType);
14459 exp->op.exp2->destType = type1->_class->registered->dataType;
14460 if(type1->_class->registered->dataType)
14461 type1->_class->registered->dataType->refCount++;
14462 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14464 exp->expType = type1;
14470 if(exp->op.exp1 && !exp->op.exp1->expType)
14472 char expString[10000];
14474 expString[0] = '\0';
14477 PrintExpression(exp->op.exp1, expString);
14478 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14481 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14483 if(exp->op.exp2 && !exp->op.exp2->expType)
14485 char expString[10240];
14487 expString[0] = '\0';
14490 PrintExpression(exp->op.exp2, expString);
14491 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14494 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
14498 FreeType(exp->expType);
14499 exp->expType = MkClassType("bool");
14500 exp->expType->truth = 0x1;
14502 if(exp->op.op != SIZEOF)
14503 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14504 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14506 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14508 yylloc = oldyylloc;
14515 struct Expression * e;
14517 exp->isConstant = 0x1;
14518 for(e = (*exp->list).first; e; e = e->next)
14520 unsigned int inced = 0x0;
14524 FreeType(e->destType);
14525 e->destType = exp->destType;
14528 exp->destType->refCount++;
14529 e->destType->count++;
14533 ProcessExpressionType(e);
14535 exp->destType->count--;
14536 if(!exp->expType && !e->next)
14538 exp->expType = e->expType;
14540 e->expType->refCount++;
14543 exp->isConstant = 0x0;
14545 e = (*exp->list).first;
14546 if(!e->next && e->type == 8)
14548 struct Expression * next = exp->next, * prev = exp->prev;
14550 FreeType(exp->expType);
14551 FreeType(exp->destType);
14552 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14556 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14557 ProcessExpressionType(exp);
14563 struct Expression * e;
14565 exp->isConstant = 0x1;
14566 ProcessExpressionType(exp->index.exp);
14567 if(!exp->index.exp->isConstant)
14568 exp->isConstant = 0x0;
14569 if(exp->index.exp->expType)
14571 struct Type * source = exp->index.exp->expType;
14573 if(source->kind == 8 && source->_class && source->_class->registered)
14575 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14576 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14578 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14580 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14581 if(exp->index.index && (*exp->index.index).last)
14583 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14588 for(e = (*exp->index.index).first; e; e = e->next)
14590 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14593 FreeType(e->destType);
14594 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14596 ProcessExpressionType(e);
14601 exp->isConstant = 0x0;
14604 exp->expType = Dereference(exp->index.exp->expType);
14606 DeclareType(exp->expType, 0x0, 0x0);
14611 struct Expression * e;
14612 struct Type * functionType;
14613 struct Type * methodType = (((void *)0));
14619 PrintExpression(exp->call.exp, name);
14620 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14622 PrintExpression(exp->call.exp, name);
14625 if(exp->call.exp->type == 0)
14627 struct Expression * idExp = exp->call.exp;
14628 struct Identifier * id = idExp->identifier;
14630 if(!strcmp(id->string, "__builtin_frame_address"))
14632 exp->expType = ProcessTypeString("void *", 0x1);
14633 if(exp->call.arguments && (*exp->call.arguments).first)
14634 ProcessExpressionType((*exp->call.arguments).first);
14637 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14639 exp->expType = ProcessTypeString("int", 0x1);
14640 if(exp->call.arguments && (*exp->call.arguments).first)
14641 ProcessExpressionType((*exp->call.arguments).first);
14644 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14646 struct Expression * a = (((void *)0));
14647 struct Expression * b = (((void *)0));
14648 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14650 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14652 a = (*exp->call.arguments).first;
14653 b = (*exp->call.arguments).last;
14657 else if((*exp->call.arguments).count == 1)
14659 a = (*exp->call.arguments).first;
14664 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14665 idExp->identifier = (((void *)0));
14666 FreeExpContents(exp);
14667 ProcessExpressionType(a);
14669 ProcessExpressionType(b);
14671 exp->list = MkList();
14672 if(a->expType && (!b || b->expType))
14674 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14678 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14679 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14680 struct Declaration * decl;
14681 char temp1[1024], temp2[1024];
14683 GetTypeSpecs(a->expType, specs);
14684 if(a && !a->isConstant && a->type != 0)
14686 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14687 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14688 tempExp1 = QMkExpId(temp1);
14689 tempExp1->expType = a->expType;
14691 a->expType->refCount++;
14692 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14694 if(b && !b->isConstant && b->type != 0)
14696 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14697 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14698 tempExp2 = QMkExpId(temp2);
14699 tempExp2->expType = b->expType;
14701 b->expType->refCount++;
14702 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14704 decl = MkDeclaration(specs, decls);
14705 if(!curCompound->compound.declarations)
14706 curCompound->compound.declarations = MkList();
14707 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14711 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14713 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14715 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14716 exp->expType = a->expType;
14718 a->expType->refCount++;
14720 else if(!strcmp(id->string, "Abs"))
14722 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14723 exp->expType = a->expType;
14725 a->expType->refCount++;
14727 else if(!strcmp(id->string, "Sgn"))
14729 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"))))));
14730 exp->expType = ProcessTypeString("int", 0x0);
14732 FreeExpression(tempExp1);
14734 FreeExpression(tempExp2);
14735 FreeIdentifier(id);
14741 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14743 if(!exp->call.exp->destType)
14745 exp->call.exp->destType = dummy;
14748 ProcessExpressionType(exp->call.exp);
14749 if(exp->call.exp->destType == dummy)
14752 exp->call.exp->destType = (((void *)0));
14756 functionType = exp->call.exp->expType;
14757 if(functionType && functionType->kind == 16)
14759 methodType = functionType;
14760 functionType = methodType->method->dataType;
14761 if(exp->call.exp->expType->usedClass)
14763 char typeString[1024];
14765 typeString[0] = '\0';
14767 struct Symbol * back = functionType->thisClass;
14769 functionType->thisClass = (((void *)0));
14770 PrintType(functionType, typeString, 0x1, 0x1);
14771 functionType->thisClass = back;
14773 if(strstr(typeString, "thisclass"))
14775 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14776 struct Declarator * decl;
14779 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14781 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14782 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14783 thisClassParams = 0x0;
14784 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14786 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14788 thisClass = exp->call.exp->expType->usedClass;
14789 ProcessDeclarator(decl);
14790 thisClass = backupThisClass;
14792 thisClassParams = 0x1;
14793 functionType = ProcessType(specs, decl);
14794 functionType->refCount = 0;
14795 FinishTemplatesContext(context);
14797 FreeList(specs, FreeSpecifier);
14798 FreeDeclarator(decl);
14802 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14804 struct Type * type = functionType->type;
14806 if(!functionType->refCount)
14808 functionType->type = (((void *)0));
14809 FreeType(functionType);
14811 functionType = type;
14813 if(functionType && functionType->kind != 11)
14815 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "called object %s is not a function\n", (((void *)0))), name);
14817 else if(functionType)
14819 unsigned int emptyParams = 0x0, noParams = 0x0;
14820 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14821 struct Type * type = functionType->params.first;
14822 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14824 struct Location oldyylloc = yylloc;
14828 if(functionType->extraParam && e && functionType->thisClass)
14830 e->destType = MkClassType(functionType->thisClass->string);
14833 if(!functionType->staticMethod && !functionType->extraParam)
14835 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14837 type = MkClassType(memberExp->member.exp->expType->_class->string);
14840 e->destType = type;
14842 type = functionType->params.first;
14845 type->refCount = 0;
14847 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14849 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14850 type->byReference = functionType->byReference;
14851 type->typedByReference = functionType->typedByReference;
14854 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14856 e->destType = type;
14858 type = functionType->params.first;
14861 type->refCount = 0;
14864 if(type && type->kind == 0)
14867 if(!type->refCount)
14869 type = (((void *)0));
14871 for(; e; e = e->next)
14873 if(!type && !emptyParams)
14876 if(methodType && methodType->methodClass)
14877 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14882 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14884 struct Type * templatedType = (((void *)0));
14885 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14886 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14889 if(_class && _class->templateArgs)
14891 struct __ecereNameSpace__ecere__com__Class * sClass;
14893 for(sClass = _class; sClass; sClass = sClass->base)
14895 if(sClass->templateClass)
14896 sClass = sClass->templateClass;
14898 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14900 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14902 struct __ecereNameSpace__ecere__com__Class * nextClass;
14904 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14906 if(nextClass->templateClass)
14907 nextClass = nextClass->templateClass;
14908 id += nextClass->templateParams.count;
14918 if(curParam && _class->templateArgs[id].dataTypeString)
14920 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14923 struct Context * context = SetupTemplatesContext(_class);
14925 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14926 FinishTemplatesContext(context);
14928 e->destType = templatedType;
14931 templatedType->passAsTemplate = 0x1;
14936 e->destType = type;
14943 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14945 e->destType = type->prev;
14946 e->destType->refCount++;
14950 e->destType = type;
14955 if(type && type->kind != 14)
14957 struct Type * next = type->next;
14959 if(!type->refCount)
14964 if(type && type->kind != 14)
14966 if(methodType && methodType->methodClass)
14967 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14969 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "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);
14971 yylloc = oldyylloc;
14972 if(type && !type->refCount)
14977 functionType = __extension__ ({
14978 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14980 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
14982 if(exp->call.exp->type == 0)
14984 char * string = exp->call.exp->identifier->string;
14988 struct Symbol * symbol;
14989 struct Location oldyylloc = yylloc;
14991 yylloc = exp->call.exp->identifier->loc;
14992 if(strstr(string, "__builtin_") == string)
14996 functionType->returnType = exp->destType;
14997 exp->destType->refCount++;
15001 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15002 symbol = __extension__ ({
15003 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15005 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15007 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15008 if(strstr(symbol->string, "::"))
15009 globalContext->hasNameSpace = 0x1;
15010 yylloc = oldyylloc;
15013 else if(exp->call.exp->type == 8)
15017 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "callable object undefined; extern assuming returning int\n", (((void *)0))));
15018 if(!functionType->returnType)
15020 functionType->returnType = __extension__ ({
15021 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15023 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15027 if(functionType && functionType->kind == 11)
15029 exp->expType = functionType->returnType;
15030 if(functionType->returnType)
15031 functionType->returnType->refCount++;
15032 if(!functionType->refCount)
15033 FreeType(functionType);
15035 if(exp->call.arguments)
15037 for(e = (*exp->call.arguments).first; e; e = e->next)
15039 struct Type * destType = e->destType;
15041 ProcessExpressionType(e);
15048 struct Type * type;
15049 struct Location oldyylloc = yylloc;
15050 unsigned int thisPtr;
15051 struct Expression * checkExp = exp->member.exp;
15055 if(checkExp->type == 11)
15056 checkExp = checkExp->cast.exp;
15057 else if(checkExp->type == 5)
15058 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15062 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15063 exp->thisPtr = thisPtr;
15064 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15066 exp->member.member->classSym = exp->member.member->_class->symbol;
15068 ProcessExpressionType(exp->member.exp);
15069 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)
15071 exp->isConstant = 0x0;
15074 exp->isConstant = exp->member.exp->isConstant;
15075 type = exp->member.exp->expType;
15077 if(type && (type->kind == 20))
15079 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15080 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15084 for(param = _class->templateParams.first; param; param = param->next)
15086 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15090 if(param && param->defaultArg.member)
15092 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15096 struct Expression * expMember = exp->member.exp;
15097 struct Declarator * decl;
15098 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15099 char thisClassTypeString[1024];
15101 FreeIdentifier(exp->member.member);
15102 ProcessExpressionType(argExp);
15104 char * colon = strstr(param->defaultArg.memberString, "::");
15108 char className[1024];
15109 struct __ecereNameSpace__ecere__com__Class * sClass;
15111 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15112 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15115 strcpy(thisClassTypeString, _class->fullName);
15117 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15118 exp->expType = ProcessType(specs, decl);
15119 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15121 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15122 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15124 int paramCount = 0;
15125 int lastParam = -1;
15126 char templateString[1024];
15127 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15129 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15130 for(cClass = expClass; cClass; cClass = cClass->base)
15134 for(param = cClass->templateParams.first; param; param = param->next)
15137 struct __ecereNameSpace__ecere__com__Class * sClass;
15138 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15140 for(sClass = cClass->base; sClass; sClass = sClass->base)
15141 id += sClass->templateParams.count;
15142 arg = expClass->templateArgs[id];
15143 for(sClass = _class; sClass; sClass = sClass->base)
15145 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15147 struct __ecereNameSpace__ecere__com__Class * nextClass;
15149 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15150 p += nextClass->templateParams.count;
15151 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15153 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15155 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15157 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15158 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15165 char argument[256];
15167 argument[0] = '\0';
15168 switch(param->type)
15172 char expString[1024];
15173 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15174 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15175 struct Expression * exp;
15176 char * string = PrintHexUInt64(arg.expression.ui64);
15178 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15179 ProcessExpressionType(exp);
15180 ComputeExpression(exp);
15181 expString[0] = '\0';
15182 PrintExpression(exp, expString);
15183 strcat(argument, expString);
15184 FreeExpression(exp);
15189 strcat(argument, arg.member->name);
15194 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15196 if(!strcmp(arg.dataTypeString, "thisclass"))
15197 strcat(argument, thisClassTypeString);
15199 strcat(argument, arg.dataTypeString);
15207 strcat(templateString, ", ");
15208 if(lastParam != p - 1)
15210 strcat(templateString, param->name);
15211 strcat(templateString, " = ");
15213 strcat(templateString, argument);
15222 int len = strlen(templateString);
15224 if(templateString[len - 1] == '>')
15225 templateString[len++] = ' ';
15226 templateString[len++] = '>';
15227 templateString[len++] = '\0';
15230 struct Context * context = SetupTemplatesContext(_class);
15232 FreeType(exp->expType);
15233 exp->expType = ProcessTypeString(templateString, 0x0);
15234 FinishTemplatesContext(context);
15238 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")))))))));
15241 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15243 type = ProcessTemplateParameterType(type->templateParameter);
15246 if(type && (type->kind == 20))
15248 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)))
15250 struct Identifier * id = exp->member.member;
15251 int typeKind = type->kind;
15252 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));
15254 if(typeKind == 19 && exp->member.exp->type == 26)
15256 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15261 if(typeKind == 3 || typeKind == 15)
15262 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15265 if(type->kind == 8 && type->_class && type->_class->registered)
15267 _class = type->_class->registered;
15269 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15271 _class = FindClass("char *")->registered;
15273 else if(type->kind == 13)
15275 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15276 FreeType(exp->expType);
15277 exp->expType = ProcessTypeString("uintptr", 0x0);
15278 exp->byReference = 0x1;
15282 char string[1024] = "";
15283 struct Symbol * classSym;
15285 PrintTypeNoConst(type, string, 0x0, 0x1);
15286 classSym = FindClass(string);
15288 _class = classSym->registered;
15294 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15295 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15296 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15297 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15298 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15300 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15301 exp->member.memberType = 1;
15302 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15303 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15306 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15308 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15309 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15311 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15313 member = (((void *)0));
15315 if(!member && !prop)
15316 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15317 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15318 exp->member.thisPtr = 0x1;
15324 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15325 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15326 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15328 if(!prop && !member)
15330 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15333 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15334 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15335 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15340 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15341 prop = (((void *)0));
15343 member = (((void *)0));
15347 if(!prop && !member && !method)
15348 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15349 if(!prop && !member && !method)
15353 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15356 exp->member.memberType = 5;
15357 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15361 char structName[1024];
15362 struct Identifier * id = exp->member.member;
15363 struct Expression * classExp = exp->member.exp;
15366 FreeType(classExp->expType);
15367 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15368 strcpy(structName, "__ecereClassData_");
15369 FullClassNameCat(structName, type->_class->string, 0x0);
15371 exp->member.member = id;
15372 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"))))))));
15374 ProcessExpressionType(exp);
15380 struct Symbol * classSym = FindClass(id->string);
15384 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15387 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15393 exp->member.memberType = 1;
15394 if(!prop->dataType)
15395 ProcessPropertyType(prop);
15396 exp->expType = prop->dataType;
15398 prop->dataType->refCount++;
15402 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15404 FreeExpContents(exp);
15406 exp->identifier = MkIdentifier("class");
15407 ProcessExpressionType(exp);
15410 exp->member.memberType = 3;
15411 DeclareStruct(_class->fullName, 0x0);
15412 if(!member->dataType)
15414 struct Context * context = SetupTemplatesContext(_class);
15416 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15417 FinishTemplatesContext(context);
15419 exp->expType = member->dataType;
15420 if(member->dataType)
15421 member->dataType->refCount++;
15423 else if(revConvert)
15425 exp->member.memberType = 4;
15426 exp->expType = MkClassType(revConvert->_class->fullName);
15431 exp->member.memberType = 2;
15433 if(!method->dataType)
15434 ProcessMethodType(method);
15435 exp->expType = __extension__ ({
15436 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15438 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15440 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15441 exp->expType->usedClass = _class;
15443 else if(!classProp)
15445 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15447 FreeExpContents(exp);
15449 exp->identifier = MkIdentifier("class");
15450 ProcessExpressionType(exp);
15453 yylloc = exp->member.member->loc;
15454 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15456 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15458 if(_class && exp->expType)
15460 struct __ecereNameSpace__ecere__com__Class * tClass;
15463 while(tClass && !tClass->templateClass)
15464 tClass = tClass->base;
15465 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15468 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15469 struct __ecereNameSpace__ecere__com__Class * sClass;
15471 for(sClass = tClass; sClass; sClass = sClass->base)
15474 if(sClass->templateClass)
15475 sClass = sClass->templateClass;
15476 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15478 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15480 for(sClass = sClass->base; sClass; sClass = sClass->base)
15481 id += sClass->templateParams.count;
15489 if(curParam && tClass->templateArgs[id].dataTypeString)
15491 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15492 struct Context * context = SetupTemplatesContext(tClass);
15494 FreeType(exp->expType);
15495 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15498 if(exp->expType->kind == 21)
15500 FreeType(exp->expType);
15501 exp->expType = ReplaceThisClassType(_class);
15503 if(tClass->templateClass)
15504 exp->expType->passAsTemplate = 0x1;
15507 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15508 if(exp->destType->kind == 21)
15510 FreeType(exp->destType);
15511 exp->destType = ReplaceThisClassType(_class);
15515 FinishTemplatesContext(context);
15518 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15521 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15522 struct __ecereNameSpace__ecere__com__Class * sClass;
15524 for(sClass = tClass; sClass; sClass = sClass->base)
15527 if(sClass->templateClass)
15528 sClass = sClass->templateClass;
15529 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15531 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15533 for(sClass = sClass->base; sClass; sClass = sClass->base)
15534 id += sClass->templateParams.count;
15544 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15545 struct Context * context = SetupTemplatesContext(tClass);
15546 struct Type * basicType;
15548 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15551 if(basicType->kind == 21)
15553 FreeType(basicType);
15554 basicType = ReplaceThisClassType(_class);
15556 FreeType(exp->expType);
15557 exp->expType = __extension__ ({
15558 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15560 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15564 exp->destType = exp->expType;
15565 exp->destType->refCount++;
15568 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15569 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15570 struct Declarator * decl;
15572 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15575 exp->destType->refCount++;
15577 exp->expType->refCount++;
15579 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15580 exp->cast.exp = newExp;
15583 FinishTemplatesContext(context);
15586 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15588 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15592 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15595 int paramCount = 0;
15596 int lastParam = -1;
15597 char templateString[1024];
15598 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15600 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15601 while(cClass != expClass)
15603 struct __ecereNameSpace__ecere__com__Class * sClass;
15605 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15608 for(param = cClass->templateParams.first; param; param = param->next)
15610 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15613 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15614 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15616 while(cClassCur != tClass && !paramCur)
15618 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15620 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15622 cClassCur = sClassCur;
15623 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15625 if(!strcmp(paramCur->name, param->name))
15632 if(paramCur && paramCur->type == 0)
15633 arg = tClass->templateArgs[cp];
15635 arg = expClass->templateArgs[p];
15637 char argument[256];
15639 argument[0] = '\0';
15640 switch(param->type)
15644 char expString[1024];
15645 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15646 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15647 struct Expression * exp;
15648 char * string = PrintHexUInt64(arg.expression.ui64);
15650 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15651 ProcessExpressionType(exp);
15652 ComputeExpression(exp);
15653 expString[0] = '\0';
15654 PrintExpression(exp, expString);
15655 strcat(argument, expString);
15656 FreeExpression(exp);
15661 strcat(argument, arg.member->name);
15666 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15667 strcat(argument, arg.dataTypeString);
15674 strcat(templateString, ", ");
15675 if(lastParam != p - 1)
15677 strcat(templateString, param->name);
15678 strcat(templateString, " = ");
15680 strcat(templateString, argument);
15689 int len = strlen(templateString);
15691 if(templateString[len - 1] == '>')
15692 templateString[len++] = ' ';
15693 templateString[len++] = '>';
15694 templateString[len++] = '\0';
15696 FreeType(exp->expType);
15698 struct Context * context = SetupTemplatesContext(tClass);
15700 exp->expType = ProcessTypeString(templateString, 0x0);
15701 FinishTemplatesContext(context);
15708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "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)");
15710 else if(type && (type->kind == 9 || type->kind == 10))
15712 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15716 exp->expType = memberType;
15718 memberType->refCount++;
15723 char expString[10240];
15725 expString[0] = '\0';
15728 PrintExpression(exp, expString);
15729 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15731 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15733 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15735 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15737 struct Identifier * id = exp->member.member;
15738 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));
15742 FreeType(exp->expType);
15743 exp->expType = ReplaceThisClassType(_class);
15747 yylloc = oldyylloc;
15752 struct Type * destType = exp->destType;
15754 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15756 exp->member.member->classSym = exp->member.member->_class->symbol;
15758 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15762 ProcessExpressionType(exp);
15769 struct Symbol * classSym = exp->_class->symbol;
15771 if(classSym && classSym->registered)
15773 if(classSym->registered->type == 5)
15778 DeclareStruct(classSym->string, 0x0);
15779 FreeSpecifier(exp->_class);
15781 FullClassNameCat(name, classSym->string, 0x0);
15782 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15786 if(classSym->registered->fixed)
15788 FreeSpecifier(exp->_class);
15789 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15794 char className[1024];
15796 strcpy(className, "__ecereClass_");
15797 FullClassNameCat(className, classSym->string, 0x1);
15798 MangleClassName(className);
15799 DeclareClass(classSym, className);
15800 FreeExpContents(exp);
15802 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15803 exp->member.member = MkIdentifier("structSize");
15807 exp->expType = __extension__ ({
15808 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15810 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15816 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15818 exp->expType = __extension__ ({
15819 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15821 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15823 exp->isConstant = 0x1;
15824 DeclareType(type, 0x0, 0x0);
15830 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15833 FreeType(exp->cast.exp->destType);
15834 exp->cast.exp->destType = type;
15836 ProcessExpressionType(exp->cast.exp);
15838 exp->expType = type;
15839 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15841 void * prev = exp->prev, * next = exp->next;
15842 struct Type * expType = exp->cast.exp->destType;
15843 struct Expression * castExp = exp->cast.exp;
15844 struct Type * destType = exp->destType;
15847 expType->refCount++;
15848 FreeType(exp->expType);
15849 FreeTypeName(exp->cast.typeName);
15851 FreeType(exp->expType);
15852 FreeType(exp->destType);
15853 exp->expType = expType;
15854 exp->destType = destType;
15855 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15861 exp->isConstant = exp->cast.exp->isConstant;
15867 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15869 exp->expType = type;
15874 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15876 ProcessExpressionType(exp->vaArg.exp);
15877 exp->expType = type;
15882 struct Expression * e;
15884 exp->isConstant = 0x1;
15885 FreeType(exp->cond.cond->destType);
15886 exp->cond.cond->destType = MkClassType("bool");
15887 exp->cond.cond->destType->truth = 0x1;
15888 ProcessExpressionType(exp->cond.cond);
15889 if(!exp->cond.cond->isConstant)
15890 exp->isConstant = 0x0;
15891 for(e = (*exp->cond.exp).first; e; e = e->next)
15895 FreeType(e->destType);
15896 e->destType = exp->destType;
15898 e->destType->refCount++;
15900 ProcessExpressionType(e);
15903 exp->expType = e->expType;
15905 e->expType->refCount++;
15908 exp->isConstant = 0x0;
15910 FreeType(exp->cond.elseExp->destType);
15911 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15912 if(exp->cond.elseExp->destType)
15913 exp->cond.elseExp->destType->refCount++;
15914 ProcessExpressionType(exp->cond.elseExp);
15915 if(!exp->cond.elseExp->isConstant)
15916 exp->isConstant = 0x0;
15921 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15923 struct Statement * last = (*exp->compound->compound.statements).last;
15925 if(last->type == 3 && last->expressions && (*last->expressions).last)
15927 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15929 exp->destType->refCount++;
15931 ProcessStatement(exp->compound);
15932 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15934 exp->expType->refCount++;
15940 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15942 if(spec && spec->type == 1)
15944 exp->expType = MkClassType(spec->name);
15945 exp->expType->kind = 19;
15946 exp->byReference = 0x1;
15950 exp->expType = MkClassType("ecere::com::Class");
15951 exp->byReference = 0x1;
15957 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15961 struct Identifier * id = exp->classData.id;
15962 char structName[1024];
15963 struct Expression * classExp;
15965 strcpy(structName, "__ecereClassData_");
15966 FullClassNameCat(structName, _class->fullName, 0x0);
15968 exp->member.member = id;
15969 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
15970 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
15972 classExp = MkExpIdentifier(MkIdentifier("class"));
15973 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"))))))));
15974 ProcessExpressionType(exp);
15981 struct Type * type = (((void *)0));
15982 char * typeString = (((void *)0));
15983 char typeStringBuf[1024];
15985 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))
15987 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
15989 typeString = templateClass->templateArgs[2].dataTypeString;
15993 struct Expression * e;
15995 for(e = (*exp->list).first; e; e = e->next)
15997 ProcessExpressionType(e);
16007 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16011 e->expType = (((void *)0));
16012 e = (*exp->list).first;
16013 ProcessExpressionType(e);
16016 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16018 FreeType(e->expType);
16019 e->expType = (((void *)0));
16021 type = (((void *)0));
16029 FreeType(e->expType);
16030 e->expType = (((void *)0));
16036 typeStringBuf[0] = '\0';
16037 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16038 typeString = typeStringBuf;
16040 type = (((void *)0));
16045 char templateString[1024];
16046 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16047 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16048 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16049 struct Expression * expExt;
16050 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16052 sprintf(templateString, "Container<%s>", typeString);
16055 struct Expression * e;
16057 type = ProcessTypeString(typeString, 0x0);
16058 while(e = (*exp->list).first)
16060 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16061 e->destType = type;
16063 ProcessExpressionType(e);
16064 ListAdd(initializers, MkInitializerAssignment(e));
16067 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16069 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16070 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16071 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16072 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16073 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16074 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16075 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16076 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16077 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16078 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16079 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16081 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16083 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16084 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16085 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16086 exp->expType = ProcessTypeString(templateString, 0x0);
16088 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16089 ProcessExpressionType(expExt);
16093 exp->expType = ProcessTypeString("Container", 0x0);
16094 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
16099 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16101 FreeType(exp->expType);
16102 exp->expType = ReplaceThisClassType(thisClass);
16104 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16106 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16110 if(exp->expType->kind != 15)
16112 struct Type * member;
16113 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16115 FreeType(exp->expType);
16116 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16117 exp->expType->kind = symbol->type->kind;
16118 exp->expType->refCount++;
16119 exp->expType->enumName = enumName;
16120 exp->expType->members = symbol->type->members;
16121 for(member = symbol->type->members.first; member; member = member->next)
16122 member->refCount++;
16126 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16128 for(member = symbol->type->members.first; member; member = member->next)
16130 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16138 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16140 else if(exp->destType && !exp->destType->keepCast)
16142 if(!CheckExpressionType(exp, exp->destType, 0x0))
16144 if(!exp->destType->count || unresolved)
16149 if(exp->destType->kind != 14)
16156 char expString[10240];
16158 expString[0] = '\0';
16159 PrintType(exp->destType, type2, 0x0, 0x1);
16162 PrintExpression(exp, expString);
16163 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16166 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16167 else if(exp->type != 16)
16168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16173 char expString[10240];
16175 expString[0] = '\0';
16178 PrintExpression(exp, expString);
16179 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16182 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), expString);
16183 else if(exp->type != 16)
16184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16196 PrintType(exp->expType, type1, 0x0, 0x1);
16197 PrintType(exp->destType, type2, 0x0, 0x1);
16199 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)))
16203 char expString[10240];
16205 expString[0] = '\0';
16208 PrintExpression(exp, expString);
16209 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16211 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16212 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString("ec", "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16213 FreeType(exp->expType);
16214 exp->destType->refCount++;
16215 exp->expType = exp->destType;
16220 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16222 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16223 char typeString[1024];
16224 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16225 struct Declarator * decl;
16227 typeString[0] = '\0';
16230 exp->expType->refCount++;
16232 exp->expType->refCount++;
16234 newExp->destType = exp->expType;
16235 PrintType(exp->expType, typeString, 0x0, 0x0);
16236 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16237 exp->cast.typeName = MkTypeName(specs, decl);
16238 exp->cast.exp = newExp;
16241 else if(unresolved)
16243 if(exp->identifier->_class && exp->identifier->_class->name)
16244 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16245 else if(exp->identifier->string && exp->identifier->string[0])
16246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16248 else if(!exp->expType && exp->type != 16)
16250 char expString[10240];
16252 expString[0] = '\0';
16255 PrintExpression(exp, expString);
16256 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16258 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "couldn't determine type of %s\n", (((void *)0))), expString);
16261 ApplyAnyObjectLogic(exp);
16262 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 && exp->destType->kind != 24)))
16264 exp->byReference = 0x1;
16266 yylloc = oldyylloc;
16269 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)
16273 *curMember = (*curMember)->next;
16274 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16276 *curMember = subMemberStack[--(*subMemberStackPos)];
16277 *curMember = (*curMember)->next;
16279 while((*curMember) && (*curMember)->isProperty)
16280 *curMember = (*curMember)->next;
16281 if(subMemberStackPos)
16283 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16285 subMemberStack[(*subMemberStackPos)++] = *curMember;
16286 *curMember = (*curMember)->members.first;
16287 while(*curMember && (*curMember)->isProperty)
16288 *curMember = (*curMember)->next;
16296 if(subMemberStackPos && *subMemberStackPos)
16298 *curMember = subMemberStack[--(*subMemberStackPos)];
16299 *curMember = (*curMember)->next;
16303 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16305 if(*curClass == _class)
16307 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16309 *curMember = (*curClass)->membersAndProperties.first;
16311 while((*curMember) && (*curMember)->isProperty)
16312 *curMember = (*curMember)->next;
16313 if(subMemberStackPos)
16315 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16317 subMemberStack[(*subMemberStackPos)++] = *curMember;
16318 *curMember = (*curMember)->members.first;
16319 while(*curMember && (*curMember)->isProperty)
16320 *curMember = (*curMember)->next;
16327 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16332 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16334 if(init->exp && !init->exp->destType)
16336 FreeType(init->exp->destType);
16337 init->exp->destType = type;
16343 ProcessExpressionType(init->exp);
16344 init->isConstant = init->exp->isConstant;
16350 struct Expression * exp = init->exp;
16351 struct Instantiation * inst = exp->instance;
16352 struct MembersInit * members;
16355 init->list = MkList();
16358 for(members = (*inst->members).first; members; members = members->next)
16360 if(members->type == 0)
16362 struct MemberInit * member;
16364 for(member = (*members->dataMembers).first; member; member = member->next)
16366 ListAdd(init->list, member->initializer);
16367 member->initializer = (((void *)0));
16372 FreeExpression(exp);
16376 struct Initializer * i;
16377 struct Type * initializerType = (((void *)0));
16378 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16379 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16380 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16381 int subMemberStackPos = 0;
16383 if(type && type->kind == 12)
16384 initializerType = Dereference(type);
16385 else if(type && (type->kind == 9 || type->kind == 10))
16386 initializerType = type->members.first;
16387 for(i = (*init->list).first; i; i = i->next)
16389 if(type && type->kind == 8 && type->_class && type->_class->registered)
16391 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16394 if(!curMember->dataType)
16395 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16396 initializerType = curMember->dataType;
16399 ProcessInitializer(i, initializerType);
16400 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16401 initializerType = initializerType->next;
16403 init->isConstant = 0x0;
16405 if(type && type->kind == 12)
16406 FreeType(initializerType);
16407 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16409 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Assigning list initializer to non list\n", (((void *)0))));
16416 extern struct Symbol * FindType(struct Context * ctx, char * name);
16418 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16420 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16426 if(spec->specifier == THISCLASS)
16431 spec->name = ReplaceThisClass(thisClass);
16432 spec->symbol = FindClass(spec->name);
16433 ProcessSpecifier(spec, declareStruct);
16440 struct Symbol * symbol = FindType(curContext, spec->name);
16443 DeclareType(symbol->type, 0x1, 0x1);
16444 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16445 DeclareStruct(spec->name, 0x0);
16450 struct Enumerator * e;
16454 for(e = (*spec->list).first; e; e = e->next)
16457 ProcessExpressionType(e->exp);
16465 if(spec->definitions)
16467 struct ClassDef * def;
16468 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16470 ProcessClass(spec->definitions, symbol);
16477 static void ProcessDeclarator(struct Declarator * decl)
16482 if(decl->identifier->classSym)
16484 FreeSpecifier(decl->identifier->_class);
16485 decl->identifier->_class = (((void *)0));
16489 if(decl->array.exp)
16490 ProcessExpressionType(decl->array.exp);
16497 if(decl->declarator)
16498 ProcessDeclarator(decl->declarator);
16499 if(decl->type == 4)
16501 struct Identifier * id = GetDeclId(decl);
16503 if(id && id->_class)
16505 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16507 if(!decl->function.parameters)
16508 decl->function.parameters = MkList();
16509 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16510 id->_class = (((void *)0));
16512 if(decl->function.parameters)
16514 struct TypeName * param;
16516 for(param = (*decl->function.parameters).first; param; param = param->next)
16518 if(param->qualifiers && (*param->qualifiers).first)
16520 struct Specifier * spec = (*param->qualifiers).first;
16522 if(spec && spec->specifier == TYPED_OBJECT)
16524 struct Declarator * d = param->declarator;
16525 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);
16527 FreeList(param->qualifiers, FreeSpecifier);
16528 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16529 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16530 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16533 else if(spec && spec->specifier == ANY_OBJECT)
16535 struct Declarator * d = param->declarator;
16537 FreeList(param->qualifiers, FreeSpecifier);
16538 param->qualifiers = MkListOne(MkSpecifier(VOID));
16539 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16541 else if(spec->specifier == THISCLASS)
16546 spec->name = ReplaceThisClass(thisClass);
16547 spec->symbol = FindClass(spec->name);
16548 ProcessSpecifier(spec, 0x0);
16552 if(param->declarator)
16553 ProcessDeclarator(param->declarator);
16561 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16563 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16565 static void ProcessDeclaration(struct Declaration * decl)
16567 yylloc = decl->loc;
16572 unsigned int declareStruct = 0x0;
16574 if(decl->declarators)
16576 struct InitDeclarator * d;
16578 for(d = (*decl->declarators).first; d; d = d->next)
16580 struct Type * type, * subType;
16582 ProcessDeclarator(d->declarator);
16583 type = ProcessType(decl->specifiers, d->declarator);
16586 ProcessInitializer(d->initializer, type);
16587 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16589 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16591 struct Instantiation * inst = d->initializer->exp->instance;
16593 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16594 d->initializer->exp->instance = (((void *)0));
16595 if(decl->specifiers)
16596 FreeList(decl->specifiers, FreeSpecifier);
16597 FreeList(decl->declarators, FreeInitDeclarator);
16604 for(subType = type; subType; )
16606 if(subType->kind == 8)
16608 declareStruct = 0x1;
16611 else if(subType->kind == 13)
16613 else if(subType->kind == 12)
16614 subType = subType->arrayType;
16623 if(decl->specifiers)
16625 struct Specifier * s;
16627 for(s = (*decl->specifiers).first; s; s = s->next)
16629 ProcessSpecifier(s, declareStruct);
16636 ProcessInstantiationType(decl->inst);
16641 struct Specifier * spec;
16642 struct Declarator * d;
16643 unsigned int declareStruct = 0x0;
16645 if(decl->declarators)
16647 for(d = (*decl->declarators).first; d; d = d->next)
16649 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16650 struct Type * subType;
16652 ProcessDeclarator(d);
16653 for(subType = type; subType; )
16655 if(subType->kind == 8)
16657 declareStruct = 0x1;
16660 else if(subType->kind == 13)
16662 else if(subType->kind == 12)
16663 subType = subType->arrayType;
16670 if(decl->specifiers)
16672 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16673 ProcessSpecifier(spec, declareStruct);
16680 static struct FunctionDefinition * curFunction;
16682 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16684 char propName[1024], propNameM[1024];
16685 char getName[1024], setName[1024];
16686 struct __ecereNameSpace__ecere__sys__OldList * args;
16688 DeclareProperty(prop, setName, getName);
16689 strcpy(propName, "__ecereProp_");
16690 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16691 strcat(propName, "_");
16692 FullClassNameCat(propName, prop->name, 0x1);
16693 MangleClassName(propName);
16694 strcpy(propNameM, "__ecerePropM_");
16695 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16696 strcat(propNameM, "_");
16697 FullClassNameCat(propNameM, prop->name, 0x1);
16698 MangleClassName(propNameM);
16699 if(prop->isWatchable)
16702 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16703 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16704 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16706 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16707 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16708 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16712 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16713 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16714 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16716 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16717 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16718 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16720 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16721 curFunction->propSet->fireWatchersDone = 0x1;
16724 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16726 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16728 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16730 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16732 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16734 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16736 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16738 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16740 static void ProcessStatement(struct Statement * stmt)
16742 yylloc = stmt->loc;
16746 ProcessStatement(stmt->labeled.stmt);
16749 if(stmt->caseStmt.exp)
16751 FreeType(stmt->caseStmt.exp->destType);
16752 stmt->caseStmt.exp->destType = curSwitchType;
16754 curSwitchType->refCount++;
16755 ProcessExpressionType(stmt->caseStmt.exp);
16756 ComputeExpression(stmt->caseStmt.exp);
16758 if(stmt->caseStmt.stmt)
16759 ProcessStatement(stmt->caseStmt.stmt);
16763 if(stmt->compound.context)
16765 struct Declaration * decl;
16766 struct Statement * s;
16767 struct Statement * prevCompound = curCompound;
16768 struct Context * prevContext = curContext;
16770 if(!stmt->compound.isSwitch)
16771 curCompound = stmt;
16772 curContext = stmt->compound.context;
16773 if(stmt->compound.declarations)
16775 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16776 ProcessDeclaration(decl);
16778 if(stmt->compound.statements)
16780 for(s = (*stmt->compound.statements).first; s; s = s->next)
16781 ProcessStatement(s);
16783 curContext = prevContext;
16784 curCompound = prevCompound;
16790 struct Expression * exp;
16792 if(stmt->expressions)
16794 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16795 ProcessExpressionType(exp);
16801 struct Expression * exp;
16803 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16804 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16805 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16806 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16808 ProcessExpressionType(exp);
16810 if(stmt->ifStmt.stmt)
16811 ProcessStatement(stmt->ifStmt.stmt);
16812 if(stmt->ifStmt.elseStmt)
16813 ProcessStatement(stmt->ifStmt.elseStmt);
16818 struct Type * oldSwitchType = curSwitchType;
16820 if(stmt->switchStmt.exp)
16822 struct Expression * exp;
16824 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16828 ProcessExpressionType(exp);
16831 curSwitchType = exp->expType;
16834 ProcessStatement(stmt->switchStmt.stmt);
16835 curSwitchType = oldSwitchType;
16840 if(stmt->whileStmt.exp)
16842 struct Expression * exp;
16844 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16845 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16846 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16847 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16849 ProcessExpressionType(exp);
16852 if(stmt->whileStmt.stmt)
16853 ProcessStatement(stmt->whileStmt.stmt);
16858 if(stmt->doWhile.exp)
16860 struct Expression * exp;
16862 if((*stmt->doWhile.exp).last)
16864 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16865 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16866 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16868 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16870 ProcessExpressionType(exp);
16873 if(stmt->doWhile.stmt)
16874 ProcessStatement(stmt->doWhile.stmt);
16879 struct Expression * exp;
16881 if(stmt->forStmt.init)
16882 ProcessStatement(stmt->forStmt.init);
16883 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16885 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16886 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16887 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16889 if(stmt->forStmt.check)
16890 ProcessStatement(stmt->forStmt.check);
16891 if(stmt->forStmt.increment)
16893 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16894 ProcessExpressionType(exp);
16896 if(stmt->forStmt.stmt)
16897 ProcessStatement(stmt->forStmt.stmt);
16902 struct Identifier * id = stmt->forEachStmt.id;
16903 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16904 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16905 struct Statement * block = stmt->forEachStmt.stmt;
16906 char iteratorType[1024];
16907 struct Type * source;
16908 struct Expression * e;
16909 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));
16910 struct Expression * arrayExp;
16911 char * typeString = (((void *)0));
16912 int builtinCount = 0;
16914 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16918 FreeType(e->destType);
16919 e->destType = ProcessTypeString("Container", 0x0);
16921 if(!isBuiltin || e->next)
16922 ProcessExpressionType(e);
16924 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16925 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16927 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16928 struct Symbol * symbol;
16929 struct Expression * expIt = (((void *)0));
16930 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16931 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16932 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16933 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16936 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16937 stmt->compound.context->parent = curContext;
16938 curContext = stmt->compound.context;
16939 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16941 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16942 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16944 isCustomAVLTree = 0x1;
16945 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16947 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16950 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16952 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16954 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16957 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16961 struct Declarator * decl;
16962 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16964 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
16965 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16966 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
16970 struct Type * type = (((void *)0));
16971 char typeStringBuf[1024];
16973 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
16974 if(((struct Expression *)(*exp).last)->type == 11)
16976 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
16979 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
16981 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)
16983 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
16985 typeString = templateClass->templateArgs[2].dataTypeString;
16987 else if(arrayExp->list)
16989 struct Expression * e;
16991 for(e = (*arrayExp->list).first; e; e = e->next)
16993 ProcessExpressionType(e);
17003 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17007 e->expType = (((void *)0));
17008 e = (*arrayExp->list).first;
17009 ProcessExpressionType(e);
17012 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17014 FreeType(e->expType);
17015 e->expType = (((void *)0));
17017 type = (((void *)0));
17025 FreeType(e->expType);
17026 e->expType = (((void *)0));
17032 typeStringBuf[0] = '\0';
17033 PrintType(type, typeStringBuf, 0x0, 0x1);
17034 typeString = typeStringBuf;
17040 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17041 struct Declarator * decl;
17042 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17046 struct Expression * e;
17048 builtinCount = (*arrayExp->list).count;
17049 type = ProcessTypeString(typeString, 0x0);
17050 while(e = (*arrayExp->list).first)
17052 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17053 e->destType = type;
17055 ProcessExpressionType(e);
17056 ListAdd(initializers, MkInitializerAssignment(e));
17059 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17061 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17062 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17063 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17064 FreeList(exp, FreeExpression);
17068 arrayExp->expType = ProcessTypeString("Container", 0x0);
17069 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Couldn't determine type of array elements\n", (((void *)0))));
17072 else if(isLinkList && !isList)
17074 struct Declarator * decl;
17075 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17077 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17078 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17079 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17081 else if(_class->templateArgs)
17084 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17086 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17087 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17089 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17092 switch(block->type)
17095 if(block->compound.context)
17096 block->compound.context->parent = stmt->compound.context;
17099 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17100 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17101 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17102 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17105 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17106 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17109 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17110 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17113 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17114 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17117 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17118 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17121 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17122 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17128 block = MkIfStmt(filter, block, (((void *)0)));
17132 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));
17133 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17134 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17135 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17141 sprintf(count, "%d", builtinCount);
17142 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));
17143 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17144 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17145 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17147 else if(isLinkList && !isList)
17149 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17150 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17152 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17154 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));
17158 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17159 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17161 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));
17163 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17164 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17165 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17169 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17171 ProcessExpressionType(expIt);
17172 if((*stmt->compound.declarations).first)
17173 ProcessDeclaration((*stmt->compound.declarations).first);
17175 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17176 ProcessStatement(stmt);
17177 curContext = stmt->compound.context->parent;
17182 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Expression is not a container\n", (((void *)0))));
17194 struct Expression * exp;
17196 if(stmt->expressions)
17198 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17202 if(curFunction && !curFunction->type)
17203 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17204 FreeType(exp->destType);
17205 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17207 exp->destType->refCount++;
17209 ProcessExpressionType(exp);
17216 ProcessDeclaration(stmt->decl);
17221 struct AsmField * field;
17223 if(stmt->asmStmt.inputFields)
17225 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17226 if(field->expression)
17227 ProcessExpressionType(field->expression);
17229 if(stmt->asmStmt.outputFields)
17231 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17232 if(field->expression)
17233 ProcessExpressionType(field->expression);
17235 if(stmt->asmStmt.clobberedFields)
17237 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17239 if(field->expression)
17240 ProcessExpressionType(field->expression);
17247 struct PropertyWatch * propWatch;
17248 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17249 struct Expression * object = stmt->_watch.object;
17250 struct Expression * watcher = stmt->_watch.watcher;
17253 ProcessExpressionType(watcher);
17255 ProcessExpressionType(object);
17258 if(watcher || thisClass)
17260 struct External * external = curExternal;
17261 struct Context * context = curContext;
17264 stmt->expressions = MkList();
17265 curExternal = external->prev;
17266 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17268 struct ClassFunction * func;
17269 char watcherName[1024];
17270 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17271 struct External * createdExternal;
17272 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17274 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17275 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17276 if(propWatch->deleteWatch)
17277 strcat(watcherName, "_delete");
17280 struct Identifier * propID;
17282 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17284 strcat(watcherName, "_");
17285 strcat(watcherName, propID->string);
17288 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17290 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17291 ProcessClassFunctionBody(func, propWatch->compound);
17292 propWatch->compound = (((void *)0));
17293 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17294 createdExternal->symbol->idCode = external->symbol->idCode;
17295 curExternal = createdExternal;
17296 ProcessFunction(createdExternal->function);
17298 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17300 externalDecl->declaration = decl;
17301 if(decl->symbol && !decl->symbol->pointerExternal)
17302 decl->symbol->pointerExternal = externalDecl;
17304 if(propWatch->deleteWatch)
17306 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17308 ListAdd(args, CopyExpression(object));
17309 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17310 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17311 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17315 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17316 struct Identifier * propID;
17318 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17320 char propName[1024];
17321 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17325 char getName[1024], setName[1024];
17326 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17328 DeclareProperty(prop, setName, getName);
17329 strcpy(propName, "__ecereProp_");
17330 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17331 strcat(propName, "_");
17332 FullClassNameCat(propName, prop->name, 0x1);
17333 ListAdd(args, CopyExpression(object));
17334 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17335 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17336 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17337 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17340 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17345 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid watched object\n", (((void *)0))));
17347 curExternal = external;
17348 curContext = context;
17350 FreeExpression(watcher);
17352 FreeExpression(object);
17353 FreeList(watches, FreePropertyWatch);
17356 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a _class\n", (((void *)0))));
17360 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17362 ProcessStatement(propWatch->compound);
17369 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17370 struct Expression * object = stmt->_watch.object;
17371 struct __ecereNameSpace__ecere__com__Class * _class;
17374 ProcessExpressionType(object);
17377 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17380 struct Identifier * propID;
17383 stmt->expressions = MkList();
17384 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17386 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17393 for(propID = (*watches).first; propID; propID = propID->next)
17395 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17399 CreateFireWatcher(prop, object, stmt);
17402 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17407 struct __ecereNameSpace__ecere__com__Property * prop;
17408 struct __ecereNameSpace__ecere__com__Class * base;
17410 for(base = _class; base; base = base->base)
17412 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17414 if(prop->isProperty && prop->isWatchable)
17416 CreateFireWatcher(prop, object, stmt);
17422 FreeExpression(object);
17423 FreeList(watches, FreeIdentifier);
17426 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17432 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17433 struct Expression * object = stmt->_watch.object;
17434 struct Expression * watcher = stmt->_watch.watcher;
17435 struct __ecereNameSpace__ecere__com__Class * _class;
17438 ProcessExpressionType(object);
17440 ProcessExpressionType(watcher);
17443 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17444 if(watcher || thisClass)
17448 struct Identifier * propID;
17451 stmt->expressions = MkList();
17454 struct __ecereNameSpace__ecere__sys__OldList * args;
17457 ListAdd(args, CopyExpression(object));
17458 ListAdd(args, MkExpConstant("0"));
17459 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17460 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17464 for(propID = (*watches).first; propID; propID = propID->next)
17466 char propName[1024];
17467 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17471 char getName[1024], setName[1024];
17472 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17474 DeclareProperty(prop, setName, getName);
17475 strcpy(propName, "__ecereProp_");
17476 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17477 strcat(propName, "_");
17478 FullClassNameCat(propName, prop->name, 0x1);
17479 MangleClassName(propName);
17480 ListAdd(args, CopyExpression(object));
17481 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17482 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17483 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17486 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17490 FreeExpression(object);
17492 FreeExpression(watcher);
17493 FreeList(watches, FreeIdentifier);
17496 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "Invalid object specified and not inside a class\n", (((void *)0))));
17499 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString("ec", "No observer specified and not inside a class\n", (((void *)0))));
17506 extern struct Expression * QBrackets(struct Expression * exp);
17508 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17510 extern struct Declarator * QMkPtrDecl(char * id);
17512 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17514 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17516 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17518 static void ProcessFunction(struct FunctionDefinition * function)
17520 struct Identifier * id = GetDeclId(function->declarator);
17521 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17522 struct Type * type = symbol ? symbol->type : (((void *)0));
17523 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17524 struct Context * oldTopContext = topContext;
17526 yylloc = function->loc;
17527 if(type && type->thisClass)
17529 struct Symbol * classSym = type->thisClass;
17530 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17531 char className[1024];
17532 char structName[1024];
17533 struct Declarator * funcDecl;
17534 struct Symbol * thisSymbol;
17535 unsigned int typedObject = 0x0;
17537 if(_class && !_class->base)
17539 _class = currentClass;
17540 if(_class && !_class->symbol)
17541 _class->symbol = FindClass(_class->fullName);
17542 classSym = _class ? _class->symbol : (((void *)0));
17545 thisClass = _class;
17546 if(inCompiler && _class)
17548 if(type->kind == 11)
17550 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17552 struct Type * param = symbol->type->params.first;
17554 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17557 if(type->classObjectType != 1)
17559 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17560 symbol->type->staticMethod = 0x1;
17561 symbol->type->thisClass = (((void *)0));
17562 symbol->type->extraParam = 0x0;
17565 strcpy(className, "__ecereClass_");
17566 FullClassNameCat(className, _class->fullName, 0x1);
17567 MangleClassName(className);
17568 structName[0] = (char)0;
17569 FullClassNameCat(structName, _class->fullName, 0x0);
17570 funcDecl = GetFuncDecl(function->declarator);
17573 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17575 struct TypeName * param = (*funcDecl->function.parameters).first;
17577 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17580 FreeTypeName(param);
17583 if(!function->propertyNoThis)
17585 struct TypeName * thisParam;
17587 if(type->classObjectType != 1)
17589 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17590 if(!funcDecl->function.parameters)
17591 funcDecl->function.parameters = MkList();
17592 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17596 if(type->classObjectType != 1)
17598 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17599 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17601 thisParam = __extension__ ({
17602 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17604 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17606 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17610 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17612 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17614 funcDecl = GetFuncDecl(initDecl->declarator);
17617 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17619 struct TypeName * param = (*funcDecl->function.parameters).first;
17621 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17623 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17624 FreeTypeName(param);
17627 if(type->classObjectType != 1)
17629 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17631 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17633 if(!funcDecl->function.parameters)
17634 funcDecl->function.parameters = MkList();
17635 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17643 if(type->classObjectType != 1)
17645 thisSymbol = __extension__ ({
17646 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17648 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17650 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17651 if(typedObject && thisSymbol->type)
17653 thisSymbol->type->classObjectType = 2;
17654 thisSymbol->type->byReference = type->byReference;
17655 thisSymbol->type->typedByReference = type->byReference;
17659 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17661 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17664 struct __ecereNameSpace__ecere__com__Class * base;
17666 for(base = _class; base && base->type != 1000; base = base->next)
17668 for(member = base->membersAndProperties.first; member; member = member->next)
17669 if(!member->isProperty)
17675 for(member = _class->membersAndProperties.first; member; member = member->next)
17676 if(!member->isProperty)
17680 char pointerName[1024];
17681 struct Declaration * decl;
17682 struct Initializer * initializer;
17683 struct Expression * exp, * bytePtr;
17685 strcpy(pointerName, "__ecerePointer_");
17686 FullClassNameCat(pointerName, _class->fullName, 0x0);
17688 char className[1024];
17690 strcpy(className, "__ecereClass_");
17691 FullClassNameCat(className, classSym->string, 0x1);
17692 MangleClassName(className);
17693 DeclareClass(classSym, className);
17695 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17700 sprintf(string, "%d", _class->offset);
17701 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17705 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17707 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17708 exp->expType = __extension__ ({
17709 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17711 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17712 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17714 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17715 }), __ecereInstance2;
17719 yylloc = function->body->loc;
17720 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17722 struct Context * prevContext = curContext;
17724 curContext = function->body->compound.context;
17725 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17726 curContext = prevContext;
17728 decl->symbol = (((void *)0));
17729 if(!function->body->compound.declarations)
17730 function->body->compound.declarations = MkList();
17731 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17737 thisClass = (((void *)0));
17740 FreeSpecifier(id->_class);
17741 id->_class = (((void *)0));
17742 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17744 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17746 id = GetDeclId(initDecl->declarator);
17747 FreeSpecifier(id->_class);
17748 id->_class = (((void *)0));
17752 topContext = function->body->compound.context;
17754 struct FunctionDefinition * oldFunction = curFunction;
17756 curFunction = function;
17758 ProcessStatement(function->body);
17759 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17761 struct Statement * prevCompound = curCompound;
17762 struct Context * prevContext = curContext;
17763 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17765 if(!function->body->compound.statements)
17766 function->body->compound.statements = MkList();
17767 ListAdd(function->body->compound.statements, fireWatchers);
17768 curCompound = function->body;
17769 curContext = function->body->compound.context;
17770 ProcessStatement(fireWatchers);
17771 curContext = prevContext;
17772 curCompound = prevCompound;
17774 curFunction = oldFunction;
17776 if(function->declarator)
17778 ProcessDeclarator(function->declarator);
17780 topContext = oldTopContext;
17781 thisClass = oldThisClass;
17784 extern void FreeSymbol(struct Symbol * symbol);
17786 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17788 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17790 struct ClassDef * def;
17791 struct External * external = curExternal;
17792 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17794 for(def = definitions->first; def; def = def->next)
17798 if(def->function->declarator)
17799 curExternal = def->function->declarator->symbol->pointerExternal;
17801 curExternal = external;
17802 ProcessFunction((struct FunctionDefinition *)def->function);
17804 else if(def->type == 2)
17806 if(def->decl->type == 2)
17808 thisClass = regClass;
17809 ProcessInstantiationType(def->decl->inst);
17810 thisClass = (((void *)0));
17814 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17817 thisClass = regClass;
17818 ProcessDeclaration(def->decl);
17819 thisClass = backThisClass;
17822 else if(def->type == 1 && def->defProperties)
17824 struct MemberInit * defProperty;
17825 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);
17827 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17828 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17830 thisClass = regClass;
17831 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17832 thisClass = (((void *)0));
17834 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17835 FreeSymbol(thisSymbol);
17837 else if(def->type == 3 && def->propertyDef)
17839 struct PropertyDef * prop = def->propertyDef;
17841 thisClass = regClass;
17846 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17848 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17850 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17851 ProcessStatement(prop->setStmt);
17857 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17859 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17861 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17862 ProcessStatement(prop->getStmt);
17864 if(prop->issetStmt)
17868 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17870 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17872 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17873 ProcessStatement(prop->issetStmt);
17875 thisClass = (((void *)0));
17877 else if(def->type == 4 && def->propertyWatch)
17879 struct PropertyWatch * propertyWatch = def->propertyWatch;
17881 thisClass = regClass;
17882 if(propertyWatch->compound)
17884 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);
17886 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17887 curExternal = (((void *)0));
17888 ProcessStatement(propertyWatch->compound);
17890 thisClass = (((void *)0));
17895 void DeclareFunctionUtil(char * s)
17897 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17904 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17905 strcpy(name, "__ecereFunction_");
17906 FullClassNameCat(name, s, 0x0);
17907 DeclareFunction(function, name);
17911 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17913 void ComputeDataTypes()
17915 struct External * external;
17916 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17917 struct External * after = (((void *)0));
17919 currentClass = (((void *)0));
17920 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17921 for(external = (*ast).first; external; external = external->next)
17923 if(external->type == 1)
17925 struct Declaration * decl = external->declaration;
17929 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17933 struct InitDeclarator * initDecl = (*decls).first;
17937 struct Declarator * declarator = initDecl->declarator;
17939 if(declarator && declarator->type == 1)
17941 struct Identifier * id = declarator->identifier;
17943 if(id && id->string)
17945 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17947 external->symbol->id = -1001, external->symbol->idCode = -1001;
17957 temp->symbol = __extension__ ({
17958 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17960 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17962 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
17963 curExternal = temp;
17964 DeclareFunctionUtil("eSystem_New");
17965 DeclareFunctionUtil("eSystem_New0");
17966 DeclareFunctionUtil("eSystem_Renew");
17967 DeclareFunctionUtil("eSystem_Renew0");
17968 DeclareFunctionUtil("eClass_GetProperty");
17969 DeclareStruct("ecere::com::Class", 0x0);
17970 DeclareStruct("ecere::com::Instance", 0x0);
17971 DeclareStruct("ecere::com::Property", 0x0);
17972 DeclareStruct("ecere::com::DataMember", 0x0);
17973 DeclareStruct("ecere::com::Method", 0x0);
17974 DeclareStruct("ecere::com::SerialBuffer", 0x0);
17975 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
17976 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
17977 for(external = (*ast).first; external; external = external->next)
17979 afterExternal = curExternal = external;
17980 if(external->type == 0)
17982 currentClass = external->function->_class;
17983 ProcessFunction(external->function);
17985 else if(external->type == 1)
17987 currentClass = (((void *)0));
17988 ProcessDeclaration(external->declaration);
17990 else if(external->type == 2)
17992 struct ClassDefinition * _class = external->_class;
17994 currentClass = external->symbol->registered;
17995 if(_class->definitions)
17997 ProcessClass(_class->definitions, _class->symbol);
18001 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18002 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18005 else if(external->type == 4)
18007 thisNameSpace = external->id->string;
18010 currentClass = (((void *)0));
18011 thisNameSpace = (((void *)0));
18012 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18013 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18016 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);
18018 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);
18020 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
18022 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
18024 struct __ecereNameSpace__ecere__com__Class * class;
18026 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
18027 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
18028 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
18029 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
18030 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
18031 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
18032 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
18033 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
18034 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
18035 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
18036 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
18037 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
18038 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
18039 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
18040 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
18041 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
18042 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
18043 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
18044 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
18045 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
18046 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
18047 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
18048 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
18049 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
18050 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
18051 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
18052 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
18053 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
18054 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
18055 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
18056 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
18057 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
18058 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
18059 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
18060 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
18061 __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);
18062 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
18063 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
18064 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
18065 __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);
18066 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
18067 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
18068 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
18069 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
18070 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
18071 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
18072 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
18073 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
18074 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
18075 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
18076 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
18077 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
18078 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
18079 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
18080 __ecereClass_Conversion = class;
18081 __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);
18082 __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);
18083 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
18084 __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);
18085 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
18086 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
18087 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
18088 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
18089 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
18090 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
18091 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
18092 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
18093 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
18094 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
18095 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
18096 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
18097 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
18098 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
18099 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
18100 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
18101 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
18102 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
18105 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)