1 /* Code generated from eC source file: pass15.ec */
3 typedef long long int64;
4 typedef unsigned long long uint64;
8 #elif defined(__TINYC__)
10 #define __builtin_va_list va_list
11 #define __builtin_va_start va_start
12 #define __builtin_va_end va_end
14 #define strcasecmp stricmp
15 #define strncasecmp strnicmp
16 #define __declspec(x) __attribute__((x))
20 typedef long long int64;
21 typedef unsigned long long uint64;
23 typedef __int64 int64;
24 typedef unsigned __int64 uint64;
27 #define __ENDIAN_PAD(x) (8 - (x))
29 #define __ENDIAN_PAD(x) 0
32 #include <sys/types.h>
34 #if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
40 #define arch_PointerSize sizeof(void *)
41 #define structSize_Instance (_64BIT ? 24 : 12)
42 #define structSize_Module (_64BIT ? 560 : 300)
43 #define structSize_NamedLink (_64BIT ? 32 : 16)
45 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
47 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
49 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
51 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
53 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
55 struct __ecereNameSpace__ecere__sys__BTNode;
57 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
59 struct __ecereNameSpace__ecere__sys__BinaryTree
61 struct __ecereNameSpace__ecere__sys__BTNode * root;
63 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
64 void (* FreeKey)(void * key);
65 } __attribute__ ((gcc_struct));
67 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
69 struct __ecereNameSpace__ecere__sys__OldList
76 } __attribute__ ((gcc_struct));
78 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
80 struct __ecereNameSpace__ecere__com__Method
83 struct __ecereNameSpace__ecere__com__Method * parent;
84 struct __ecereNameSpace__ecere__com__Method * left;
85 struct __ecereNameSpace__ecere__com__Method * right;
90 struct __ecereNameSpace__ecere__com__Class * _class;
92 char * dataTypeString;
93 struct Type * dataType;
95 } __attribute__ ((gcc_struct));
97 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
99 struct __ecereNameSpace__ecere__com__Property
101 struct __ecereNameSpace__ecere__com__Property * prev;
102 struct __ecereNameSpace__ecere__com__Property * next;
104 unsigned int isProperty;
107 struct __ecereNameSpace__ecere__com__Class * _class;
108 char * dataTypeString;
109 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
110 struct Type * dataType;
111 void (* Set)(void * , int);
112 int (* Get)(void * );
113 unsigned int (* IsSet)(void * );
117 unsigned int conversion;
118 unsigned int watcherOffset;
120 unsigned int compiled;
121 unsigned int selfWatchable;
122 unsigned int isWatchable;
123 } __attribute__ ((gcc_struct));
125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
133 } __attribute__ ((gcc_struct));
135 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
139 struct CodePosition start;
140 struct CodePosition end;
141 } __attribute__ ((gcc_struct));
143 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
147 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
156 struct Attrib * attr;
157 } __attribute__ ((gcc_struct));
158 } __attribute__ ((gcc_struct));
160 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
162 struct ClassDefinition
164 struct ClassDefinition * prev;
165 struct ClassDefinition * next;
167 struct Specifier * _class;
168 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
169 struct __ecereNameSpace__ecere__sys__OldList * definitions;
170 struct Symbol * symbol;
171 struct Location blockStart;
172 struct Location nameLoc;
175 unsigned int deleteWatchable;
176 } __attribute__ ((gcc_struct));
178 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
182 struct Context * parent;
183 struct __ecereNameSpace__ecere__sys__BinaryTree types;
184 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
185 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
186 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
189 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
190 struct ClassDefinition * classDef;
191 unsigned int templateTypesOnly;
192 unsigned int hasNameSpace;
193 } __attribute__ ((gcc_struct));
195 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
199 struct Instantiation * prev;
200 struct Instantiation * next;
202 struct Specifier * _class;
203 struct Expression * exp;
204 struct __ecereNameSpace__ecere__sys__OldList * members;
205 struct Symbol * symbol;
206 unsigned int fullSet;
207 unsigned int isConstant;
208 unsigned char * data;
209 struct Location nameLoc;
210 struct Location insideLoc;
212 } __attribute__ ((gcc_struct));
214 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
218 struct Declaration * prev;
219 struct Declaration * next;
226 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
227 struct __ecereNameSpace__ecere__sys__OldList * declarators;
228 } __attribute__ ((gcc_struct));
229 struct Instantiation * inst;
232 struct Identifier * id;
233 struct Expression * exp;
234 } __attribute__ ((gcc_struct));
235 } __attribute__ ((gcc_struct));
236 struct Specifier * extStorage;
237 struct Symbol * symbol;
239 } __attribute__ ((gcc_struct));
241 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
245 struct Statement * prev;
246 struct Statement * next;
251 struct __ecereNameSpace__ecere__sys__OldList * expressions;
254 struct Identifier * id;
255 struct Statement * stmt;
256 } __attribute__ ((gcc_struct)) labeled;
259 struct Expression * exp;
260 struct Statement * stmt;
261 } __attribute__ ((gcc_struct)) caseStmt;
264 struct __ecereNameSpace__ecere__sys__OldList * declarations;
265 struct __ecereNameSpace__ecere__sys__OldList * statements;
266 struct Context * context;
267 unsigned int isSwitch;
268 } __attribute__ ((gcc_struct)) compound;
271 struct __ecereNameSpace__ecere__sys__OldList * exp;
272 struct Statement * stmt;
273 struct Statement * elseStmt;
274 } __attribute__ ((gcc_struct)) ifStmt;
277 struct __ecereNameSpace__ecere__sys__OldList * exp;
278 struct Statement * stmt;
279 } __attribute__ ((gcc_struct)) switchStmt;
282 struct __ecereNameSpace__ecere__sys__OldList * exp;
283 struct Statement * stmt;
284 } __attribute__ ((gcc_struct)) whileStmt;
287 struct __ecereNameSpace__ecere__sys__OldList * exp;
288 struct Statement * stmt;
289 } __attribute__ ((gcc_struct)) doWhile;
292 struct Statement * init;
293 struct Statement * check;
294 struct __ecereNameSpace__ecere__sys__OldList * increment;
295 struct Statement * stmt;
296 } __attribute__ ((gcc_struct)) forStmt;
299 struct Identifier * id;
300 } __attribute__ ((gcc_struct)) gotoStmt;
303 struct Specifier * spec;
305 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
307 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
308 } __attribute__ ((gcc_struct)) asmStmt;
311 struct Expression * watcher;
312 struct Expression * object;
313 struct __ecereNameSpace__ecere__sys__OldList * watches;
314 } __attribute__ ((gcc_struct)) _watch;
317 struct Identifier * id;
318 struct __ecereNameSpace__ecere__sys__OldList * exp;
319 struct __ecereNameSpace__ecere__sys__OldList * filter;
320 struct Statement * stmt;
321 } __attribute__ ((gcc_struct)) forEachStmt;
322 struct Declaration * decl;
323 } __attribute__ ((gcc_struct));
324 } __attribute__ ((gcc_struct));
326 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
330 struct TypeName * prev;
331 struct TypeName * next;
333 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
334 struct Declarator * declarator;
336 struct Expression * bitCount;
337 } __attribute__ ((gcc_struct));
339 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
343 struct Initializer * prev;
344 struct Initializer * next;
349 struct Expression * exp;
350 struct __ecereNameSpace__ecere__sys__OldList * list;
351 } __attribute__ ((gcc_struct));
352 unsigned int isConstant;
353 } __attribute__ ((gcc_struct));
355 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
357 struct __ecereNameSpace__ecere__com__DataValue
372 } __attribute__ ((gcc_struct));
373 } __attribute__ ((gcc_struct));
375 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
379 struct Expression * prev;
380 struct Expression * next;
388 struct Identifier * identifier;
389 } __attribute__ ((gcc_struct));
390 struct Statement * compound;
391 struct Instantiation * instance;
393 struct __ecereNameSpace__ecere__sys__OldList * list;
396 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
397 struct Declarator * decl;
398 } __attribute__ ((gcc_struct)) _classExp;
401 struct Identifier * id;
402 } __attribute__ ((gcc_struct)) classData;
405 struct Expression * exp;
406 struct __ecereNameSpace__ecere__sys__OldList * arguments;
407 struct Location argLoc;
408 } __attribute__ ((gcc_struct)) call;
411 struct Expression * exp;
412 struct __ecereNameSpace__ecere__sys__OldList * index;
413 } __attribute__ ((gcc_struct)) index;
416 struct Expression * exp;
417 struct Identifier * member;
419 unsigned int thisPtr;
420 } __attribute__ ((gcc_struct)) member;
424 struct Expression * exp1;
425 struct Expression * exp2;
426 } __attribute__ ((gcc_struct)) op;
427 struct TypeName * typeName;
428 struct Specifier * _class;
431 struct TypeName * typeName;
432 struct Expression * exp;
433 } __attribute__ ((gcc_struct)) cast;
436 struct Expression * cond;
437 struct __ecereNameSpace__ecere__sys__OldList * exp;
438 struct Expression * elseExp;
439 } __attribute__ ((gcc_struct)) cond;
442 struct TypeName * typeName;
443 struct Expression * size;
444 } __attribute__ ((gcc_struct)) _new;
447 struct TypeName * typeName;
448 struct Expression * size;
449 struct Expression * exp;
450 } __attribute__ ((gcc_struct)) _renew;
454 struct Identifier * id;
455 } __attribute__ ((gcc_struct)) db;
458 struct Expression * ds;
459 struct Expression * name;
460 } __attribute__ ((gcc_struct)) dbopen;
463 struct TypeName * typeName;
464 struct Initializer * initializer;
465 } __attribute__ ((gcc_struct)) initializer;
468 struct Expression * exp;
469 struct TypeName * typeName;
470 } __attribute__ ((gcc_struct)) vaArg;
471 } __attribute__ ((gcc_struct));
472 unsigned int debugValue;
473 struct __ecereNameSpace__ecere__com__DataValue val;
475 unsigned int hasAddress;
476 struct Type * expType;
477 struct Type * destType;
480 unsigned int byReference;
481 unsigned int isConstant;
482 unsigned int addedThis;
483 unsigned int needCast;
484 unsigned int thisPtr;
485 } __attribute__ ((gcc_struct));
487 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
489 struct TemplateDatatype
491 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
492 struct Declarator * decl;
493 } __attribute__ ((gcc_struct));
495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
497 struct TemplateArgument;
499 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
501 struct TemplateParameter
503 struct TemplateParameter * prev;
504 struct TemplateParameter * next;
507 struct Identifier * identifier;
510 struct TemplateDatatype * dataType;
512 } __attribute__ ((gcc_struct));
513 struct TemplateArgument * defaultArgument;
514 char * dataTypeString;
515 struct Type * baseType;
516 } __attribute__ ((gcc_struct));
518 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
522 struct Specifier * prev;
523 struct Specifier * next;
531 struct ExtDecl * extDecl;
533 struct Symbol * symbol;
534 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
535 } __attribute__ ((gcc_struct));
538 struct Identifier * id;
539 struct __ecereNameSpace__ecere__sys__OldList * list;
540 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
541 struct __ecereNameSpace__ecere__sys__OldList * definitions;
542 unsigned int addNameSpace;
543 struct Context * ctx;
544 struct ExtDecl * extDeclStruct;
545 } __attribute__ ((gcc_struct));
546 struct Expression * expression;
547 struct Specifier * _class;
548 struct TemplateParameter * templateParameter;
549 } __attribute__ ((gcc_struct));
550 } __attribute__ ((gcc_struct));
552 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
556 struct Identifier * prev;
557 struct Identifier * next;
559 struct Symbol * classSym;
560 struct Specifier * _class;
562 struct Identifier * badID;
563 } __attribute__ ((gcc_struct));
565 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
569 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
573 struct Declarator * prev;
574 struct Declarator * next;
577 struct Symbol * symbol;
578 struct Declarator * declarator;
581 struct Identifier * identifier;
584 struct Expression * exp;
585 struct Expression * posExp;
586 struct Attrib * attrib;
587 } __attribute__ ((gcc_struct)) structDecl;
590 struct Expression * exp;
591 struct Specifier * enumClass;
592 } __attribute__ ((gcc_struct)) array;
595 struct __ecereNameSpace__ecere__sys__OldList * parameters;
596 } __attribute__ ((gcc_struct)) function;
599 struct Pointer * pointer;
600 } __attribute__ ((gcc_struct)) pointer;
603 struct ExtDecl * extended;
604 } __attribute__ ((gcc_struct)) extended;
605 } __attribute__ ((gcc_struct));
606 } __attribute__ ((gcc_struct));
608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
610 struct FunctionDefinition
612 struct FunctionDefinition * prev;
613 struct FunctionDefinition * next;
615 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
616 struct Declarator * declarator;
617 struct __ecereNameSpace__ecere__sys__OldList * declarations;
618 struct Statement * body;
619 struct __ecereNameSpace__ecere__com__Class * _class;
620 struct __ecereNameSpace__ecere__sys__OldList attached;
623 struct Symbol * propSet;
625 unsigned int propertyNoThis;
626 } __attribute__ ((gcc_struct));
628 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
632 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
636 struct External * prev;
637 struct External * next;
640 struct Symbol * symbol;
643 struct FunctionDefinition * function;
644 struct ClassDefinition * _class;
645 struct Declaration * declaration;
647 struct Identifier * id;
648 struct DBTableDef * table;
649 } __attribute__ ((gcc_struct));
651 } __attribute__ ((gcc_struct));
653 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
657 struct ModuleImport * prev;
658 struct ModuleImport * next;
660 struct __ecereNameSpace__ecere__sys__OldList classes;
661 struct __ecereNameSpace__ecere__sys__OldList functions;
664 } __attribute__ ((gcc_struct));
666 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
670 struct ClassImport * prev;
671 struct ClassImport * next;
673 struct __ecereNameSpace__ecere__sys__OldList methods;
674 struct __ecereNameSpace__ecere__sys__OldList properties;
676 unsigned int isRemote;
677 } __attribute__ ((gcc_struct));
679 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
684 struct Symbol * parent;
685 struct Symbol * left;
686 struct Symbol * right;
691 struct __ecereNameSpace__ecere__com__Method * method;
692 struct __ecereNameSpace__ecere__com__Property * _property;
693 struct __ecereNameSpace__ecere__com__Class * registered;
694 } __attribute__ ((gcc_struct));
701 struct External * pointerExternal;
702 struct External * structExternal;
703 } __attribute__ ((gcc_struct));
706 struct External * externalGet;
707 struct External * externalSet;
708 struct External * externalPtr;
709 struct External * externalIsSet;
710 } __attribute__ ((gcc_struct));
713 struct External * methodExternal;
714 struct External * methodCodeExternal;
715 } __attribute__ ((gcc_struct));
716 } __attribute__ ((gcc_struct));
717 unsigned int imported;
718 unsigned int declaredStructSym;
719 struct __ecereNameSpace__ecere__com__Class * _class;
720 unsigned int declaredStruct;
721 unsigned int needConstructor;
722 unsigned int needDestructor;
723 char * constructorName;
726 char * destructorName;
727 struct ModuleImport * module;
728 struct ClassImport * _import;
729 struct Location nameLoc;
730 unsigned int isParam;
731 unsigned int isRemote;
732 unsigned int isStruct;
733 unsigned int fireWatchersDone;
735 unsigned int classData;
736 unsigned int isStatic;
738 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
739 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
740 struct Context * ctx;
742 struct Expression * propCategory;
743 } __attribute__ ((gcc_struct));
745 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
754 struct Symbol * _class;
757 struct __ecereNameSpace__ecere__sys__OldList members;
759 } __attribute__ ((gcc_struct));
762 struct Type * returnType;
763 struct __ecereNameSpace__ecere__sys__OldList params;
764 struct Symbol * thisClass;
765 unsigned int staticMethod;
766 struct TemplateParameter * thisClassTemplate;
767 } __attribute__ ((gcc_struct));
770 struct __ecereNameSpace__ecere__com__Method * method;
771 struct __ecereNameSpace__ecere__com__Class * methodClass;
772 struct __ecereNameSpace__ecere__com__Class * usedClass;
773 } __attribute__ ((gcc_struct));
776 struct Type * arrayType;
778 struct Expression * arraySizeExp;
779 unsigned int freeExp;
780 struct Symbol * enumClass;
781 } __attribute__ ((gcc_struct));
783 struct TemplateParameter * templateParameter;
784 } __attribute__ ((gcc_struct));
794 unsigned int isSigned : 1;
795 unsigned int constant : 1;
796 unsigned int truth : 1;
797 unsigned int byReference : 1;
798 unsigned int extraParam : 1;
799 unsigned int directClassAccess : 1;
800 unsigned int computing : 1;
801 unsigned int keepCast : 1;
802 unsigned int passAsTemplate : 1;
803 unsigned int dllExport : 1;
804 unsigned int attrStdcall : 1;
805 unsigned int declaredWithStruct : 1;
806 unsigned int typedByReference : 1;
807 } __attribute__ ((gcc_struct));
809 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
811 struct __ecereNameSpace__ecere__com__Class
813 struct __ecereNameSpace__ecere__com__Class * prev;
814 struct __ecereNameSpace__ecere__com__Class * next;
820 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
821 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
824 struct __ecereNameSpace__ecere__com__Class * base;
825 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
826 struct __ecereNameSpace__ecere__sys__BinaryTree members;
827 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
828 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
829 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
830 struct __ecereNameSpace__ecere__sys__OldList derivatives;
834 struct __ecereNameSpace__ecere__com__Instance * module;
835 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
836 char * dataTypeString;
837 struct Type * dataType;
839 int defaultAlignment;
840 void (* Initialize)();
842 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
843 char * designerClass;
844 unsigned int noExpansion;
845 char * defaultProperty;
846 unsigned int comRedefinition;
848 unsigned int isRemote;
849 unsigned int internalDecl;
851 unsigned int computeSize;
853 int destructionWatchOffset;
855 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
856 int inheritanceAccess;
859 struct __ecereNameSpace__ecere__sys__OldList conversions;
860 struct __ecereNameSpace__ecere__sys__OldList templateParams;
861 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
862 struct __ecereNameSpace__ecere__com__Class * templateClass;
863 struct __ecereNameSpace__ecere__sys__OldList templatized;
865 unsigned int isInstanceClass;
866 unsigned int byValueSystemClass;
867 } __attribute__ ((gcc_struct));
869 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
871 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
873 struct __ecereNameSpace__ecere__com__Instance
876 struct __ecereNameSpace__ecere__com__Class * _class;
878 } __attribute__ ((gcc_struct));
880 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
882 struct __ecereNameSpace__ecere__com__DataMember
884 struct __ecereNameSpace__ecere__com__DataMember * prev;
885 struct __ecereNameSpace__ecere__com__DataMember * next;
887 unsigned int isProperty;
890 struct __ecereNameSpace__ecere__com__Class * _class;
891 char * dataTypeString;
892 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
893 struct Type * dataType;
897 struct __ecereNameSpace__ecere__sys__OldList members;
898 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
901 } __attribute__ ((gcc_struct));
903 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
905 struct __ecereNameSpace__ecere__com__SerialBuffer
907 unsigned char * _buffer;
911 } __attribute__ ((gcc_struct));
913 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
915 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
921 char * dataTypeString;
922 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
923 } __attribute__ ((gcc_struct));
924 struct __ecereNameSpace__ecere__com__DataValue expression;
930 struct __ecereNameSpace__ecere__com__DataMember * member;
931 struct __ecereNameSpace__ecere__com__Property * prop;
932 struct __ecereNameSpace__ecere__com__Method * method;
933 } __attribute__ ((gcc_struct));
934 } __attribute__ ((gcc_struct));
935 } __attribute__ ((gcc_struct));
936 } __attribute__ ((gcc_struct));
938 void exit(int status);
940 void * calloc(size_t nmemb, size_t size);
942 void free(void * ptr);
944 void * malloc(size_t size);
946 void * realloc(void * ptr, size_t size);
948 long int strtol(const char * nptr, char ** endptr, int base);
950 long long int strtoll(const char * nptr, char ** endptr, int base);
952 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
956 IDENTIFIER = 258, CONSTANT = 259, STRING_LITERAL = 260, SIZEOF = 261, PTR_OP = 262, INC_OP = 263, DEC_OP = 264, LEFT_OP = 265, RIGHT_OP = 266, LE_OP = 267, GE_OP = 268, EQ_OP = 269, NE_OP = 270, AND_OP = 271, OR_OP = 272, MUL_ASSIGN = 273, DIV_ASSIGN = 274, MOD_ASSIGN = 275, ADD_ASSIGN = 276, SUB_ASSIGN = 277, LEFT_ASSIGN = 278, RIGHT_ASSIGN = 279, AND_ASSIGN = 280, XOR_ASSIGN = 281, OR_ASSIGN = 282, TYPE_NAME = 283, TYPEDEF = 284, EXTERN = 285, STATIC = 286, AUTO = 287, REGISTER = 288, CHAR = 289, SHORT = 290, INT = 291, UINT = 292, INT64 = 293, LONG = 294, SIGNED = 295, UNSIGNED = 296, FLOAT = 297, DOUBLE = 298, CONST = 299, VOLATILE = 300, VOID = 301, VALIST = 302, STRUCT = 303, UNION = 304, ENUM = 305, ELLIPSIS = 306, CASE = 307, DEFAULT = 308, IF = 309, SWITCH = 310, WHILE = 311, DO = 312, FOR = 313, GOTO = 314, CONTINUE = 315, BREAK = 316, RETURN = 317, IFX = 318, ELSE = 319, CLASS = 320, THISCLASS = 321, CLASS_NAME = 322, PROPERTY = 323, SETPROP = 324, GETPROP = 325, NEWOP = 326, RENEW = 327, DELETE = 328, EXT_DECL = 329, EXT_STORAGE = 330, IMPORT = 331, DEFINE = 332, VIRTUAL = 333, ATTRIB = 334, PUBLIC = 335, PRIVATE = 336, TYPED_OBJECT = 337, ANY_OBJECT = 338, _INCREF = 339, EXTENSION = 340, ASM = 341, TYPEOF = 342, WATCH = 343, STOPWATCHING = 344, FIREWATCHERS = 345, WATCHABLE = 346, CLASS_DESIGNER = 347, CLASS_NO_EXPANSION = 348, CLASS_FIXED = 349, ISPROPSET = 350, CLASS_DEFAULT_PROPERTY = 351, PROPERTY_CATEGORY = 352, CLASS_DATA = 353, CLASS_PROPERTY = 354, SUBCLASS = 355, NAMESPACE = 356, NEW0OP = 357, RENEW0 = 358, VAARG = 359, DBTABLE = 360, DBFIELD = 361, DBINDEX = 362, DATABASE_OPEN = 363, ALIGNOF = 364, ATTRIB_DEP = 365, __ATTRIB = 366, BOOL = 367, _BOOL = 368, _COMPLEX = 369, _IMAGINARY = 370, RESTRICT = 371
959 typedef union YYSTYPE
964 struct Identifier * id;
965 struct Expression * exp;
966 struct Specifier * specifier;
967 struct __ecereNameSpace__ecere__sys__OldList * list;
968 struct Enumerator * enumerator;
969 struct Declarator * declarator;
970 struct Pointer * pointer;
971 struct Initializer * initializer;
972 struct InitDeclarator * initDeclarator;
973 struct TypeName * typeName;
974 struct Declaration * declaration;
975 struct Statement * stmt;
976 struct FunctionDefinition * function;
977 struct External * external;
978 struct Context * context;
979 struct AsmField * asmField;
980 struct Attrib * attrib;
981 struct ExtDecl * extDecl;
982 struct Attribute * attribute;
983 struct Instantiation * instance;
984 struct MembersInit * membersInit;
985 struct MemberInit * memberInit;
986 struct ClassFunction * classFunction;
987 struct ClassDefinition * _class;
988 struct ClassDef * classDef;
989 struct PropertyDef * prop;
991 struct Symbol * symbol;
992 struct PropertyWatch * propertyWatch;
993 struct TemplateParameter * templateParameter;
994 struct TemplateArgument * templateArgument;
995 struct TemplateDatatype * templateDatatype;
996 struct DBTableEntry * dbtableEntry;
997 struct DBIndexItem * dbindexItem;
998 struct DBTableDef * dbtableDef;
999 } __attribute__ ((gcc_struct)) YYSTYPE;
1001 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1005 struct Enumerator * prev;
1006 struct Enumerator * next;
1007 struct Location loc;
1008 struct Identifier * id;
1009 struct Expression * exp;
1010 } __attribute__ ((gcc_struct));
1012 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1014 struct InitDeclarator
1016 struct InitDeclarator * prev;
1017 struct InitDeclarator * next;
1018 struct Location loc;
1019 struct Declarator * declarator;
1020 struct Initializer * initializer;
1021 } __attribute__ ((gcc_struct));
1023 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1027 struct AsmField * prev;
1028 struct AsmField * next;
1029 struct Location loc;
1031 struct Expression * expression;
1032 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(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2577 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2579 int ComputeTypeSize(struct Type * type)
2581 unsigned int size = type ? type->size : 0;
2583 if(!size && type && !type->computing)
2585 type->computing = 0x1;
2589 type->alignment = size = sizeof(char);
2592 type->alignment = size = sizeof(char);
2595 type->alignment = size = sizeof(int);
2598 type->alignment = size = sizeof(long long);
2601 type->alignment = size = targetBits / 8;
2604 type->alignment = size = targetBits / 8;
2607 type->alignment = size = sizeof(long);
2610 type->alignment = size = sizeof(short);
2613 type->alignment = size = sizeof(float);
2616 type->alignment = size = sizeof(double);
2620 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2622 if(_class && _class->type == 1)
2624 ComputeClassMembers(_class, 0x0);
2625 type->alignment = _class->structAlignment;
2626 size = _class->structSize;
2627 if(type->alignment && size % type->alignment)
2628 size += type->alignment - (size % type->alignment);
2630 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2632 if(!_class->dataType)
2633 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2634 size = type->alignment = ComputeTypeSize(_class->dataType);
2637 size = type->alignment = targetBits / 8;
2642 size = type->alignment = targetBits / 8;
2645 if(type->arraySizeExp)
2647 ProcessExpressionType(type->arraySizeExp);
2648 ComputeExpression(type->arraySizeExp);
2649 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)))
2651 struct Location oldLoc = yylloc;
2652 char expression[10240];
2654 expression[0] = '\0';
2655 type->arraySizeExp->expType = (((void *)0));
2656 yylloc = type->arraySizeExp->loc;
2658 PrintExpression(type->arraySizeExp, expression);
2659 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2662 GetInt(type->arraySizeExp, &type->arraySize);
2664 else if(type->enumClass)
2666 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2668 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2671 type->arraySize = 0;
2675 type->arraySize = 0;
2677 size = ComputeTypeSize(type->type) * type->arraySize;
2679 type->alignment = type->type->alignment;
2683 struct Type * member;
2685 for(member = type->members.first; member; member = member->next)
2687 int __simpleStruct0, __simpleStruct1;
2688 unsigned int addSize = ComputeTypeSize(member);
2690 member->offset = size;
2691 if(member->alignment && size % member->alignment)
2692 member->offset += member->alignment - (size % member->alignment);
2693 size = member->offset;
2694 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2697 if(type->alignment && size % type->alignment)
2698 size += type->alignment - (size % type->alignment);
2703 struct Type * member;
2705 for(member = type->members.first; member; member = member->next)
2707 int __simpleStruct0, __simpleStruct1;
2708 unsigned int addSize = ComputeTypeSize(member);
2710 member->offset = size;
2711 if(member->alignment && size % member->alignment)
2712 member->offset += member->alignment - (size % member->alignment);
2713 size = member->offset;
2714 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2715 size = ((size > addSize) ? size : addSize);
2717 if(type->alignment && size % type->alignment)
2718 size += type->alignment - (size % type->alignment);
2723 struct TemplateParameter * param = type->templateParameter;
2724 struct Type * baseType = ProcessTemplateParameterType(param);
2728 size = ComputeTypeSize(baseType);
2729 type->alignment = baseType->alignment;
2732 type->alignment = size = sizeof(uint64);
2737 type->alignment = size = sizeof(enum
2745 type->alignment = size = targetBits / 8;
2750 type->computing = 0x0;
2755 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2757 extern struct Identifier * MkIdentifier(char * string);
2759 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2761 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2763 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2765 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2767 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2769 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2771 extern void FreeType(struct Type * type);
2773 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2775 extern struct Specifier * MkSpecifier(int specifier);
2777 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2779 extern struct Expression * MkExpConstant(char * string);
2781 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)
2783 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2784 unsigned int totalSize = 0;
2785 unsigned int maxSize = 0;
2786 int alignment, size;
2787 struct __ecereNameSpace__ecere__com__DataMember * member;
2788 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2791 *addedPadding = 0x0;
2792 if(!isMember && _class->base)
2794 maxSize = _class->structSize;
2796 if(_class->type == 1 || _class->type == 5)
2797 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2800 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2802 if(maxSize > baseSize)
2803 maxSize -= baseSize;
2809 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2811 if(!member->isProperty)
2813 switch(member->type)
2817 if(member->dataTypeString)
2819 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2820 struct Declarator * decl;
2822 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2823 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2824 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2825 if(!member->dataType)
2826 member->dataType = ProcessType(specs, decl);
2827 ReplaceThisClassSpecifiers(specs, topClass);
2829 struct Type * type = ProcessType(specs, decl);
2831 DeclareType(member->dataType, 0x0, 0x0);
2834 ComputeTypeSize(member->dataType);
2835 size = member->dataType->size;
2836 alignment = member->dataType->alignment;
2839 if(totalSize % alignment)
2840 totalSize += alignment - (totalSize % alignment);
2849 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2852 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2853 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2854 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2855 alignment = member->structAlignment;
2858 if(totalSize % alignment)
2859 totalSize += alignment - (totalSize % alignment);
2869 unsigned int __simpleStruct0;
2871 if(topMember && topMember->type == 1)
2872 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2874 *retSize += totalSize;
2876 else if(totalSize < maxSize && _class->type != 1000)
2878 int autoPadding = 0;
2880 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2881 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2882 if(totalSize + autoPadding < maxSize)
2884 char sizeString[50];
2886 sprintf(sizeString, "%d", maxSize - totalSize);
2887 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2889 *addedPadding = 0x1;
2893 FinishTemplatesContext(context);
2894 return topMember ? topMember->memberID : _class->memberID;
2897 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2899 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2900 unsigned int totalSize = 0;
2901 struct __ecereNameSpace__ecere__com__DataMember * member;
2902 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2904 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2905 DeclareMembers(_class->base, 0x0);
2906 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2908 if(!member->isProperty)
2910 switch(member->type)
2914 if(!member->dataType && member->dataTypeString)
2915 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2916 if(member->dataType)
2917 DeclareType(member->dataType, 0x0, 0x0);
2923 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2930 FinishTemplatesContext(context);
2931 return topMember ? topMember->memberID : _class->memberID;
2934 extern struct Symbol * FindClass(char * name);
2936 extern char * strchr(const char * , int);
2938 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2940 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2942 extern void FreeClassDef(struct ClassDef * def);
2944 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2946 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2948 extern char * strcpy(char * , const char * );
2950 extern void MangleClassName(char * className);
2952 extern void DeclareClass(struct Symbol * classSym, char * className);
2954 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2956 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2958 void DeclareStruct(char * name, unsigned int skipNoHead)
2960 struct External * external = (((void *)0));
2961 struct Symbol * classSym = FindClass(name);
2963 if(!inCompiler || !classSym)
2965 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2967 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2969 struct Declaration * decl;
2970 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2971 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2972 char structName[1024];
2974 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2975 classSym->declaring++;
2976 if(strchr(classSym->string, '<'))
2978 if(classSym->registered->templateClass)
2980 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2981 classSym->declaring--;
2985 DeclareMembers(classSym->registered, 0x0);
2986 structName[0] = (char)0;
2987 FullClassNameCat(structName, name, 0x0);
2990 unsigned int addedPadding = 0x0;
2992 classSym->declaredStructSym = 0x1;
2993 declarations = MkList();
2994 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2995 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2997 FreeList(declarations, FreeClassDef);
2998 declarations = (((void *)0));
3001 if(skipNoHead || declarations)
3003 if(external && external->declaration)
3005 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
3006 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3008 if(classSym->structExternal)
3009 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3010 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3011 classSym->id = curExternal->symbol->idCode;
3012 classSym->idCode = curExternal->symbol->idCode;
3018 external = MkExternalDeclaration((((void *)0)));
3019 specifiers = MkList();
3020 declarators = MkList();
3021 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3022 external->declaration = decl = MkDeclaration(specifiers, declarators);
3023 if(decl->symbol && !decl->symbol->pointerExternal)
3024 decl->symbol->pointerExternal = external;
3025 if(classSym->registered && classSym->registered->type == 1)
3027 char className[1024];
3029 strcpy(className, "__ecereClass_");
3030 FullClassNameCat(className, classSym->string, 0x1);
3031 MangleClassName(className);
3032 DeclareClass(classSym, className);
3033 external->symbol = classSym;
3034 classSym->pointerExternal = external;
3035 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3036 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3040 char className[1024];
3042 strcpy(className, "__ecereClass_");
3043 FullClassNameCat(className, classSym->string, 0x1);
3044 MangleClassName(className);
3045 classSym->structExternal = external;
3046 DeclareClass(classSym, className);
3047 external->symbol = classSym;
3049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3052 classSym->declaring--;
3054 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3056 classSym->declaring++;
3058 if(classSym->registered)
3059 DeclareMembers(classSym->registered, 0x0);
3061 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3063 if(classSym->structExternal)
3064 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3065 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3066 classSym->id = curExternal->symbol->idCode;
3067 classSym->idCode = curExternal->symbol->idCode;
3069 classSym->declaring--;
3073 extern char * strcat(char * , const char * );
3075 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3077 extern struct ModuleImport * mainModule;
3079 extern struct Specifier * MkSpecifierName(char * name);
3081 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3083 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3085 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3087 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3089 extern void FreeDeclarator(struct Declarator * decl);
3091 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3093 struct PropertyImport
3095 struct PropertyImport * prev;
3096 struct PropertyImport * next;
3098 unsigned int isVirtual;
3099 unsigned int hasSet;
3100 unsigned int hasGet;
3101 } __attribute__ ((gcc_struct));
3103 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3105 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3107 struct Symbol * symbol = prop->symbol;
3108 char propName[1024];
3110 strcpy(setName, "__ecereProp_");
3111 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3112 strcat(setName, "_Set_");
3113 FullClassNameCat(setName, prop->name, 0x1);
3114 strcpy(getName, "__ecereProp_");
3115 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3116 strcat(getName, "_Get_");
3117 FullClassNameCat(getName, prop->name, 0x1);
3118 strcpy(propName, "__ecereProp_");
3119 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3120 strcat(propName, "_");
3121 FullClassNameCat(propName, prop->name, 0x1);
3122 MangleClassName(getName);
3123 MangleClassName(setName);
3124 MangleClassName(propName);
3125 if(prop->_class->type == 1)
3126 DeclareStruct(prop->_class->fullName, 0x0);
3127 if(!symbol || curExternal->symbol->idCode < symbol->id)
3129 unsigned int imported = 0x0;
3130 unsigned int dllImport = 0x0;
3132 if(!symbol || symbol->_import)
3136 struct Symbol * classSym;
3138 if(!prop->_class->symbol)
3139 prop->_class->symbol = FindClass(prop->_class->fullName);
3140 classSym = prop->_class->symbol;
3141 if(classSym && !classSym->_import)
3143 struct ModuleImport * module;
3145 if(prop->_class->module)
3146 module = FindModule(prop->_class->module);
3148 module = mainModule;
3149 classSym->_import = __extension__ ({
3150 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3152 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3154 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3156 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3157 symbol->_import = (struct ClassImport *)__extension__ ({
3158 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3160 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3163 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3166 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3171 struct Context * context = SetupTemplatesContext(prop->_class);
3173 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3174 FinishTemplatesContext(context);
3178 if(!symbol->externalGet || symbol->externalGet->type == 0)
3180 struct Declaration * decl;
3181 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3182 struct Declarator * d;
3183 struct __ecereNameSpace__ecere__sys__OldList * params;
3184 struct Specifier * spec;
3185 struct External * external;
3186 struct Declarator * typeDecl;
3187 unsigned int simple = 0x0;
3189 specifiers = MkList();
3190 declarators = MkList();
3192 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3193 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3195 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3197 struct Context * context = SetupTemplatesContext(prop->_class);
3199 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3200 FinishTemplatesContext(context);
3202 for(spec = (*specifiers).first; spec; spec = spec->next)
3206 if((!typeDecl || typeDecl->type == 1))
3208 struct Symbol * classSym = spec->symbol;
3210 symbol->_class = classSym->registered;
3211 if(classSym->registered && classSym->registered->type == 1)
3213 DeclareStruct(spec->name, 0x0);
3220 d = PlugDeclarator(typeDecl, d);
3223 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3224 specifiers = MkList();
3226 d = MkDeclaratorFunction(d, params);
3228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3229 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3232 ListAdd(specifiers, MkSpecifier(VOID));
3233 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3234 decl = MkDeclaration(specifiers, declarators);
3235 external = MkExternalDeclaration(decl);
3236 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3237 external->symbol = symbol;
3238 symbol->externalGet = external;
3239 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3241 FreeDeclarator(typeDecl);
3245 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3250 if(!symbol->externalSet || symbol->externalSet->type == 0)
3252 struct Declaration * decl;
3253 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3254 struct Declarator * d;
3255 struct __ecereNameSpace__ecere__sys__OldList * params;
3256 struct Specifier * spec;
3257 struct External * external;
3258 struct Declarator * typeDecl;
3260 declarators = MkList();
3262 if(!prop->conversion || prop->_class->type == 1)
3264 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3266 specifiers = MkList();
3268 struct Context * context = SetupTemplatesContext(prop->_class);
3270 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3271 FinishTemplatesContext(context);
3273 ListAdd(params, MkTypeName(specifiers, d));
3274 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3276 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3277 d = MkDeclaratorFunction(d, params);
3278 for(spec = (*specifiers).first; spec; spec = spec->next)
3282 if((!typeDecl || typeDecl->type == 1))
3284 struct Symbol * classSym = spec->symbol;
3286 symbol->_class = classSym->registered;
3287 if(classSym->registered && classSym->registered->type == 1)
3288 DeclareStruct(spec->name, 0x0);
3292 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3293 specifiers = MkList();
3295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3296 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3297 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3298 if(!prop->conversion || prop->_class->type == 1)
3299 ListAdd(specifiers, MkSpecifier(VOID));
3301 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3302 decl = MkDeclaration(specifiers, declarators);
3303 external = MkExternalDeclaration(decl);
3304 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3305 external->symbol = symbol;
3306 symbol->externalSet = external;
3307 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3311 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3314 if(!symbol->externalPtr)
3316 struct Declaration * decl;
3317 struct External * external;
3318 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3323 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3324 ListAdd(specifiers, MkSpecifierName("Property"));
3326 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3328 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3331 strcpy(propName, "__ecerePropM_");
3332 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3333 strcat(propName, "_");
3334 FullClassNameCat(propName, prop->name, 0x1);
3335 MangleClassName(propName);
3336 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3338 decl = MkDeclaration(specifiers, list);
3340 external = MkExternalDeclaration(decl);
3341 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3342 external->symbol = symbol;
3343 symbol->externalPtr = external;
3347 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3349 symbol->id = curExternal->symbol->idCode;
3353 struct Type * Dereference(struct Type * source)
3355 struct Type * type = (((void *)0));
3359 if(source->kind == 13 || source->kind == 12)
3361 type = source->type;
3362 source->type->refCount++;
3364 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3366 type = __extension__ ({
3367 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3369 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3372 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3378 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3383 static struct Type * Reference(struct Type * source)
3385 struct Type * type = (((void *)0));
3389 type = __extension__ ({
3390 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3392 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3399 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);
3401 extern void * memcpy(void * , const void * , size_t size);
3403 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3405 extern void FreeExpression(struct Expression * exp);
3407 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3409 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);
3411 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3413 extern struct Type * MkClassType(char * name);
3415 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);
3417 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)
3419 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3420 unsigned int found = 0x0;
3421 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3422 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3423 unsigned int freeType = 0x0;
3425 yylloc = member->loc;
3430 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3434 dataMember = *curMember;
3440 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3441 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3442 int _subMemberStackPos = 0;
3445 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3448 dataMember = thisMember;
3449 if(curMember && thisMember->memberAccess == 1)
3451 *curMember = thisMember;
3452 *curClass = thisMember->_class;
3453 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3454 *subMemberStackPos = _subMemberStackPos;
3460 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3461 if(method && method->type == 1)
3464 method = (((void *)0));
3469 struct Type * type = (((void *)0));
3473 if(!dataMember->dataType && dataMember->dataTypeString)
3475 struct Context * context = SetupTemplatesContext(_class);
3477 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3478 FinishTemplatesContext(context);
3480 type = dataMember->dataType;
3484 if(!method->dataType)
3485 ProcessMethodType(method);
3486 type = method->dataType;
3488 if(ident && ident->next)
3490 for(ident = ident->next; ident && type; ident = ident->next)
3494 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3496 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3498 type = dataMember->dataType;
3500 else if(type->kind == 9 || type->kind == 10)
3502 struct Type * memberType;
3504 for(memberType = type->members.first; memberType; memberType = memberType->next)
3506 if(!strcmp(memberType->name, ident->string))
3515 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3518 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3519 struct __ecereNameSpace__ecere__com__Class * sClass;
3521 for(sClass = _class; sClass; sClass = sClass->base)
3524 if(sClass->templateClass)
3525 sClass = sClass->templateClass;
3526 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3528 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3530 for(sClass = sClass->base; sClass; sClass = sClass->base)
3532 if(sClass->templateClass)
3533 sClass = sClass->templateClass;
3534 id += sClass->templateParams.count;
3545 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3547 if(arg.dataTypeString)
3549 type = ProcessTypeString(arg.dataTypeString, 0x0);
3551 if(type && _class->templateClass)
3552 type->passAsTemplate = 0x1;
3559 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3561 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3562 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3566 char templateString[1024];
3567 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3569 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3570 for(cClass = expClass; cClass; cClass = cClass->base)
3574 if(cClass->templateClass)
3575 cClass = cClass->templateClass;
3576 for(param = cClass->templateParams.first; param; param = param->next)
3579 struct __ecereNameSpace__ecere__com__Class * sClass;
3580 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3582 for(sClass = cClass->base; sClass; sClass = sClass->base)
3584 if(sClass->templateClass)
3585 sClass = sClass->templateClass;
3586 id += sClass->templateParams.count;
3588 arg = expClass->templateArgs[id];
3589 for(sClass = _class; sClass; sClass = sClass->base)
3591 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3593 struct __ecereNameSpace__ecere__com__Class * nextClass;
3595 if(sClass->templateClass)
3596 sClass = sClass->templateClass;
3597 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3599 if(nextClass->templateClass)
3600 nextClass = nextClass->templateClass;
3601 p += nextClass->templateParams.count;
3603 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3605 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3607 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3609 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3610 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3624 char expString[1024];
3625 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3626 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3627 struct Expression * exp;
3628 char * string = PrintHexUInt64(arg.expression.ui64);
3630 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3631 ProcessExpressionType(exp);
3632 ComputeExpression(exp);
3633 expString[0] = '\0';
3634 PrintExpression(exp, expString);
3635 strcat(argument, expString);
3636 FreeExpression(exp);
3641 strcat(argument, arg.member->name);
3646 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3647 strcat(argument, arg.dataTypeString);
3654 strcat(templateString, ", ");
3655 if(lastParam != p - 1)
3657 strcat(templateString, param->name);
3658 strcat(templateString, " = ");
3660 strcat(templateString, argument);
3669 int len = strlen(templateString);
3671 if(templateString[len - 1] == '<')
3675 if(templateString[len - 1] == '>')
3676 templateString[len++] = ' ';
3677 templateString[len++] = '>';
3679 templateString[len++] = '\0';
3682 struct Context * context = SetupTemplatesContext(_class);
3686 type = ProcessTypeString(templateString, 0x0);
3688 FinishTemplatesContext(context);
3691 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3693 ProcessExpressionType(member->initializer->exp);
3694 if(!member->initializer->exp->expType)
3698 char expString[10240];
3700 expString[0] = '\0';
3701 PrintExpression(member->initializer->exp, expString);
3702 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3703 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3706 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3708 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3711 else if(member->initializer)
3713 ProcessInitializer(member->initializer, type);
3720 if(_class && _class->type == 3)
3722 if(member->initializer)
3724 struct Type * type = MkClassType(_class->fullName);
3726 ProcessInitializer(member->initializer, type);
3732 if(member->initializer)
3734 ProcessInitializer(member->initializer, (((void *)0)));
3740 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3744 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3746 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3750 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3755 extern struct Identifier * GetDeclId(struct Declarator * decl);
3757 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);
3759 extern void FreeSpecifier(struct Specifier * spec);
3761 static void ProcessFunction(struct FunctionDefinition * function);
3763 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3765 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3767 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3769 extern void FreeClassFunction(struct ClassFunction * func);
3771 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3773 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3775 void ProcessInstantiationType(struct Instantiation * inst)
3780 struct MembersInit * members;
3781 struct Symbol * classSym;
3782 struct __ecereNameSpace__ecere__com__Class * _class;
3784 classSym = inst->_class->symbol;
3785 _class = classSym ? classSym->registered : (((void *)0));
3786 if(!_class || _class->type != 5)
3787 DeclareStruct(inst->_class->name, 0x0);
3788 afterExternal = afterExternal ? afterExternal : curExternal;
3790 ProcessExpressionType(inst->exp);
3791 inst->isConstant = 0x1;
3794 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3795 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3796 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3797 int subMemberStackPos = 0;
3799 for(members = (*inst->members).first; members; members = members->next)
3801 switch(members->type)
3806 static unsigned int instMethodID = 0;
3807 struct External * external = curExternal;
3808 struct Context * context = curContext;
3809 struct Declarator * declarator = members->function->declarator;
3810 struct Identifier * nameID = GetDeclId(declarator);
3811 char * unmangled = nameID ? nameID->string : (((void *)0));
3812 struct Expression * exp;
3813 struct External * createdExternal = (((void *)0));
3819 strcpy(name, "__ecereInstMeth_");
3820 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3822 strcat(name, nameID->string);
3824 sprintf(number, "_%08d", instMethodID++);
3825 strcat(name, number);
3826 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3830 struct Symbol * symbol = declarator->symbol;
3831 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3833 if(method && method->type == 1)
3835 symbol->method = method;
3836 ProcessMethodType(method);
3837 if(!symbol->type->thisClass)
3839 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3841 if(!currentClass->symbol)
3842 currentClass->symbol = FindClass(currentClass->fullName);
3843 symbol->type->thisClass = currentClass->symbol;
3848 _class->symbol = FindClass(_class->fullName);
3849 symbol->type->thisClass = _class->symbol;
3852 DeclareType(symbol->type, 0x1, 0x1);
3856 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3859 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3862 FreeSpecifier(nameID->_class);
3863 nameID->_class = (((void *)0));
3867 struct Type * type = declarator->symbol->type;
3868 struct External * oldExternal = curExternal;
3870 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3872 struct External * externalDecl;
3874 externalDecl = MkExternalDeclaration((((void *)0)));
3875 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3876 if(createdExternal->function)
3878 ProcessFunction(createdExternal->function);
3880 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3882 externalDecl->declaration = decl;
3883 if(decl->symbol && !decl->symbol->pointerExternal)
3884 decl->symbol->pointerExternal = externalDecl;
3885 declarator->symbol->pointerExternal = externalDecl;
3892 curExternal = declarator->symbol->pointerExternal;
3893 ProcessFunction((struct FunctionDefinition *)members->function);
3895 curExternal = external;
3896 curContext = context;
3899 FreeClassFunction(members->function);
3900 exp = QMkExpId(name);
3902 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3903 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3909 if(members->dataMembers && classSym)
3911 struct MemberInit * member;
3912 struct Location oldyyloc = yylloc;
3914 for(member = (*members->dataMembers).first; member; member = member->next)
3916 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3917 if(member->initializer && !member->initializer->isConstant)
3918 inst->isConstant = 0x0;
3930 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3934 if(type->kind == 11)
3936 struct Type * param;
3940 for(param = type->params.first; param; param = param->next)
3941 DeclareType(param, declarePointers, 0x1);
3943 DeclareType(type->returnType, declarePointers, 0x1);
3945 else if(type->kind == 13 && declarePointers)
3946 DeclareType(type->type, declarePointers, 0x0);
3947 else if(type->kind == 8)
3949 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3950 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3952 else if(type->kind == 9 || type->kind == 10)
3954 struct Type * member;
3956 for(member = type->members.first; member; member = member->next)
3957 DeclareType(member, 0x0, 0x0);
3959 else if(type->kind == 12)
3960 DeclareType(type->arrayType, declarePointers, 0x0);
3964 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3966 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3968 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3970 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3971 struct __ecereNameSpace__ecere__com__Class * sClass;
3973 for(sClass = _class; sClass; sClass = sClass->base)
3976 if(sClass->templateClass)
3977 sClass = sClass->templateClass;
3978 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3980 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3982 for(sClass = sClass->base; sClass; sClass = sClass->base)
3984 if(sClass->templateClass)
3985 sClass = sClass->templateClass;
3986 id += sClass->templateParams.count;
3997 arg = &_class->templateArgs[id];
3998 if(arg && param->type == 0)
3999 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
4004 extern struct Context * PushContext(void);
4006 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
4008 struct TemplatedType
4011 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4012 struct __ecereNameSpace__ecere__sys__BTNode * left;
4013 struct __ecereNameSpace__ecere__sys__BTNode * right;
4015 struct TemplateParameter * param;
4016 } __attribute__ ((gcc_struct));
4018 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4020 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4022 struct Context * context = PushContext();
4024 context->templateTypesOnly = 0x1;
4025 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4027 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4029 for(; param; param = param->next)
4031 if(param->type == 0 && param->identifier)
4033 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4035 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4041 struct __ecereNameSpace__ecere__com__Class * sClass;
4043 for(sClass = _class; sClass; sClass = sClass->base)
4045 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4047 for(p = sClass->templateParams.first; p; p = p->next)
4051 struct TemplateParameter * param = p->param;
4052 struct TemplatedType * type;
4056 p->param = param = __extension__ ({
4057 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4059 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4062 type = __extension__ ({
4063 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4065 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4067 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4075 extern void PopContext(struct Context * ctx);
4077 extern void FreeContext(struct Context * context);
4079 void FinishTemplatesContext(struct Context * context)
4081 PopContext(context);
4082 FreeContext(context);
4083 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4086 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4088 if(!method->dataType)
4090 struct Context * context = SetupTemplatesContext(method->_class);
4092 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4093 FinishTemplatesContext(context);
4094 if(method->type != 1 && method->dataType)
4096 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4098 if(!method->_class->symbol)
4099 method->_class->symbol = FindClass(method->_class->fullName);
4100 method->dataType->thisClass = method->_class->symbol;
4106 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4110 struct Context * context = SetupTemplatesContext(prop->_class);
4112 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4113 FinishTemplatesContext(context);
4117 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4119 extern void FreeTypeName(struct TypeName * typeName);
4121 static void ProcessDeclarator(struct Declarator * decl);
4123 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4125 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4129 struct MethodImport * prev;
4130 struct MethodImport * next;
4132 unsigned int isVirtual;
4133 } __attribute__ ((gcc_struct));
4135 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4137 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4139 struct Symbol * symbol = method->symbol;
4141 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4143 unsigned int imported = 0x0;
4144 unsigned int dllImport = 0x0;
4146 if(!method->dataType)
4147 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4148 if(!symbol || symbol->_import || method->type == 1)
4150 if(!symbol || method->type == 1)
4152 struct Symbol * classSym;
4154 if(!method->_class->symbol)
4155 method->_class->symbol = FindClass(method->_class->fullName);
4156 classSym = method->_class->symbol;
4157 if(!classSym->_import)
4159 struct ModuleImport * module;
4161 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4162 module = FindModule(method->_class->module);
4164 module = mainModule;
4165 classSym->_import = __extension__ ({
4166 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4168 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4170 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4174 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4176 if(!symbol->_import)
4178 symbol->_import = (struct ClassImport *)__extension__ ({
4179 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4181 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4183 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4187 symbol->type = method->dataType;
4189 symbol->type->refCount++;
4192 if(!method->dataType->dllExport)
4195 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4199 if(method->type != 1 && method->dataType)
4200 DeclareType(method->dataType, 0x1, 0x1);
4201 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4203 struct Declaration * decl;
4204 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4205 struct Declarator * d;
4206 struct Declarator * funcDecl;
4207 struct External * external;
4209 specifiers = MkList();
4210 declarators = MkList();
4212 ListAdd(specifiers, MkSpecifier(EXTERN));
4213 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4214 ListAdd(specifiers, MkSpecifier(STATIC));
4215 if(method->type == 1)
4217 ListAdd(specifiers, MkSpecifier(INT));
4218 d = MkDeclaratorIdentifier(MkIdentifier(name));
4222 d = MkDeclaratorIdentifier(MkIdentifier(name));
4224 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4226 struct Context * context = SetupTemplatesContext(method->_class);
4228 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4229 FinishTemplatesContext(context);
4231 funcDecl = GetFuncDecl(d);
4234 struct Specifier * spec, * next;
4236 for(spec = (*specifiers).first; spec; spec = next)
4241 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4242 FreeSpecifier(spec);
4246 if(method->dataType && !method->dataType->staticMethod)
4248 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4250 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4251 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")));
4252 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4253 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4255 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4257 struct TypeName * param = (*funcDecl->function.parameters).first;
4259 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4260 FreeTypeName(param);
4262 if(!funcDecl->function.parameters)
4263 funcDecl->function.parameters = MkList();
4264 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4268 ProcessDeclarator(d);
4269 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4270 decl = MkDeclaration(specifiers, declarators);
4271 ReplaceThisClassSpecifiers(specifiers, method->_class);
4272 if(symbol->pointerExternal)
4274 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4277 *functionSymbol = *symbol;
4278 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4279 if(functionSymbol->type)
4280 functionSymbol->type->refCount++;
4282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4283 symbol->pointerExternal->symbol = functionSymbol;
4285 external = MkExternalDeclaration(decl);
4287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4288 external->symbol = symbol;
4289 symbol->pointerExternal = external;
4293 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4295 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4299 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4301 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4303 unsigned int first = 0x1;
4305 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4307 char className[1024];
4309 strcpy(className, _class->fullName);
4310 for(param = _class->templateParams.first; param; param = param->next)
4314 strcat(className, "<");
4316 strcat(className, ", ");
4317 if(lastParam + 1 != p)
4319 strcat(className, param->name);
4320 strcat(className, " = ");
4322 strcat(className, param->name);
4330 int len = strlen(className);
4332 if(className[len - 1] == '>')
4333 className[len++] = ' ';
4334 className[len++] = '>';
4335 className[len++] = '\0';
4337 return __ecereNameSpace__ecere__sys__CopyString(className);
4340 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4343 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4345 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4347 unsigned int first = 0x1;
4349 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4351 char className[1024];
4353 strcpy(className, _class->fullName);
4354 for(param = _class->templateParams.first; param; param = param->next)
4358 strcat(className, "<");
4360 strcat(className, ", ");
4361 if(lastParam + 1 != p)
4363 strcat(className, param->name);
4364 strcat(className, " = ");
4366 strcat(className, param->name);
4374 int len = strlen(className);
4376 if(className[len - 1] == '>')
4377 className[len++] = ' ';
4378 className[len++] = '>';
4379 className[len++] = '\0';
4381 return MkClassType(className);
4385 return MkClassType(_class->fullName);
4389 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4391 if(specs != (((void *)0)) && _class)
4393 struct Specifier * spec;
4395 for(spec = specs->first; spec; spec = spec->next)
4397 if(spec->type == 0 && spec->specifier == THISCLASS)
4400 spec->name = ReplaceThisClass(_class);
4401 spec->symbol = FindClass(spec->name);
4407 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4409 struct __ecereNameSpace__ecere__com__GlobalFunction
4411 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4412 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4415 struct __ecereNameSpace__ecere__com__Instance * module;
4416 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4417 char * dataTypeString;
4418 struct Type * dataType;
4420 } __attribute__ ((gcc_struct));
4422 extern struct Context * globalContext;
4424 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4426 struct FunctionImport
4428 struct FunctionImport * prev;
4429 struct FunctionImport * next;
4431 } __attribute__ ((gcc_struct));
4433 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4435 struct Symbol * symbol = function->symbol;
4437 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4439 unsigned int imported = 0x0;
4440 unsigned int dllImport = 0x0;
4442 if(!function->dataType)
4444 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4445 if(!function->dataType->thisClass)
4446 function->dataType->staticMethod = 0x1;
4452 struct ModuleImport * module = FindModule(function->module);
4454 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4457 if(!function->dataType->dllExport)
4459 symbol->_import = (struct ClassImport *)__extension__ ({
4460 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4462 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4464 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4468 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4469 if(!symbol->type->thisClass)
4470 symbol->type->staticMethod = 0x1;
4473 imported = symbol->_import ? 0x1 : 0x0;
4474 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4477 DeclareType(function->dataType, 0x1, 0x1);
4480 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4482 struct Declaration * decl;
4483 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4484 struct Declarator * d;
4485 struct Declarator * funcDecl;
4486 struct External * external;
4488 specifiers = MkList();
4489 declarators = MkList();
4490 ListAdd(specifiers, MkSpecifier(EXTERN));
4491 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4493 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4494 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4495 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4497 struct Specifier * spec;
4499 for(spec = (*specifiers).first; spec; spec = spec->next)
4500 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4502 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4503 FreeSpecifier(spec);
4507 funcDecl = GetFuncDecl(d);
4508 if(funcDecl && !funcDecl->function.parameters)
4510 funcDecl->function.parameters = MkList();
4511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4513 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4515 struct Context * oldCtx = curContext;
4517 curContext = globalContext;
4518 decl = MkDeclaration(specifiers, declarators);
4519 curContext = oldCtx;
4521 if(symbol->pointerExternal)
4523 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4526 *functionSymbol = *symbol;
4527 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4528 if(functionSymbol->type)
4529 functionSymbol->type->refCount++;
4531 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4532 symbol->pointerExternal->symbol = functionSymbol;
4534 external = MkExternalDeclaration(decl);
4536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4537 external->symbol = symbol;
4538 symbol->pointerExternal = external;
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4545 symbol->id = curExternal->symbol->idCode;
4548 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4556 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4557 struct __ecereNameSpace__ecere__sys__BTNode * left;
4558 struct __ecereNameSpace__ecere__sys__BTNode * right;
4560 struct __ecereNameSpace__ecere__com__Instance * module;
4561 char * dataTypeString;
4562 struct Type * dataType;
4565 } __attribute__ ((gcc_struct));
4567 void DeclareGlobalData(struct GlobalData * data)
4569 struct Symbol * symbol = data->symbol;
4571 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4576 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4579 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4580 DeclareType(data->dataType, 0x1, 0x1);
4583 if(!symbol->pointerExternal)
4585 struct Declaration * decl;
4586 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4587 struct Declarator * d;
4588 struct External * external;
4590 specifiers = MkList();
4591 declarators = MkList();
4592 ListAdd(specifiers, MkSpecifier(EXTERN));
4593 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4594 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4595 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4596 decl = MkDeclaration(specifiers, declarators);
4597 external = MkExternalDeclaration(decl);
4599 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4600 external->symbol = symbol;
4601 symbol->pointerExternal = external;
4605 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4608 symbol->id = curExternal->symbol->idCode;
4615 struct Conversion * prev, * next;
4616 struct __ecereNameSpace__ecere__com__Property * convert;
4618 struct Type * resultType;
4619 } __attribute__ ((gcc_struct));
4621 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4623 extern void Compiler_Warning(char * format, ...);
4625 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4627 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)
4631 if(source->kind == 20 && dest->kind != 20)
4633 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4638 if(dest->kind == 20 && source->kind != 20)
4640 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4645 if(dest->classObjectType == 2)
4647 if(source->classObjectType != 3)
4651 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4659 if(source->classObjectType == 3)
4661 if(dest->classObjectType == 3 && source->classObjectType != 2)
4664 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4666 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4669 if(dest->kind == 14 && source->kind != 0)
4671 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))
4673 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))
4675 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4677 if(source->_class->registered && source->_class->registered->type == 3)
4679 if(conversions != (((void *)0)))
4681 if(source->_class->registered == dest->_class->registered)
4686 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4688 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4690 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4692 if(sourceBase == destBase)
4696 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))
4700 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))
4702 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4709 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4713 if(source->kind == 8)
4715 struct __ecereNameSpace__ecere__com__Class * _class;
4717 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4719 struct __ecereNameSpace__ecere__com__Property * convert;
4721 for(convert = _class->conversions.first; convert; convert = convert->next)
4723 if(convert->memberAccess == 1 || _class->module == privateModule)
4725 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4727 if(!convert->dataType)
4728 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4729 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4731 if(!conversions && !convert->Get)
4733 else if(conversions != (((void *)0)))
4735 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))
4739 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4741 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4752 struct __ecereNameSpace__ecere__com__Class * _class;
4754 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4756 struct __ecereNameSpace__ecere__com__Property * convert;
4758 for(convert = _class->conversions.first; convert; convert = convert->next)
4760 if(convert->memberAccess == 1 || _class->module == privateModule)
4762 if(!convert->dataType)
4763 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4764 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4766 if(!conversions && !convert->Set)
4768 else if(conversions != (((void *)0)))
4770 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))
4774 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4776 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4784 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4786 if(!dest->_class->registered->dataType)
4787 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4788 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4790 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4797 if(source->kind == 8)
4799 struct __ecereNameSpace__ecere__com__Class * _class;
4801 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4803 struct __ecereNameSpace__ecere__com__Property * convert;
4805 for(convert = _class->conversions.first; convert; convert = convert->next)
4807 if(convert->memberAccess == 1 || _class->module == privateModule)
4809 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4811 if(!convert->dataType)
4812 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4813 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4815 if(!conversions && !convert->Get)
4817 else if(conversions != (((void *)0)))
4819 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))
4823 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4825 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4833 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4835 if(!source->_class->registered->dataType)
4836 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4837 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4844 if(source->kind == 8 || source->kind == 19)
4846 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4848 else if(dest->kind == 7 && source->kind == 6)
4850 else if(dest->kind == 2 && (source->kind == 1 || source->kind == 24))
4852 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 23))
4854 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4856 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4858 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4860 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))
4862 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))
4864 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)))
4866 struct Type * paramSource, * paramDest;
4868 if(dest->kind == 16)
4869 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4870 if(source->kind == 16)
4871 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4872 if(dest->kind == 13 && dest->type->kind == 11)
4874 if(source->kind == 13 && source->type->kind == 11)
4875 source = source->type;
4876 if(dest->kind == 16)
4877 dest = dest->method->dataType;
4878 if(source->kind == 16)
4879 source = source->method->dataType;
4880 paramSource = source->params.first;
4881 if(paramSource && paramSource->kind == 0)
4882 paramSource = (((void *)0));
4883 paramDest = dest->params.first;
4884 if(paramDest && paramDest->kind == 0)
4885 paramDest = (((void *)0));
4886 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4888 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))))
4890 if(paramDest && paramDest->kind == 8)
4891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4893 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4896 paramDest = paramDest->next;
4898 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4900 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4904 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4906 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4912 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4915 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4917 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4921 paramSource = paramSource->next;
4927 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4929 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4935 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4943 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4945 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4948 for(; paramDest; paramDest = paramDest->next)
4952 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4956 struct Type * paramDestType = paramDest;
4957 struct Type * paramSourceType = paramSource;
4958 struct Type * type = paramDestType;
4960 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4963 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4964 struct __ecereNameSpace__ecere__com__Class * sClass;
4966 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4969 if(sClass->templateClass)
4970 sClass = sClass->templateClass;
4971 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4973 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4975 for(sClass = sClass->base; sClass; sClass = sClass->base)
4977 if(sClass->templateClass)
4978 sClass = sClass->templateClass;
4979 id += sClass->templateParams.count;
4990 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4992 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4995 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)))
5000 PrintType(paramDest, type, 0x0, 0x1);
5001 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
5002 if(paramDestType != paramDest)
5003 FreeType(paramDestType);
5006 if(paramDestType != paramDest)
5007 FreeType(paramDestType);
5009 paramSource = paramSource->next;
5013 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5018 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5022 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5024 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5031 static void FreeConvert(struct Conversion * convert)
5033 if(convert->resultType)
5034 FreeType(convert->resultType);
5037 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5039 struct __ecereNameSpace__ecere__com__BTNamedLink
5042 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5043 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5044 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5047 } __attribute__ ((gcc_struct));
5049 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5051 struct __ecereNameSpace__ecere__com__EnumClassData
5053 struct __ecereNameSpace__ecere__sys__OldList values;
5055 } __attribute__ ((gcc_struct));
5057 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5059 struct __ecereNameSpace__ecere__sys__NamedLink
5061 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5062 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5065 } __attribute__ ((gcc_struct));
5067 extern void FreeExpContents(struct Expression * exp);
5069 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5071 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5073 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5075 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5077 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5079 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5081 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5083 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)))
5085 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5087 if(_class->type == 4)
5089 struct __ecereNameSpace__ecere__sys__OldList converts =
5093 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5097 _class->symbol = FindClass(_class->fullName);
5098 type->_class = _class->symbol;
5099 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5101 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5102 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5106 struct __ecereNameSpace__ecere__com__Class * baseClass;
5108 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5110 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5112 for(value = e->values.first; value; value = value->next)
5114 if(!strcmp(value->name, string))
5119 FreeExpContents(sourceExp);
5120 FreeType(sourceExp->expType);
5121 sourceExp->isConstant = 0x1;
5122 sourceExp->expType = MkClassType(baseClass->fullName);
5126 sourceExp->type = 2;
5127 if(!strcmp(baseClass->dataTypeString, "int"))
5128 sprintf(constant, "%d", (int)value->data);
5130 sprintf(constant, "0x%X", (int)value->data);
5131 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5133 while(converts.first)
5135 struct Conversion * convert = converts.first;
5137 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5140 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5147 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5148 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5151 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)))
5152 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5157 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5159 struct __ecereNameSpace__ecere__com__SubModule
5161 struct __ecereNameSpace__ecere__com__SubModule * prev;
5162 struct __ecereNameSpace__ecere__com__SubModule * next;
5163 struct __ecereNameSpace__ecere__com__Instance * module;
5165 } __attribute__ ((gcc_struct));
5167 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5169 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5171 if(searchFor == searchIn)
5173 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5175 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5177 if(ModuleVisibility(subModule->module, searchFor))
5184 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5186 struct __ecereNameSpace__ecere__com__Application
5191 unsigned int isGUIApp;
5192 struct __ecereNameSpace__ecere__sys__OldList allModules;
5193 char * parsedCommand;
5194 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5195 } __attribute__ ((gcc_struct));
5197 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5199 struct __ecereNameSpace__ecere__com__Instance * module;
5201 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))
5203 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))
5205 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))
5207 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)
5209 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5215 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5217 void ReadString(char * output, char * string);
5219 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5221 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5223 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5225 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5227 struct Type * source = sourceExp->expType;
5228 struct Type * realDest = dest;
5229 struct Type * backupSourceExpType = (((void *)0));
5231 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5233 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5235 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5237 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5239 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5241 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5243 if(sourceBase == destBase)
5249 struct __ecereNameSpace__ecere__sys__OldList * specs;
5250 unsigned int flag = 0x0;
5251 long long value = (((int)0x7fffffff));
5255 if(sourceExp->type == 2)
5257 if(source->isSigned)
5258 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5260 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5262 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5264 if(source->isSigned)
5265 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5267 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5269 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5272 source = __extension__ ({
5273 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5275 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5280 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5282 if(_class && _class->type == 3)
5284 if(source->kind != 8)
5286 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5287 struct Type * tempDest, * tempSource;
5289 for(; _class->base->type != 1000; _class = _class->base)
5292 tempDest = tempType;
5295 _class->symbol = FindClass(_class->fullName);
5296 tempType->_class = _class->symbol;
5297 tempType->truth = dest->truth;
5298 if(tempType->_class)
5299 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5300 backupSourceExpType = sourceExp->expType;
5301 sourceExp->expType = dest;
5304 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5307 if(_class && _class->type == 2 && source->kind != 8)
5309 if(!dest->_class->registered->dataType)
5310 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5311 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5314 FreeType(sourceExp->expType);
5315 source = sourceExp->expType = MkClassType(dest->_class->string);
5319 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5321 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5322 struct Declarator * decl;
5325 ReadString(string, sourceExp->string);
5326 decl = SpecDeclFromString(string, specs, (((void *)0)));
5327 FreeExpContents(sourceExp);
5328 FreeType(sourceExp->expType);
5329 sourceExp->type = 26;
5330 sourceExp->_classExp.specifiers = specs;
5331 sourceExp->_classExp.decl = decl;
5332 sourceExp->expType = dest;
5336 if(backupSourceExpType)
5337 FreeType(backupSourceExpType);
5341 else if(source->kind == 8)
5343 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5345 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5349 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5350 struct Type * tempDest, * tempSource;
5352 if(!source->_class->registered->dataType)
5353 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5354 for(; _class->base->type != 1000; _class = _class->base)
5357 tempSource = tempType;
5359 tempType->_class = FindClass(_class->fullName);
5360 tempType->truth = source->truth;
5361 tempType->classObjectType = source->classObjectType;
5362 if(tempType->_class)
5363 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5364 if(conversions->last)
5366 ((struct Conversion *)conversions->last)->resultType = dest;
5369 FreeType(sourceExp->expType);
5370 sourceExp->expType = MkClassType(_class->fullName);
5371 sourceExp->expType->truth = source->truth;
5372 sourceExp->expType->classObjectType = source->classObjectType;
5373 if(!sourceExp->destType)
5375 FreeType(sourceExp->destType);
5376 sourceExp->destType = sourceExp->expType;
5377 if(sourceExp->expType)
5378 sourceExp->expType->refCount++;
5380 if(!_class->dataType)
5381 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5383 dest = MkClassType(source->_class->string);
5384 dest->truth = source->truth;
5385 dest->classObjectType = source->classObjectType;
5387 source = _class->dataType;
5389 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5395 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5404 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5406 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5408 if(_class->type == 0 || _class->type == 5)
5410 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5412 *newExp = *sourceExp;
5413 if(sourceExp->destType)
5414 sourceExp->destType->refCount++;
5415 if(sourceExp->expType)
5416 sourceExp->expType->refCount++;
5417 sourceExp->type = 11;
5418 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5419 sourceExp->cast.exp = newExp;
5420 FreeType(sourceExp->expType);
5421 sourceExp->expType = (((void *)0));
5422 ProcessExpressionType(sourceExp);
5425 FreeType(sourceExp->expType);
5426 sourceExp->expType = dest;
5431 if(backupSourceExpType)
5432 FreeType(backupSourceExpType);
5435 if(!_class->dataType)
5436 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5438 dest = _class->dataType;
5441 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))
5443 specs = MkListOne(MkSpecifier(DOUBLE));
5445 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))
5447 specs = MkListOne(MkSpecifier(FLOAT));
5449 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))
5453 ListAdd(specs, MkSpecifier(UNSIGNED));
5454 ListAdd(specs, MkSpecifier(INT64));
5456 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 6 || source->kind == 7))
5460 ListAdd(specs, MkSpecifier(UNSIGNED));
5461 ListAdd(specs, MkSpecifier(INT));
5463 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 24 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5467 ListAdd(specs, MkSpecifier(UNSIGNED));
5468 ListAdd(specs, MkSpecifier(SHORT));
5470 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 24 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5474 ListAdd(specs, MkSpecifier(UNSIGNED));
5475 ListAdd(specs, MkSpecifier(CHAR));
5481 if(backupSourceExpType)
5483 if(sourceExp->expType)
5484 FreeType(sourceExp->expType);
5485 sourceExp->expType = backupSourceExpType;
5490 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))
5492 specs = MkListOne(MkSpecifier(DOUBLE));
5494 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))
5496 specs = MkListOne(MkSpecifier(FLOAT));
5498 else if(dest->kind == 24 && (source->kind == 24 || source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (value == 1 || value == 0))
5501 ListAdd(specs, MkSpecifier(BOOL));
5503 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)))
5507 ListAdd(specs, MkSpecifier(UNSIGNED));
5508 ListAdd(specs, MkSpecifier(CHAR));
5510 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)))))
5514 ListAdd(specs, MkSpecifier(UNSIGNED));
5515 ListAdd(specs, MkSpecifier(SHORT));
5517 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3))
5521 ListAdd(specs, MkSpecifier(UNSIGNED));
5522 ListAdd(specs, MkSpecifier(INT));
5524 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 24 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5528 ListAdd(specs, MkSpecifier(UNSIGNED));
5529 ListAdd(specs, MkSpecifier(INT64));
5531 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 24 || source->kind == 1))
5533 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5539 if(backupSourceExpType)
5541 if(sourceExp->expType)
5542 FreeType(sourceExp->expType);
5543 sourceExp->expType = backupSourceExpType;
5549 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5551 *newExp = *sourceExp;
5552 newExp->prev = (((void *)0));
5553 newExp->next = (((void *)0));
5554 if(sourceExp->destType)
5555 sourceExp->destType->refCount++;
5556 if(sourceExp->expType)
5557 sourceExp->expType->refCount++;
5558 sourceExp->type = 11;
5559 if(realDest->kind == 8)
5561 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5562 FreeList(specs, FreeSpecifier);
5565 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5566 if(newExp->type == 4)
5568 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5571 sourceExp->cast.exp = newExp;
5572 FreeType(sourceExp->expType);
5573 sourceExp->expType = (((void *)0));
5574 ProcessExpressionType(sourceExp);
5577 FreeList(specs, FreeSpecifier);
5580 if(backupSourceExpType)
5581 FreeType(backupSourceExpType);
5586 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5587 sourceExp = (*sourceExp->list).last;
5588 if(sourceExp->type == 0)
5590 struct Identifier * id = sourceExp->identifier;
5594 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5596 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5597 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5601 for(; _class && _class->type == 4; _class = _class->base)
5603 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5604 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5606 for(value = e->values.first; value; value = value->next)
5608 if(!strcmp(value->name, id->string))
5613 FreeExpContents(sourceExp);
5614 FreeType(sourceExp->expType);
5615 sourceExp->isConstant = 0x1;
5616 sourceExp->expType = MkClassType(_class->fullName);
5620 sourceExp->type = 2;
5621 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5622 sprintf(constant, "%d", (int)value->data);
5624 sprintf(constant, "0x%X", (int)value->data);
5625 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5633 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5640 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5642 int value2 = op2->i;
5645 exp->string = PrintInt(op1->i + value2);
5648 exp->expType = op1->type;
5650 op1->type->refCount++;
5655 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5657 unsigned int value2 = op2->ui;
5660 exp->string = PrintUInt(op1->ui + value2);
5663 exp->expType = op1->type;
5665 op1->type->refCount++;
5670 static unsigned int Int64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5672 int value2 = op2->i;
5675 exp->string = PrintInt64(op1->i + value2);
5678 exp->expType = op1->type;
5680 op1->type->refCount++;
5685 static unsigned int UInt64Add(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5687 unsigned int value2 = op2->ui;
5690 exp->string = PrintUInt64(op1->ui + value2);
5693 exp->expType = op1->type;
5695 op1->type->refCount++;
5700 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5702 short value2 = op2->s;
5705 exp->string = PrintShort(op1->s + value2);
5708 exp->expType = op1->type;
5710 op1->type->refCount++;
5715 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5717 unsigned short value2 = op2->us;
5720 exp->string = PrintUShort(op1->us + value2);
5723 exp->expType = op1->type;
5725 op1->type->refCount++;
5730 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5732 char value2 = op2->c;
5735 exp->string = PrintChar(op1->c + value2);
5738 exp->expType = op1->type;
5740 op1->type->refCount++;
5745 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5747 unsigned char value2 = op2->uc;
5750 exp->string = PrintUChar(op1->uc + value2);
5753 exp->expType = op1->type;
5755 op1->type->refCount++;
5760 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5762 float value2 = op2->f;
5765 exp->string = PrintFloat(op1->f + value2);
5768 exp->expType = op1->type;
5770 op1->type->refCount++;
5775 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5777 double value2 = op2->d;
5780 exp->string = PrintDouble(op1->d + value2);
5783 exp->expType = op1->type;
5785 op1->type->refCount++;
5790 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5792 int value2 = op2->i;
5795 exp->string = PrintInt(op1->i - value2);
5798 exp->expType = op1->type;
5800 op1->type->refCount++;
5805 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5807 unsigned int value2 = op2->ui;
5810 exp->string = PrintUInt(op1->ui - value2);
5813 exp->expType = op1->type;
5815 op1->type->refCount++;
5820 static unsigned int Int64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5822 int value2 = op2->i;
5825 exp->string = PrintInt64(op1->i - value2);
5828 exp->expType = op1->type;
5830 op1->type->refCount++;
5835 static unsigned int UInt64Sub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5837 unsigned int value2 = op2->ui;
5840 exp->string = PrintUInt64(op1->ui - value2);
5843 exp->expType = op1->type;
5845 op1->type->refCount++;
5850 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5852 short value2 = op2->s;
5855 exp->string = PrintShort(op1->s - value2);
5858 exp->expType = op1->type;
5860 op1->type->refCount++;
5865 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5867 unsigned short value2 = op2->us;
5870 exp->string = PrintUShort(op1->us - value2);
5873 exp->expType = op1->type;
5875 op1->type->refCount++;
5880 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5882 char value2 = op2->c;
5885 exp->string = PrintChar(op1->c - value2);
5888 exp->expType = op1->type;
5890 op1->type->refCount++;
5895 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5897 unsigned char value2 = op2->uc;
5900 exp->string = PrintUChar(op1->uc - value2);
5903 exp->expType = op1->type;
5905 op1->type->refCount++;
5910 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5912 float value2 = op2->f;
5915 exp->string = PrintFloat(op1->f - value2);
5918 exp->expType = op1->type;
5920 op1->type->refCount++;
5925 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5927 double value2 = op2->d;
5930 exp->string = PrintDouble(op1->d - value2);
5933 exp->expType = op1->type;
5935 op1->type->refCount++;
5940 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5942 int value2 = op2->i;
5945 exp->string = PrintInt(op1->i * value2);
5948 exp->expType = op1->type;
5950 op1->type->refCount++;
5955 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5957 unsigned int value2 = op2->ui;
5960 exp->string = PrintUInt(op1->ui * value2);
5963 exp->expType = op1->type;
5965 op1->type->refCount++;
5970 static unsigned int Int64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5972 int value2 = op2->i;
5975 exp->string = PrintInt64(op1->i * value2);
5978 exp->expType = op1->type;
5980 op1->type->refCount++;
5985 static unsigned int UInt64Mul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5987 unsigned int value2 = op2->ui;
5990 exp->string = PrintUInt64(op1->ui * value2);
5993 exp->expType = op1->type;
5995 op1->type->refCount++;
6000 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6002 short value2 = op2->s;
6005 exp->string = PrintShort(op1->s * value2);
6008 exp->expType = op1->type;
6010 op1->type->refCount++;
6015 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6017 unsigned short value2 = op2->us;
6020 exp->string = PrintUShort(op1->us * value2);
6023 exp->expType = op1->type;
6025 op1->type->refCount++;
6030 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6032 char value2 = op2->c;
6035 exp->string = PrintChar(op1->c * value2);
6038 exp->expType = op1->type;
6040 op1->type->refCount++;
6045 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6047 unsigned char value2 = op2->uc;
6050 exp->string = PrintUChar(op1->uc * value2);
6053 exp->expType = op1->type;
6055 op1->type->refCount++;
6060 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6062 float value2 = op2->f;
6065 exp->string = PrintFloat(op1->f * value2);
6068 exp->expType = op1->type;
6070 op1->type->refCount++;
6075 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6077 double value2 = op2->d;
6080 exp->string = PrintDouble(op1->d * value2);
6083 exp->expType = op1->type;
6085 op1->type->refCount++;
6090 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6092 int value2 = op2->i;
6095 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
6098 exp->expType = op1->type;
6100 op1->type->refCount++;
6105 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6107 unsigned int value2 = op2->ui;
6110 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6113 exp->expType = op1->type;
6115 op1->type->refCount++;
6120 static unsigned int Int64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6122 int value2 = op2->i;
6125 exp->string = PrintInt64(value2 ? (op1->i / value2) : 0);
6128 exp->expType = op1->type;
6130 op1->type->refCount++;
6135 static unsigned int UInt64Div(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6137 unsigned int value2 = op2->ui;
6140 exp->string = PrintUInt64(value2 ? (op1->ui / value2) : 0);
6143 exp->expType = op1->type;
6145 op1->type->refCount++;
6150 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6152 short value2 = op2->s;
6155 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6158 exp->expType = op1->type;
6160 op1->type->refCount++;
6165 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6167 unsigned short value2 = op2->us;
6170 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6173 exp->expType = op1->type;
6175 op1->type->refCount++;
6180 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6182 char value2 = op2->c;
6185 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6188 exp->expType = op1->type;
6190 op1->type->refCount++;
6195 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6197 unsigned char value2 = op2->uc;
6200 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6203 exp->expType = op1->type;
6205 op1->type->refCount++;
6210 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6212 float value2 = op2->f;
6215 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6218 exp->expType = op1->type;
6220 op1->type->refCount++;
6225 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6227 double value2 = op2->d;
6230 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6233 exp->expType = op1->type;
6235 op1->type->refCount++;
6240 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6242 int value2 = op2->i;
6245 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6248 exp->expType = op1->type;
6250 op1->type->refCount++;
6255 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6257 unsigned int value2 = op2->ui;
6260 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6263 exp->expType = op1->type;
6265 op1->type->refCount++;
6270 static unsigned int Int64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6272 int value2 = op2->i;
6275 exp->string = PrintInt64(value2 ? (op1->i % value2) : 0);
6278 exp->expType = op1->type;
6280 op1->type->refCount++;
6285 static unsigned int UInt64Mod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6287 unsigned int value2 = op2->ui;
6290 exp->string = PrintUInt64(value2 ? (op1->ui % value2) : 0);
6293 exp->expType = op1->type;
6295 op1->type->refCount++;
6300 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6302 short value2 = op2->s;
6305 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6308 exp->expType = op1->type;
6310 op1->type->refCount++;
6315 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6317 unsigned short value2 = op2->us;
6320 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6332 char value2 = op2->c;
6335 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6338 exp->expType = op1->type;
6340 op1->type->refCount++;
6345 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6347 unsigned char value2 = op2->uc;
6350 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6353 exp->expType = op1->type;
6355 op1->type->refCount++;
6360 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6363 exp->string = PrintInt((-op1->i));
6366 exp->expType = op1->type;
6368 op1->type->refCount++;
6373 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6376 exp->string = PrintUInt((unsigned int)(-op1->ui));
6379 exp->expType = op1->type;
6381 op1->type->refCount++;
6386 static unsigned int Int64Neg(struct Expression * exp, struct Operand * op1)
6389 exp->string = PrintInt64((-op1->i));
6392 exp->expType = op1->type;
6394 op1->type->refCount++;
6399 static unsigned int UInt64Neg(struct Expression * exp, struct Operand * op1)
6402 exp->string = PrintUInt64((unsigned int)(-op1->ui));
6405 exp->expType = op1->type;
6407 op1->type->refCount++;
6412 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6415 exp->string = PrintShort((-op1->s));
6418 exp->expType = op1->type;
6420 op1->type->refCount++;
6425 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6428 exp->string = PrintUShort((unsigned short)(-op1->us));
6431 exp->expType = op1->type;
6433 op1->type->refCount++;
6438 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6441 exp->string = PrintChar((-op1->c));
6444 exp->expType = op1->type;
6446 op1->type->refCount++;
6451 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6454 exp->string = PrintUChar((unsigned char)(-op1->uc));
6457 exp->expType = op1->type;
6459 op1->type->refCount++;
6464 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6467 exp->string = PrintFloat((float)(-op1->f));
6470 exp->expType = op1->type;
6472 op1->type->refCount++;
6477 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6480 exp->string = PrintDouble((double)(-op1->d));
6483 exp->expType = op1->type;
6485 op1->type->refCount++;
6490 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6493 exp->string = PrintInt((++op1->i));
6496 exp->expType = op1->type;
6498 op1->type->refCount++;
6503 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6506 exp->string = PrintUInt((++op1->ui));
6509 exp->expType = op1->type;
6511 op1->type->refCount++;
6516 static unsigned int Int64Inc(struct Expression * exp, struct Operand * op1)
6519 exp->string = PrintInt64((++op1->i));
6522 exp->expType = op1->type;
6524 op1->type->refCount++;
6529 static unsigned int UInt64Inc(struct Expression * exp, struct Operand * op1)
6532 exp->string = PrintUInt64((++op1->ui));
6535 exp->expType = op1->type;
6537 op1->type->refCount++;
6542 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6545 exp->string = PrintShort((++op1->s));
6548 exp->expType = op1->type;
6550 op1->type->refCount++;
6555 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6558 exp->string = PrintUShort((++op1->us));
6561 exp->expType = op1->type;
6563 op1->type->refCount++;
6568 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6571 exp->string = PrintChar((++op1->c));
6574 exp->expType = op1->type;
6576 op1->type->refCount++;
6581 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6584 exp->string = PrintUChar((++op1->uc));
6587 exp->expType = op1->type;
6589 op1->type->refCount++;
6594 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6597 exp->string = PrintFloat((float)(++op1->f));
6600 exp->expType = op1->type;
6602 op1->type->refCount++;
6607 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6610 exp->string = PrintDouble((double)(++op1->d));
6613 exp->expType = op1->type;
6615 op1->type->refCount++;
6620 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6623 exp->string = PrintInt((--op1->i));
6626 exp->expType = op1->type;
6628 op1->type->refCount++;
6633 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6636 exp->string = PrintUInt((--op1->ui));
6639 exp->expType = op1->type;
6641 op1->type->refCount++;
6646 static unsigned int Int64Dec(struct Expression * exp, struct Operand * op1)
6649 exp->string = PrintInt64((--op1->i));
6652 exp->expType = op1->type;
6654 op1->type->refCount++;
6659 static unsigned int UInt64Dec(struct Expression * exp, struct Operand * op1)
6662 exp->string = PrintUInt64((--op1->ui));
6665 exp->expType = op1->type;
6667 op1->type->refCount++;
6672 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6675 exp->string = PrintShort((--op1->s));
6678 exp->expType = op1->type;
6680 op1->type->refCount++;
6685 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6688 exp->string = PrintUShort((--op1->us));
6691 exp->expType = op1->type;
6693 op1->type->refCount++;
6698 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6701 exp->string = PrintChar((--op1->c));
6704 exp->expType = op1->type;
6706 op1->type->refCount++;
6711 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6714 exp->string = PrintUChar((--op1->uc));
6717 exp->expType = op1->type;
6719 op1->type->refCount++;
6724 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6727 exp->string = PrintFloat((float)(--op1->f));
6730 exp->expType = op1->type;
6732 op1->type->refCount++;
6737 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6740 exp->string = PrintDouble((double)(--op1->d));
6743 exp->expType = op1->type;
6745 op1->type->refCount++;
6750 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6752 int value2 = op2->i;
6755 exp->string = PrintInt(op1->i = value2);
6758 exp->expType = op1->type;
6760 op1->type->refCount++;
6765 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6767 unsigned int value2 = op2->ui;
6770 exp->string = PrintUInt(op1->ui = value2);
6773 exp->expType = op1->type;
6775 op1->type->refCount++;
6780 static unsigned int Int64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6782 int value2 = op2->i;
6785 exp->string = PrintInt64(op1->i = value2);
6788 exp->expType = op1->type;
6790 op1->type->refCount++;
6795 static unsigned int UInt64Asign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6797 unsigned int value2 = op2->ui;
6800 exp->string = PrintUInt64(op1->ui = value2);
6803 exp->expType = op1->type;
6805 op1->type->refCount++;
6810 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6812 short value2 = op2->s;
6815 exp->string = PrintShort(op1->s = value2);
6818 exp->expType = op1->type;
6820 op1->type->refCount++;
6825 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6827 unsigned short value2 = op2->us;
6830 exp->string = PrintUShort(op1->us = value2);
6833 exp->expType = op1->type;
6835 op1->type->refCount++;
6840 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6842 char value2 = op2->c;
6845 exp->string = PrintChar(op1->c = value2);
6848 exp->expType = op1->type;
6850 op1->type->refCount++;
6855 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6857 unsigned char value2 = op2->uc;
6860 exp->string = PrintUChar(op1->uc = value2);
6863 exp->expType = op1->type;
6865 op1->type->refCount++;
6870 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6872 float value2 = op2->f;
6875 exp->string = PrintFloat(op1->f = value2);
6878 exp->expType = op1->type;
6880 op1->type->refCount++;
6885 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6887 double value2 = op2->d;
6890 exp->string = PrintDouble(op1->d = value2);
6893 exp->expType = op1->type;
6895 op1->type->refCount++;
6900 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6902 int value2 = op2->i;
6905 exp->string = PrintInt(op1->i += value2);
6908 exp->expType = op1->type;
6910 op1->type->refCount++;
6915 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6917 unsigned int value2 = op2->ui;
6920 exp->string = PrintUInt(op1->ui += value2);
6923 exp->expType = op1->type;
6925 op1->type->refCount++;
6930 static unsigned int Int64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6932 int value2 = op2->i;
6935 exp->string = PrintInt64(op1->i += value2);
6938 exp->expType = op1->type;
6940 op1->type->refCount++;
6945 static unsigned int UInt64AddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6947 unsigned int value2 = op2->ui;
6950 exp->string = PrintUInt64(op1->ui += value2);
6953 exp->expType = op1->type;
6955 op1->type->refCount++;
6960 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6962 short value2 = op2->s;
6965 exp->string = PrintShort(op1->s += value2);
6968 exp->expType = op1->type;
6970 op1->type->refCount++;
6975 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6977 unsigned short value2 = op2->us;
6980 exp->string = PrintUShort(op1->us += value2);
6983 exp->expType = op1->type;
6985 op1->type->refCount++;
6990 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6992 char value2 = op2->c;
6995 exp->string = PrintChar(op1->c += value2);
6998 exp->expType = op1->type;
7000 op1->type->refCount++;
7005 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7007 unsigned char value2 = op2->uc;
7010 exp->string = PrintUChar(op1->uc += value2);
7013 exp->expType = op1->type;
7015 op1->type->refCount++;
7020 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7022 float value2 = op2->f;
7025 exp->string = PrintFloat(op1->f += value2);
7028 exp->expType = op1->type;
7030 op1->type->refCount++;
7035 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7037 double value2 = op2->d;
7040 exp->string = PrintDouble(op1->d += value2);
7043 exp->expType = op1->type;
7045 op1->type->refCount++;
7050 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7052 int value2 = op2->i;
7055 exp->string = PrintInt(op1->i -= value2);
7058 exp->expType = op1->type;
7060 op1->type->refCount++;
7065 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7067 unsigned int value2 = op2->ui;
7070 exp->string = PrintUInt(op1->ui -= value2);
7073 exp->expType = op1->type;
7075 op1->type->refCount++;
7080 static unsigned int Int64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7082 int value2 = op2->i;
7085 exp->string = PrintInt64(op1->i -= value2);
7088 exp->expType = op1->type;
7090 op1->type->refCount++;
7095 static unsigned int UInt64SubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7097 unsigned int value2 = op2->ui;
7100 exp->string = PrintUInt64(op1->ui -= value2);
7103 exp->expType = op1->type;
7105 op1->type->refCount++;
7110 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7112 short value2 = op2->s;
7115 exp->string = PrintShort(op1->s -= value2);
7118 exp->expType = op1->type;
7120 op1->type->refCount++;
7125 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7127 unsigned short value2 = op2->us;
7130 exp->string = PrintUShort(op1->us -= value2);
7133 exp->expType = op1->type;
7135 op1->type->refCount++;
7140 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7142 char value2 = op2->c;
7145 exp->string = PrintChar(op1->c -= value2);
7148 exp->expType = op1->type;
7150 op1->type->refCount++;
7155 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7157 unsigned char value2 = op2->uc;
7160 exp->string = PrintUChar(op1->uc -= value2);
7163 exp->expType = op1->type;
7165 op1->type->refCount++;
7170 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7172 float value2 = op2->f;
7175 exp->string = PrintFloat(op1->f -= value2);
7178 exp->expType = op1->type;
7180 op1->type->refCount++;
7185 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7187 double value2 = op2->d;
7190 exp->string = PrintDouble(op1->d -= value2);
7193 exp->expType = op1->type;
7195 op1->type->refCount++;
7200 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7202 int value2 = op2->i;
7205 exp->string = PrintInt(op1->i *= value2);
7208 exp->expType = op1->type;
7210 op1->type->refCount++;
7215 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7217 unsigned int value2 = op2->ui;
7220 exp->string = PrintUInt(op1->ui *= value2);
7223 exp->expType = op1->type;
7225 op1->type->refCount++;
7230 static unsigned int Int64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7232 int value2 = op2->i;
7235 exp->string = PrintInt64(op1->i *= value2);
7238 exp->expType = op1->type;
7240 op1->type->refCount++;
7245 static unsigned int UInt64MulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7247 unsigned int value2 = op2->ui;
7250 exp->string = PrintUInt64(op1->ui *= value2);
7253 exp->expType = op1->type;
7255 op1->type->refCount++;
7260 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7262 short value2 = op2->s;
7265 exp->string = PrintShort(op1->s *= value2);
7268 exp->expType = op1->type;
7270 op1->type->refCount++;
7275 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7277 unsigned short value2 = op2->us;
7280 exp->string = PrintUShort(op1->us *= value2);
7283 exp->expType = op1->type;
7285 op1->type->refCount++;
7290 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7292 char value2 = op2->c;
7295 exp->string = PrintChar(op1->c *= value2);
7298 exp->expType = op1->type;
7300 op1->type->refCount++;
7305 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7307 unsigned char value2 = op2->uc;
7310 exp->string = PrintUChar(op1->uc *= value2);
7313 exp->expType = op1->type;
7315 op1->type->refCount++;
7320 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7322 float value2 = op2->f;
7325 exp->string = PrintFloat(op1->f *= value2);
7328 exp->expType = op1->type;
7330 op1->type->refCount++;
7335 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7337 double value2 = op2->d;
7340 exp->string = PrintDouble(op1->d *= value2);
7343 exp->expType = op1->type;
7345 op1->type->refCount++;
7350 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7352 int value2 = op2->i;
7355 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
7358 exp->expType = op1->type;
7360 op1->type->refCount++;
7365 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7367 unsigned int value2 = op2->ui;
7370 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7373 exp->expType = op1->type;
7375 op1->type->refCount++;
7380 static unsigned int Int64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7382 int value2 = op2->i;
7385 exp->string = PrintInt64(value2 ? (op1->i /= value2) : 0);
7388 exp->expType = op1->type;
7390 op1->type->refCount++;
7395 static unsigned int UInt64DivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7397 unsigned int value2 = op2->ui;
7400 exp->string = PrintUInt64(value2 ? (op1->ui /= value2) : 0);
7403 exp->expType = op1->type;
7405 op1->type->refCount++;
7410 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7412 short value2 = op2->s;
7415 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7418 exp->expType = op1->type;
7420 op1->type->refCount++;
7425 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7427 unsigned short value2 = op2->us;
7430 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7433 exp->expType = op1->type;
7435 op1->type->refCount++;
7440 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7442 char value2 = op2->c;
7445 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7448 exp->expType = op1->type;
7450 op1->type->refCount++;
7455 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7457 unsigned char value2 = op2->uc;
7460 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7463 exp->expType = op1->type;
7465 op1->type->refCount++;
7470 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7472 float value2 = op2->f;
7475 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7478 exp->expType = op1->type;
7480 op1->type->refCount++;
7485 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7487 double value2 = op2->d;
7490 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7493 exp->expType = op1->type;
7495 op1->type->refCount++;
7500 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7502 int value2 = op2->i;
7505 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7508 exp->expType = op1->type;
7510 op1->type->refCount++;
7515 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7517 unsigned int value2 = op2->ui;
7520 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7523 exp->expType = op1->type;
7525 op1->type->refCount++;
7530 static unsigned int Int64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7532 int value2 = op2->i;
7535 exp->string = PrintInt64(value2 ? (op1->i %= value2) : 0);
7538 exp->expType = op1->type;
7540 op1->type->refCount++;
7545 static unsigned int UInt64ModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7547 unsigned int value2 = op2->ui;
7550 exp->string = PrintUInt64(value2 ? (op1->ui %= value2) : 0);
7553 exp->expType = op1->type;
7555 op1->type->refCount++;
7560 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7562 short value2 = op2->s;
7565 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7568 exp->expType = op1->type;
7570 op1->type->refCount++;
7575 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7577 unsigned short value2 = op2->us;
7580 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7583 exp->expType = op1->type;
7585 op1->type->refCount++;
7590 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7592 char value2 = op2->c;
7595 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7598 exp->expType = op1->type;
7600 op1->type->refCount++;
7605 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7607 unsigned char value2 = op2->uc;
7610 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7613 exp->expType = op1->type;
7615 op1->type->refCount++;
7620 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7622 int value2 = op2->i;
7625 exp->string = PrintInt(op1->i & value2);
7628 exp->expType = op1->type;
7630 op1->type->refCount++;
7635 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7637 unsigned int value2 = op2->ui;
7640 exp->string = PrintUInt(op1->ui & value2);
7643 exp->expType = op1->type;
7645 op1->type->refCount++;
7650 static unsigned int Int64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7652 int value2 = op2->i;
7655 exp->string = PrintInt64(op1->i & value2);
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int UInt64BitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7667 unsigned int value2 = op2->ui;
7670 exp->string = PrintUInt64(op1->ui & value2);
7673 exp->expType = op1->type;
7675 op1->type->refCount++;
7680 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7682 short value2 = op2->s;
7685 exp->string = PrintShort(op1->s & value2);
7688 exp->expType = op1->type;
7690 op1->type->refCount++;
7695 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7697 unsigned short value2 = op2->us;
7700 exp->string = PrintUShort(op1->us & value2);
7703 exp->expType = op1->type;
7705 op1->type->refCount++;
7710 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7712 char value2 = op2->c;
7715 exp->string = PrintChar(op1->c & value2);
7718 exp->expType = op1->type;
7720 op1->type->refCount++;
7725 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7727 unsigned char value2 = op2->uc;
7730 exp->string = PrintUChar(op1->uc & value2);
7733 exp->expType = op1->type;
7735 op1->type->refCount++;
7740 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7742 int value2 = op2->i;
7745 exp->string = PrintInt(op1->i | value2);
7748 exp->expType = op1->type;
7750 op1->type->refCount++;
7755 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7757 unsigned int value2 = op2->ui;
7760 exp->string = PrintUInt(op1->ui | value2);
7763 exp->expType = op1->type;
7765 op1->type->refCount++;
7770 static unsigned int Int64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7772 int value2 = op2->i;
7775 exp->string = PrintInt64(op1->i | value2);
7778 exp->expType = op1->type;
7780 op1->type->refCount++;
7785 static unsigned int UInt64BitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7787 unsigned int value2 = op2->ui;
7790 exp->string = PrintUInt64(op1->ui | value2);
7793 exp->expType = op1->type;
7795 op1->type->refCount++;
7800 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7802 short value2 = op2->s;
7805 exp->string = PrintShort(op1->s | value2);
7808 exp->expType = op1->type;
7810 op1->type->refCount++;
7815 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7817 unsigned short value2 = op2->us;
7820 exp->string = PrintUShort(op1->us | value2);
7823 exp->expType = op1->type;
7825 op1->type->refCount++;
7830 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7832 char value2 = op2->c;
7835 exp->string = PrintChar(op1->c | value2);
7838 exp->expType = op1->type;
7840 op1->type->refCount++;
7845 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7847 unsigned char value2 = op2->uc;
7850 exp->string = PrintUChar(op1->uc | value2);
7853 exp->expType = op1->type;
7855 op1->type->refCount++;
7860 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7862 int value2 = op2->i;
7865 exp->string = PrintInt(op1->i ^ value2);
7868 exp->expType = op1->type;
7870 op1->type->refCount++;
7875 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7877 unsigned int value2 = op2->ui;
7880 exp->string = PrintUInt(op1->ui ^ value2);
7883 exp->expType = op1->type;
7885 op1->type->refCount++;
7890 static unsigned int Int64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7892 int value2 = op2->i;
7895 exp->string = PrintInt64(op1->i ^ value2);
7898 exp->expType = op1->type;
7900 op1->type->refCount++;
7905 static unsigned int UInt64BitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7907 unsigned int value2 = op2->ui;
7910 exp->string = PrintUInt64(op1->ui ^ value2);
7913 exp->expType = op1->type;
7915 op1->type->refCount++;
7920 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7922 short value2 = op2->s;
7925 exp->string = PrintShort(op1->s ^ value2);
7928 exp->expType = op1->type;
7930 op1->type->refCount++;
7935 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7937 unsigned short value2 = op2->us;
7940 exp->string = PrintUShort(op1->us ^ value2);
7943 exp->expType = op1->type;
7945 op1->type->refCount++;
7950 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7952 char value2 = op2->c;
7955 exp->string = PrintChar(op1->c ^ value2);
7958 exp->expType = op1->type;
7960 op1->type->refCount++;
7965 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7967 unsigned char value2 = op2->uc;
7970 exp->string = PrintUChar(op1->uc ^ value2);
7973 exp->expType = op1->type;
7975 op1->type->refCount++;
7980 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7982 int value2 = op2->i;
7985 exp->string = PrintInt(op1->i << value2);
7988 exp->expType = op1->type;
7990 op1->type->refCount++;
7995 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7997 unsigned int value2 = op2->ui;
8000 exp->string = PrintUInt(op1->ui << value2);
8003 exp->expType = op1->type;
8005 op1->type->refCount++;
8010 static unsigned int Int64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8012 int value2 = op2->i;
8015 exp->string = PrintInt64(op1->i << value2);
8018 exp->expType = op1->type;
8020 op1->type->refCount++;
8025 static unsigned int UInt64LShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8027 unsigned int value2 = op2->ui;
8030 exp->string = PrintUInt64(op1->ui << value2);
8033 exp->expType = op1->type;
8035 op1->type->refCount++;
8040 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8042 short value2 = op2->s;
8045 exp->string = PrintShort(op1->s << value2);
8048 exp->expType = op1->type;
8050 op1->type->refCount++;
8055 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8057 unsigned short value2 = op2->us;
8060 exp->string = PrintUShort(op1->us << value2);
8063 exp->expType = op1->type;
8065 op1->type->refCount++;
8070 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8072 char value2 = op2->c;
8075 exp->string = PrintChar(op1->c << value2);
8078 exp->expType = op1->type;
8080 op1->type->refCount++;
8085 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8087 unsigned char value2 = op2->uc;
8090 exp->string = PrintUChar(op1->uc << value2);
8093 exp->expType = op1->type;
8095 op1->type->refCount++;
8100 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8102 int value2 = op2->i;
8105 exp->string = PrintInt(op1->i >> value2);
8108 exp->expType = op1->type;
8110 op1->type->refCount++;
8115 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8117 unsigned int value2 = op2->ui;
8120 exp->string = PrintUInt(op1->ui >> value2);
8123 exp->expType = op1->type;
8125 op1->type->refCount++;
8130 static unsigned int Int64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8132 int value2 = op2->i;
8135 exp->string = PrintInt64(op1->i >> value2);
8138 exp->expType = op1->type;
8140 op1->type->refCount++;
8145 static unsigned int UInt64RShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8147 unsigned int value2 = op2->ui;
8150 exp->string = PrintUInt64(op1->ui >> value2);
8153 exp->expType = op1->type;
8155 op1->type->refCount++;
8160 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8162 short value2 = op2->s;
8165 exp->string = PrintShort(op1->s >> value2);
8168 exp->expType = op1->type;
8170 op1->type->refCount++;
8175 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8177 unsigned short value2 = op2->us;
8180 exp->string = PrintUShort(op1->us >> value2);
8183 exp->expType = op1->type;
8185 op1->type->refCount++;
8190 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8192 char value2 = op2->c;
8195 exp->string = PrintChar(op1->c >> value2);
8198 exp->expType = op1->type;
8200 op1->type->refCount++;
8205 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8207 unsigned char value2 = op2->uc;
8210 exp->string = PrintUChar(op1->uc >> value2);
8213 exp->expType = op1->type;
8215 op1->type->refCount++;
8220 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
8223 exp->string = PrintInt((~op1->i));
8226 exp->expType = op1->type;
8228 op1->type->refCount++;
8233 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
8236 exp->string = PrintUInt((unsigned int)(~op1->ui));
8239 exp->expType = op1->type;
8241 op1->type->refCount++;
8246 static unsigned int Int64BitNot(struct Expression * exp, struct Operand * op1)
8249 exp->string = PrintInt64((~op1->i));
8252 exp->expType = op1->type;
8254 op1->type->refCount++;
8259 static unsigned int UInt64BitNot(struct Expression * exp, struct Operand * op1)
8262 exp->string = PrintUInt64((unsigned int)(~op1->ui));
8265 exp->expType = op1->type;
8267 op1->type->refCount++;
8272 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
8275 exp->string = PrintShort((short)(~op1->s));
8278 exp->expType = op1->type;
8280 op1->type->refCount++;
8285 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
8288 exp->string = PrintUShort((unsigned short)(~op1->us));
8291 exp->expType = op1->type;
8293 op1->type->refCount++;
8298 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
8301 exp->string = PrintChar((char)(~op1->c));
8304 exp->expType = op1->type;
8306 op1->type->refCount++;
8311 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
8314 exp->string = PrintUChar((unsigned char)(~op1->uc));
8317 exp->expType = op1->type;
8319 op1->type->refCount++;
8324 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8326 int value2 = op2->i;
8329 exp->string = PrintInt(op1->i &= value2);
8332 exp->expType = op1->type;
8334 op1->type->refCount++;
8339 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8341 unsigned int value2 = op2->ui;
8344 exp->string = PrintUInt(op1->ui &= value2);
8347 exp->expType = op1->type;
8349 op1->type->refCount++;
8354 static unsigned int Int64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8356 int value2 = op2->i;
8359 exp->string = PrintInt64(op1->i &= value2);
8362 exp->expType = op1->type;
8364 op1->type->refCount++;
8369 static unsigned int UInt64AndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8371 unsigned int value2 = op2->ui;
8374 exp->string = PrintUInt64(op1->ui &= value2);
8377 exp->expType = op1->type;
8379 op1->type->refCount++;
8384 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8386 short value2 = op2->s;
8389 exp->string = PrintShort(op1->s &= value2);
8392 exp->expType = op1->type;
8394 op1->type->refCount++;
8399 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8401 unsigned short value2 = op2->us;
8404 exp->string = PrintUShort(op1->us &= value2);
8407 exp->expType = op1->type;
8409 op1->type->refCount++;
8414 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8416 char value2 = op2->c;
8419 exp->string = PrintChar(op1->c &= value2);
8422 exp->expType = op1->type;
8424 op1->type->refCount++;
8429 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8431 unsigned char value2 = op2->uc;
8434 exp->string = PrintUChar(op1->uc &= value2);
8437 exp->expType = op1->type;
8439 op1->type->refCount++;
8444 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8446 int value2 = op2->i;
8449 exp->string = PrintInt(op1->i |= value2);
8452 exp->expType = op1->type;
8454 op1->type->refCount++;
8459 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8461 unsigned int value2 = op2->ui;
8464 exp->string = PrintUInt(op1->ui |= value2);
8467 exp->expType = op1->type;
8469 op1->type->refCount++;
8474 static unsigned int Int64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8476 int value2 = op2->i;
8479 exp->string = PrintInt64(op1->i |= value2);
8482 exp->expType = op1->type;
8484 op1->type->refCount++;
8489 static unsigned int UInt64OrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8491 unsigned int value2 = op2->ui;
8494 exp->string = PrintUInt64(op1->ui |= value2);
8497 exp->expType = op1->type;
8499 op1->type->refCount++;
8504 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8506 short value2 = op2->s;
8509 exp->string = PrintShort(op1->s |= value2);
8512 exp->expType = op1->type;
8514 op1->type->refCount++;
8519 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8521 unsigned short value2 = op2->us;
8524 exp->string = PrintUShort(op1->us |= value2);
8527 exp->expType = op1->type;
8529 op1->type->refCount++;
8534 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8536 char value2 = op2->c;
8539 exp->string = PrintChar(op1->c |= value2);
8542 exp->expType = op1->type;
8544 op1->type->refCount++;
8549 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8551 unsigned char value2 = op2->uc;
8554 exp->string = PrintUChar(op1->uc |= value2);
8557 exp->expType = op1->type;
8559 op1->type->refCount++;
8564 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8566 int value2 = op2->i;
8569 exp->string = PrintInt(op1->i ^= value2);
8572 exp->expType = op1->type;
8574 op1->type->refCount++;
8579 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8581 unsigned int value2 = op2->ui;
8584 exp->string = PrintUInt(op1->ui ^= value2);
8587 exp->expType = op1->type;
8589 op1->type->refCount++;
8594 static unsigned int Int64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8596 int value2 = op2->i;
8599 exp->string = PrintInt64(op1->i ^= value2);
8602 exp->expType = op1->type;
8604 op1->type->refCount++;
8609 static unsigned int UInt64XorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8611 unsigned int value2 = op2->ui;
8614 exp->string = PrintUInt64(op1->ui ^= value2);
8617 exp->expType = op1->type;
8619 op1->type->refCount++;
8624 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8626 short value2 = op2->s;
8629 exp->string = PrintShort(op1->s ^= value2);
8632 exp->expType = op1->type;
8634 op1->type->refCount++;
8639 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8641 unsigned short value2 = op2->us;
8644 exp->string = PrintUShort(op1->us ^= value2);
8647 exp->expType = op1->type;
8649 op1->type->refCount++;
8654 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8656 char value2 = op2->c;
8659 exp->string = PrintChar(op1->c ^= value2);
8662 exp->expType = op1->type;
8664 op1->type->refCount++;
8669 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8671 unsigned char value2 = op2->uc;
8674 exp->string = PrintUChar(op1->uc ^= value2);
8677 exp->expType = op1->type;
8679 op1->type->refCount++;
8684 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8686 int value2 = op2->i;
8689 exp->string = PrintInt(op1->i <<= value2);
8692 exp->expType = op1->type;
8694 op1->type->refCount++;
8699 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8701 unsigned int value2 = op2->ui;
8704 exp->string = PrintUInt(op1->ui <<= value2);
8707 exp->expType = op1->type;
8709 op1->type->refCount++;
8714 static unsigned int Int64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8716 int value2 = op2->i;
8719 exp->string = PrintInt64(op1->i <<= value2);
8722 exp->expType = op1->type;
8724 op1->type->refCount++;
8729 static unsigned int UInt64LShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8731 unsigned int value2 = op2->ui;
8734 exp->string = PrintUInt64(op1->ui <<= value2);
8737 exp->expType = op1->type;
8739 op1->type->refCount++;
8744 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8746 short value2 = op2->s;
8749 exp->string = PrintShort(op1->s <<= value2);
8752 exp->expType = op1->type;
8754 op1->type->refCount++;
8759 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8761 unsigned short value2 = op2->us;
8764 exp->string = PrintUShort(op1->us <<= value2);
8767 exp->expType = op1->type;
8769 op1->type->refCount++;
8774 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8776 char value2 = op2->c;
8779 exp->string = PrintChar(op1->c <<= value2);
8782 exp->expType = op1->type;
8784 op1->type->refCount++;
8789 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8791 unsigned char value2 = op2->uc;
8794 exp->string = PrintUChar(op1->uc <<= value2);
8797 exp->expType = op1->type;
8799 op1->type->refCount++;
8804 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8806 int value2 = op2->i;
8809 exp->string = PrintInt(op1->i >>= value2);
8812 exp->expType = op1->type;
8814 op1->type->refCount++;
8819 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8821 unsigned int value2 = op2->ui;
8824 exp->string = PrintUInt(op1->ui >>= value2);
8827 exp->expType = op1->type;
8829 op1->type->refCount++;
8834 static unsigned int Int64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8836 int value2 = op2->i;
8839 exp->string = PrintInt64(op1->i >>= value2);
8842 exp->expType = op1->type;
8844 op1->type->refCount++;
8849 static unsigned int UInt64RShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8851 unsigned int value2 = op2->ui;
8854 exp->string = PrintUInt64(op1->ui >>= value2);
8857 exp->expType = op1->type;
8859 op1->type->refCount++;
8864 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8866 short value2 = op2->s;
8869 exp->string = PrintShort(op1->s >>= value2);
8872 exp->expType = op1->type;
8874 op1->type->refCount++;
8879 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8881 unsigned short value2 = op2->us;
8884 exp->string = PrintUShort(op1->us >>= value2);
8887 exp->expType = op1->type;
8889 op1->type->refCount++;
8894 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8896 char value2 = op2->c;
8899 exp->string = PrintChar(op1->c >>= value2);
8902 exp->expType = op1->type;
8904 op1->type->refCount++;
8909 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8911 unsigned char value2 = op2->uc;
8914 exp->string = PrintUChar(op1->uc >>= value2);
8917 exp->expType = op1->type;
8919 op1->type->refCount++;
8924 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8927 exp->string = PrintInt((int)(!op1->i));
8930 exp->expType = op1->type;
8932 op1->type->refCount++;
8937 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8940 exp->string = PrintUInt((unsigned int)(!op1->ui));
8943 exp->expType = op1->type;
8945 op1->type->refCount++;
8950 static unsigned int Int64Not(struct Expression * exp, struct Operand * op1)
8953 exp->string = PrintInt64((int)(!op1->i));
8956 exp->expType = op1->type;
8958 op1->type->refCount++;
8963 static unsigned int UInt64Not(struct Expression * exp, struct Operand * op1)
8966 exp->string = PrintUInt64((unsigned int)(!op1->ui));
8969 exp->expType = op1->type;
8971 op1->type->refCount++;
8976 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8979 exp->string = PrintShort((short)(!op1->s));
8982 exp->expType = op1->type;
8984 op1->type->refCount++;
8989 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8992 exp->string = PrintUShort((unsigned short)(!op1->us));
8995 exp->expType = op1->type;
8997 op1->type->refCount++;
9002 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
9005 exp->string = PrintChar((char)(!op1->c));
9008 exp->expType = op1->type;
9010 op1->type->refCount++;
9015 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
9018 exp->string = PrintUChar((unsigned char)(!op1->uc));
9021 exp->expType = op1->type;
9023 op1->type->refCount++;
9028 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9030 int value2 = op2->i;
9033 exp->string = PrintInt(op1->i == value2);
9036 exp->expType = op1->type;
9038 op1->type->refCount++;
9043 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9045 unsigned int value2 = op2->ui;
9048 exp->string = PrintUInt(op1->ui == value2);
9051 exp->expType = op1->type;
9053 op1->type->refCount++;
9058 static unsigned int Int64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9060 int value2 = op2->i;
9063 exp->string = PrintInt64(op1->i == value2);
9066 exp->expType = op1->type;
9068 op1->type->refCount++;
9073 static unsigned int UInt64Equ(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9075 unsigned int value2 = op2->ui;
9078 exp->string = PrintUInt64(op1->ui == value2);
9081 exp->expType = op1->type;
9083 op1->type->refCount++;
9088 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9090 short value2 = op2->s;
9093 exp->string = PrintShort(op1->s == value2);
9096 exp->expType = op1->type;
9098 op1->type->refCount++;
9103 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9105 unsigned short value2 = op2->us;
9108 exp->string = PrintUShort(op1->us == value2);
9111 exp->expType = op1->type;
9113 op1->type->refCount++;
9118 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9120 char value2 = op2->c;
9123 exp->string = PrintChar(op1->c == value2);
9126 exp->expType = op1->type;
9128 op1->type->refCount++;
9133 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9135 unsigned char value2 = op2->uc;
9138 exp->string = PrintUChar(op1->uc == value2);
9141 exp->expType = op1->type;
9143 op1->type->refCount++;
9148 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9150 float value2 = op2->f;
9153 exp->string = PrintFloat(op1->f == value2);
9156 exp->expType = op1->type;
9158 op1->type->refCount++;
9163 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9165 double value2 = op2->d;
9168 exp->string = PrintDouble(op1->d == value2);
9171 exp->expType = op1->type;
9173 op1->type->refCount++;
9178 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9180 int value2 = op2->i;
9183 exp->string = PrintInt(op1->i != value2);
9186 exp->expType = op1->type;
9188 op1->type->refCount++;
9193 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9195 unsigned int value2 = op2->ui;
9198 exp->string = PrintUInt(op1->ui != value2);
9201 exp->expType = op1->type;
9203 op1->type->refCount++;
9208 static unsigned int Int64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9210 int value2 = op2->i;
9213 exp->string = PrintInt64(op1->i != value2);
9216 exp->expType = op1->type;
9218 op1->type->refCount++;
9223 static unsigned int UInt64Nqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9225 unsigned int value2 = op2->ui;
9228 exp->string = PrintUInt64(op1->ui != value2);
9231 exp->expType = op1->type;
9233 op1->type->refCount++;
9238 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9240 short value2 = op2->s;
9243 exp->string = PrintShort(op1->s != value2);
9246 exp->expType = op1->type;
9248 op1->type->refCount++;
9253 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9255 unsigned short value2 = op2->us;
9258 exp->string = PrintUShort(op1->us != value2);
9261 exp->expType = op1->type;
9263 op1->type->refCount++;
9268 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9270 char value2 = op2->c;
9273 exp->string = PrintChar(op1->c != value2);
9276 exp->expType = op1->type;
9278 op1->type->refCount++;
9283 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9285 unsigned char value2 = op2->uc;
9288 exp->string = PrintUChar(op1->uc != value2);
9291 exp->expType = op1->type;
9293 op1->type->refCount++;
9298 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9300 float value2 = op2->f;
9303 exp->string = PrintFloat(op1->f != value2);
9306 exp->expType = op1->type;
9308 op1->type->refCount++;
9313 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9315 double value2 = op2->d;
9318 exp->string = PrintDouble(op1->d != value2);
9321 exp->expType = op1->type;
9323 op1->type->refCount++;
9328 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9330 int value2 = op2->i;
9333 exp->string = PrintInt(op1->i && value2);
9336 exp->expType = op1->type;
9338 op1->type->refCount++;
9343 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9345 unsigned int value2 = op2->ui;
9348 exp->string = PrintUInt(op1->ui && value2);
9351 exp->expType = op1->type;
9353 op1->type->refCount++;
9358 static unsigned int Int64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9360 int value2 = op2->i;
9363 exp->string = PrintInt64(op1->i && value2);
9366 exp->expType = op1->type;
9368 op1->type->refCount++;
9373 static unsigned int UInt64And(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9375 unsigned int value2 = op2->ui;
9378 exp->string = PrintUInt64(op1->ui && value2);
9381 exp->expType = op1->type;
9383 op1->type->refCount++;
9388 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9390 short value2 = op2->s;
9393 exp->string = PrintShort(op1->s && value2);
9396 exp->expType = op1->type;
9398 op1->type->refCount++;
9403 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9405 unsigned short value2 = op2->us;
9408 exp->string = PrintUShort(op1->us && value2);
9411 exp->expType = op1->type;
9413 op1->type->refCount++;
9418 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9420 char value2 = op2->c;
9423 exp->string = PrintChar(op1->c && value2);
9426 exp->expType = op1->type;
9428 op1->type->refCount++;
9433 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9435 unsigned char value2 = op2->uc;
9438 exp->string = PrintUChar(op1->uc && value2);
9441 exp->expType = op1->type;
9443 op1->type->refCount++;
9448 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9450 float value2 = op2->f;
9453 exp->string = PrintFloat(op1->f && value2);
9456 exp->expType = op1->type;
9458 op1->type->refCount++;
9463 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9465 double value2 = op2->d;
9468 exp->string = PrintDouble(op1->d && value2);
9471 exp->expType = op1->type;
9473 op1->type->refCount++;
9478 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9480 int value2 = op2->i;
9483 exp->string = PrintInt(op1->i || value2);
9486 exp->expType = op1->type;
9488 op1->type->refCount++;
9493 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9495 unsigned int value2 = op2->ui;
9498 exp->string = PrintUInt(op1->ui || value2);
9501 exp->expType = op1->type;
9503 op1->type->refCount++;
9508 static unsigned int Int64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9510 int value2 = op2->i;
9513 exp->string = PrintInt64(op1->i || value2);
9516 exp->expType = op1->type;
9518 op1->type->refCount++;
9523 static unsigned int UInt64Or(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9525 unsigned int value2 = op2->ui;
9528 exp->string = PrintUInt64(op1->ui || value2);
9531 exp->expType = op1->type;
9533 op1->type->refCount++;
9538 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9540 short value2 = op2->s;
9543 exp->string = PrintShort(op1->s || value2);
9546 exp->expType = op1->type;
9548 op1->type->refCount++;
9553 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9555 unsigned short value2 = op2->us;
9558 exp->string = PrintUShort(op1->us || value2);
9561 exp->expType = op1->type;
9563 op1->type->refCount++;
9568 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9570 char value2 = op2->c;
9573 exp->string = PrintChar(op1->c || value2);
9576 exp->expType = op1->type;
9578 op1->type->refCount++;
9583 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9585 unsigned char value2 = op2->uc;
9588 exp->string = PrintUChar(op1->uc || value2);
9591 exp->expType = op1->type;
9593 op1->type->refCount++;
9598 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9600 float value2 = op2->f;
9603 exp->string = PrintFloat(op1->f || value2);
9606 exp->expType = op1->type;
9608 op1->type->refCount++;
9613 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9615 double value2 = op2->d;
9618 exp->string = PrintDouble(op1->d || value2);
9621 exp->expType = op1->type;
9623 op1->type->refCount++;
9628 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9630 int value2 = op2->i;
9633 exp->string = PrintInt(op1->i > value2);
9636 exp->expType = op1->type;
9638 op1->type->refCount++;
9643 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9645 unsigned int value2 = op2->ui;
9648 exp->string = PrintUInt(op1->ui > value2);
9651 exp->expType = op1->type;
9653 op1->type->refCount++;
9658 static unsigned int Int64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9660 int value2 = op2->i;
9663 exp->string = PrintInt64(op1->i > value2);
9666 exp->expType = op1->type;
9668 op1->type->refCount++;
9673 static unsigned int UInt64Grt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9675 unsigned int value2 = op2->ui;
9678 exp->string = PrintUInt64(op1->ui > value2);
9681 exp->expType = op1->type;
9683 op1->type->refCount++;
9688 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9690 short value2 = op2->s;
9693 exp->string = PrintShort(op1->s > value2);
9696 exp->expType = op1->type;
9698 op1->type->refCount++;
9703 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9705 unsigned short value2 = op2->us;
9708 exp->string = PrintUShort(op1->us > value2);
9711 exp->expType = op1->type;
9713 op1->type->refCount++;
9718 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9720 char value2 = op2->c;
9723 exp->string = PrintChar(op1->c > value2);
9726 exp->expType = op1->type;
9728 op1->type->refCount++;
9733 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9735 unsigned char value2 = op2->uc;
9738 exp->string = PrintUChar(op1->uc > value2);
9741 exp->expType = op1->type;
9743 op1->type->refCount++;
9748 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9750 float value2 = op2->f;
9753 exp->string = PrintFloat(op1->f > value2);
9756 exp->expType = op1->type;
9758 op1->type->refCount++;
9763 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9765 double value2 = op2->d;
9768 exp->string = PrintDouble(op1->d > value2);
9771 exp->expType = op1->type;
9773 op1->type->refCount++;
9778 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9780 int value2 = op2->i;
9783 exp->string = PrintInt(op1->i < value2);
9786 exp->expType = op1->type;
9788 op1->type->refCount++;
9793 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9795 unsigned int value2 = op2->ui;
9798 exp->string = PrintUInt(op1->ui < value2);
9801 exp->expType = op1->type;
9803 op1->type->refCount++;
9808 static unsigned int Int64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9810 int value2 = op2->i;
9813 exp->string = PrintInt64(op1->i < value2);
9816 exp->expType = op1->type;
9818 op1->type->refCount++;
9823 static unsigned int UInt64Sma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9825 unsigned int value2 = op2->ui;
9828 exp->string = PrintUInt64(op1->ui < value2);
9831 exp->expType = op1->type;
9833 op1->type->refCount++;
9838 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9840 short value2 = op2->s;
9843 exp->string = PrintShort(op1->s < value2);
9846 exp->expType = op1->type;
9848 op1->type->refCount++;
9853 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9855 unsigned short value2 = op2->us;
9858 exp->string = PrintUShort(op1->us < value2);
9861 exp->expType = op1->type;
9863 op1->type->refCount++;
9868 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9870 char value2 = op2->c;
9873 exp->string = PrintChar(op1->c < value2);
9876 exp->expType = op1->type;
9878 op1->type->refCount++;
9883 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9885 unsigned char value2 = op2->uc;
9888 exp->string = PrintUChar(op1->uc < value2);
9891 exp->expType = op1->type;
9893 op1->type->refCount++;
9898 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9900 float value2 = op2->f;
9903 exp->string = PrintFloat(op1->f < value2);
9906 exp->expType = op1->type;
9908 op1->type->refCount++;
9913 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9915 double value2 = op2->d;
9918 exp->string = PrintDouble(op1->d < value2);
9921 exp->expType = op1->type;
9923 op1->type->refCount++;
9928 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9930 int value2 = op2->i;
9933 exp->string = PrintInt(op1->i >= value2);
9936 exp->expType = op1->type;
9938 op1->type->refCount++;
9943 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9945 unsigned int value2 = op2->ui;
9948 exp->string = PrintUInt(op1->ui >= value2);
9951 exp->expType = op1->type;
9953 op1->type->refCount++;
9958 static unsigned int Int64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9960 int value2 = op2->i;
9963 exp->string = PrintInt64(op1->i >= value2);
9966 exp->expType = op1->type;
9968 op1->type->refCount++;
9973 static unsigned int UInt64GrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9975 unsigned int value2 = op2->ui;
9978 exp->string = PrintUInt64(op1->ui >= value2);
9981 exp->expType = op1->type;
9983 op1->type->refCount++;
9988 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9990 short value2 = op2->s;
9993 exp->string = PrintShort(op1->s >= value2);
9996 exp->expType = op1->type;
9998 op1->type->refCount++;
10003 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10005 unsigned short value2 = op2->us;
10008 exp->string = PrintUShort(op1->us >= value2);
10011 exp->expType = op1->type;
10013 op1->type->refCount++;
10018 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10020 char value2 = op2->c;
10023 exp->string = PrintChar(op1->c >= value2);
10026 exp->expType = op1->type;
10028 op1->type->refCount++;
10033 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10035 unsigned char value2 = op2->uc;
10038 exp->string = PrintUChar(op1->uc >= value2);
10041 exp->expType = op1->type;
10043 op1->type->refCount++;
10048 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10050 float value2 = op2->f;
10053 exp->string = PrintFloat(op1->f >= value2);
10056 exp->expType = op1->type;
10058 op1->type->refCount++;
10063 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10065 double value2 = op2->d;
10068 exp->string = PrintDouble(op1->d >= value2);
10071 exp->expType = op1->type;
10073 op1->type->refCount++;
10078 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10080 int value2 = op2->i;
10083 exp->string = PrintInt(op1->i <= value2);
10086 exp->expType = op1->type;
10088 op1->type->refCount++;
10093 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10095 unsigned int value2 = op2->ui;
10098 exp->string = PrintUInt(op1->ui <= value2);
10101 exp->expType = op1->type;
10103 op1->type->refCount++;
10108 static unsigned int Int64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10110 int value2 = op2->i;
10113 exp->string = PrintInt64(op1->i <= value2);
10116 exp->expType = op1->type;
10118 op1->type->refCount++;
10123 static unsigned int UInt64SmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10125 unsigned int value2 = op2->ui;
10128 exp->string = PrintUInt64(op1->ui <= value2);
10131 exp->expType = op1->type;
10133 op1->type->refCount++;
10138 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10140 short value2 = op2->s;
10143 exp->string = PrintShort(op1->s <= value2);
10146 exp->expType = op1->type;
10148 op1->type->refCount++;
10153 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10155 unsigned short value2 = op2->us;
10158 exp->string = PrintUShort(op1->us <= value2);
10161 exp->expType = op1->type;
10163 op1->type->refCount++;
10168 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10170 char value2 = op2->c;
10173 exp->string = PrintChar(op1->c <= value2);
10176 exp->expType = op1->type;
10178 op1->type->refCount++;
10183 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10185 unsigned char value2 = op2->uc;
10188 exp->string = PrintUChar(op1->uc <= value2);
10191 exp->expType = op1->type;
10193 op1->type->refCount++;
10198 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10200 float value2 = op2->f;
10203 exp->string = PrintFloat(op1->f <= value2);
10206 exp->expType = op1->type;
10208 op1->type->refCount++;
10213 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
10215 double value2 = op2->d;
10218 exp->string = PrintDouble(op1->d <= value2);
10221 exp->expType = op1->type;
10223 op1->type->refCount++;
10228 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10231 exp->string = PrintInt(op1->i ? op2->i : op3->i);
10234 exp->expType = op1->type;
10236 op1->type->refCount++;
10241 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10244 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
10247 exp->expType = op1->type;
10249 op1->type->refCount++;
10254 static unsigned int Int64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10257 exp->string = PrintInt64(op1->i ? op2->i : op3->i);
10260 exp->expType = op1->type;
10262 op1->type->refCount++;
10267 static unsigned int UInt64Cond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10270 exp->string = PrintUInt64(op1->ui ? op2->ui : op3->ui);
10273 exp->expType = op1->type;
10275 op1->type->refCount++;
10280 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10283 exp->string = PrintShort(op1->s ? op2->s : op3->s);
10286 exp->expType = op1->type;
10288 op1->type->refCount++;
10293 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10296 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
10299 exp->expType = op1->type;
10301 op1->type->refCount++;
10306 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10309 exp->string = PrintChar(op1->c ? op2->c : op3->c);
10312 exp->expType = op1->type;
10314 op1->type->refCount++;
10319 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10322 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
10325 exp->expType = op1->type;
10327 op1->type->refCount++;
10332 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10335 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
10338 exp->expType = op1->type;
10340 op1->type->refCount++;
10345 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
10348 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
10351 exp->expType = op1->type;
10353 op1->type->refCount++;
10358 struct OpTable intOps =
10360 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
10363 struct OpTable uintOps =
10365 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
10368 struct OpTable int64Ops =
10370 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
10373 struct OpTable uint64Ops =
10375 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
10378 struct OpTable shortOps =
10380 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
10383 struct OpTable ushortOps =
10385 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
10388 struct OpTable floatOps =
10390 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
10393 struct OpTable doubleOps =
10395 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
10398 struct OpTable charOps =
10400 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
10403 struct OpTable ucharOps =
10405 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
10408 void ReadString(char * output, char * string)
10410 int len = strlen(string);
10412 unsigned int quoted = 0x0, escaped = 0x0;
10414 for(c = 0; c < len; c++)
10416 char ch = string[c];
10450 output[d++] = '\\';
10472 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
10474 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
10476 extern double strtod(char * , char * * );
10478 struct Operand GetOperand(struct Expression * exp)
10480 struct Operand op =
10484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10487 struct Type * type = exp->expType;
10491 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
10493 if(!type->_class->registered->dataType)
10494 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10495 type = type->_class->registered->dataType;
10497 op.kind = type->kind;
10498 op.type = exp->expType;
10499 if(exp->isConstant && exp->type == 2)
10506 if(exp->constant[0] == '\'')
10507 op.c = exp->constant[1];
10508 else if(type->isSigned)
10510 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
10515 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
10523 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
10528 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
10529 op.ops = ushortOps;
10536 op.i = strtol(exp->constant, (((void *)0)), 0);
10541 op.ui = strtoul(exp->constant, (((void *)0)), 0);
10549 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10554 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10562 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10567 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10568 op.ops = uint64Ops;
10575 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
10580 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10581 op.ops = uint64Ops;
10586 op.f = (float)strtod(exp->constant, (((void *)0)));
10590 op.d = (double)strtod(exp->constant, (((void *)0)));
10591 op.ops = doubleOps;
10596 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
10606 int __ecereVMethodID_class_OnGetString;
10608 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
10610 static void UnusedFunction()
10614 ((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);
10617 extern int __ecereVMethodID_class_OnGetString;
10619 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
10621 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10623 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
10625 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10626 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
10629 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10630 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10631 struct Type * type;
10632 void * ptr = inst->data + dataMember->offset + offset;
10633 char * result = (((void *)0));
10635 exp->loc = member->loc = inst->loc;
10636 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10637 if(!dataMember->dataType)
10638 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10639 type = dataMember->dataType;
10640 if(type->kind == 8)
10642 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10644 if(_class->type == 4)
10646 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10650 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10651 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10653 for(item = e->values.first; item; item = item->next)
10655 if((int)item->data == *(int *)ptr)
10657 result = item->name;
10663 exp->identifier = MkIdentifier(result);
10665 exp->destType = MkClassType(_class->fullName);
10666 ProcessExpressionType(exp);
10670 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10672 if(!_class->dataType)
10673 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10674 type = _class->dataType;
10683 FreeExpContents(exp);
10684 exp->constant = PrintFloat(*(float *)ptr);
10690 FreeExpContents(exp);
10691 exp->constant = PrintDouble(*(double *)ptr);
10697 FreeExpContents(exp);
10698 exp->constant = PrintInt(*(int *)ptr);
10704 FreeExpContents(exp);
10705 exp->constant = PrintInt64(*(long long *)ptr);
10711 FreeExpContents(exp);
10712 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10718 FreeExpContents(exp);
10719 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10727 ListAdd(memberList, member);
10729 if(parentDataMember->type == 1)
10734 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
10736 void PopulateInstance(struct Instantiation * inst)
10738 struct Symbol * classSym = inst->_class->symbol;
10739 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
10740 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
10741 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
10744 inst->members = MkListOne(MkMembersInitList(memberList));
10746 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
10747 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
10749 if(!dataMember->isProperty)
10751 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
10752 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
10755 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
10756 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
10757 struct Type * type;
10758 void * ptr = inst->data + dataMember->offset;
10759 char * result = (((void *)0));
10761 exp->loc = member->loc = inst->loc;
10762 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
10763 if(!dataMember->dataType)
10764 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10765 type = dataMember->dataType;
10766 if(type->kind == 8)
10768 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10770 if(_class->type == 4)
10772 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
10776 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
10777 struct __ecereNameSpace__ecere__sys__NamedLink * item;
10779 for(item = e->values.first; item; item = item->next)
10781 if((int)item->data == *(int *)ptr)
10783 result = item->name;
10790 exp->identifier = MkIdentifier(result);
10792 exp->destType = MkClassType(_class->fullName);
10793 ProcessExpressionType(exp);
10796 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
10798 if(!_class->dataType)
10799 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10800 type = _class->dataType;
10809 exp->constant = PrintFloat(*(float *)ptr);
10815 exp->constant = PrintDouble(*(double *)ptr);
10821 exp->constant = PrintInt(*(int *)ptr);
10827 exp->constant = PrintInt64(*(long long *)ptr);
10833 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
10838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
10841 ListAdd(memberList, member);
10847 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);
10849 extern void FreeInstance(struct Instantiation * inst);
10851 void ComputeInstantiation(struct Expression * exp)
10853 struct Instantiation * inst = exp->instance;
10854 struct MembersInit * members;
10855 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
10856 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
10857 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
10858 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
10859 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
10860 int subMemberStackPos = 0;
10863 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
10867 if(_class->type == 0 || _class->type == 5)
10869 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
10870 if(_class->type == 0)
10871 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)inst->data))->_refCount++;
10874 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10878 for(members = (*inst->members).first; members; members = members->next)
10880 switch(members->type)
10884 if(members->dataMembers)
10886 struct MemberInit * member;
10888 for(member = (*members->dataMembers).first; member; member = member->next)
10890 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
10891 unsigned int found = 0x0;
10892 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10893 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
10894 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
10895 unsigned int dataMemberOffset;
10899 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
10902 if(curMember->isProperty)
10903 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
10906 dataMember = curMember;
10907 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10908 if(_class->type == 0)
10909 dataMemberOffset += _class->base->structSize;
10916 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
10920 if(prop->memberAccess == 1)
10922 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
10923 curClass = prop->_class;
10928 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
10929 int _subMemberStackPos = 0;
10931 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
10935 if(dataMember->memberAccess == 1)
10937 curMember = dataMember;
10938 curClass = dataMember->_class;
10939 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
10940 subMemberStackPos = _subMemberStackPos;
10945 if(found && member->initializer && member->initializer->type == 0)
10947 struct Expression * value = member->initializer->exp;
10948 struct Type * type = (((void *)0));
10949 unsigned int deepMember = 0x0;
10953 type = prop->dataType;
10955 else if(dataMember)
10957 if(!dataMember->dataType)
10958 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
10959 type = dataMember->dataType;
10961 if(ident && ident->next)
10964 for(ident = ident->next; ident && type; ident = ident->next)
10966 if(type->kind == 8)
10968 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
10970 type = prop->dataType;
10973 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
10975 type = dataMember->dataType;
10978 else if(type->kind == 9 || type->kind == 10)
10980 struct Type * memberType;
10982 for(memberType = type->members.first; memberType; memberType = memberType->next)
10984 if(!strcmp(memberType->name, ident->string))
10995 FreeType(value->destType);
10996 value->destType = type;
10999 ComputeExpression(value);
11001 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
11003 if(type->kind == 8)
11005 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11007 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
11009 if(!_class->dataType)
11010 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11011 type = _class->dataType;
11016 void * ptr = inst->data + dataMemberOffset;
11018 if(value->type == 2)
11024 GetInt(value, (int *)ptr);
11029 GetInt64(value, (long long *)ptr);
11034 GetIntPtr(value, (intptr_t *)ptr);
11039 GetIntSize(value, (ssize_t *)ptr);
11044 GetFloat(value, (float *)ptr);
11049 GetDouble(value, (double *)ptr);
11054 else if(value->type == 1)
11056 if(type->kind == 8)
11058 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11060 if(_class->type == 1)
11062 ComputeTypeSize(type);
11063 if(value->instance->data)
11064 memcpy(ptr, value->instance->data, type->size);
11071 if(value->type == 1 && value->instance->data)
11073 if(type->kind == 8)
11075 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11077 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)))
11079 void (* Set)(void *, void *) = (void *)prop->Set;
11081 Set(inst->data, value->instance->data);
11082 PopulateInstance(inst);
11086 else if(value->type == 2)
11092 void (* Set)(void *, double) = (void *)prop->Set;
11094 Set(inst->data, strtod(value->constant, (((void *)0))));
11099 void (* Set)(void *, float) = (void *)prop->Set;
11101 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
11106 void (* Set)(void *, int) = (void *)prop->Set;
11108 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
11113 void (* Set)(void *, long long) = (void *)prop->Set;
11115 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11120 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11122 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11127 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11129 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
11134 else if(value->type == 3)
11138 ReadString(temp, value->string);
11139 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
11143 else if(!deepMember && type && _class->type == 3)
11147 if(value->type == 2)
11149 if(type->kind == 8)
11151 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11153 if(_class->type == 3)
11155 if(!_class->dataType)
11156 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11157 type = _class->dataType;
11165 float (* Set)(float) = (void *)prop->Set;
11167 GetFloat(member->initializer->exp, &fValue);
11168 exp->constant = PrintFloat(Set(fValue));
11175 double (* Set)(double) = (void *)prop->Set;
11177 GetDouble(member->initializer->exp, &dValue);
11178 exp->constant = PrintDouble(Set(dValue));
11186 else if(!deepMember && type && _class->type == 2)
11190 if(value->type == 1 && value->instance->data)
11192 unsigned int (* Set)(void *) = (void *)prop->Set;
11194 bits = Set(value->instance->data);
11196 else if(value->type == 2)
11200 else if(dataMember)
11202 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
11203 struct Type * type;
11206 GetInt(value, &part);
11207 bits = (bits & ~bitMember->mask);
11208 if(!bitMember->dataType)
11209 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
11210 type = bitMember->dataType;
11211 if(type->kind == 8 && type->_class && type->_class->registered)
11213 if(!type->_class->registered->dataType)
11214 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11215 type = type->_class->registered->dataType;
11222 bits |= ((char)part << bitMember->pos);
11224 bits |= ((unsigned char)part << bitMember->pos);
11228 bits |= ((short)part << bitMember->pos);
11230 bits |= ((unsigned short)part << bitMember->pos);
11235 bits |= (part << bitMember->pos);
11237 bits |= ((unsigned int)part << bitMember->pos);
11241 bits |= ((long long)part << bitMember->pos);
11243 bits |= ((uint64)part << bitMember->pos);
11248 bits |= ((intptr_t)part << bitMember->pos);
11252 bits |= ((uintptr_t)part << bitMember->pos);
11258 bits |= ((ssize_t)part << bitMember->pos);
11262 bits |= ((size_t)part << bitMember->pos);
11271 if(_class && _class->type == 3)
11273 ComputeExpression(member->initializer->exp);
11274 exp->constant = member->initializer->exp->constant;
11276 member->initializer->exp->constant = (((void *)0));
11286 if(_class && _class->type == 2)
11288 exp->constant = PrintHexUInt(bits);
11293 FreeInstance(inst);
11297 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
11299 if(exp->op.op == SIZEOF)
11301 FreeExpContents(exp);
11303 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
11313 struct Expression * exp2 = exp->op.exp2;
11315 exp->op.exp2 = (((void *)0));
11316 FreeExpContents(exp);
11317 FreeType(exp->expType);
11318 FreeType(exp->destType);
11320 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
11326 FreeExpContents(exp);
11327 op1->ops.Neg(exp, op1);
11331 if(op1->ops.BitNot)
11333 FreeExpContents(exp);
11334 op1->ops.BitNot(exp, op1);
11340 FreeExpContents(exp);
11341 op1->ops.Not(exp, op1);
11353 FreeExpContents(exp);
11354 op1->ops.Add(exp, op1, op2);
11360 FreeExpContents(exp);
11361 op1->ops.Sub(exp, op1, op2);
11367 FreeExpContents(exp);
11368 op1->ops.Mul(exp, op1, op2);
11374 FreeExpContents(exp);
11375 op1->ops.Div(exp, op1, op2);
11381 FreeExpContents(exp);
11382 op1->ops.Mod(exp, op1, op2);
11388 if(op1->ops.BitAnd)
11390 FreeExpContents(exp);
11391 op1->ops.BitAnd(exp, op1, op2);
11398 FreeExpContents(exp);
11399 op1->ops.BitOr(exp, op1, op2);
11403 if(op1->ops.BitXor)
11405 FreeExpContents(exp);
11406 op1->ops.BitXor(exp, op1, op2);
11410 if(op1->ops.LShift)
11412 FreeExpContents(exp);
11413 op1->ops.LShift(exp, op1, op2);
11417 if(op1->ops.RShift)
11419 FreeExpContents(exp);
11420 op1->ops.RShift(exp, op1, op2);
11426 FreeExpContents(exp);
11427 op1->ops.Equ(exp, op1, op2);
11433 FreeExpContents(exp);
11434 op1->ops.Nqu(exp, op1, op2);
11440 FreeExpContents(exp);
11441 op1->ops.And(exp, op1, op2);
11447 FreeExpContents(exp);
11448 op1->ops.Or(exp, op1, op2);
11454 FreeExpContents(exp);
11455 op1->ops.Grt(exp, op1, op2);
11461 FreeExpContents(exp);
11462 op1->ops.Sma(exp, op1, op2);
11466 if(op1->ops.GrtEqu)
11468 FreeExpContents(exp);
11469 op1->ops.GrtEqu(exp, op1, op2);
11473 if(op1->ops.SmaEqu)
11475 FreeExpContents(exp);
11476 op1->ops.SmaEqu(exp, op1, op2);
11484 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
11486 extern struct Expression * MkExpIdentifier(struct Identifier * id);
11488 void ComputeExpression(struct Expression * exp)
11490 char expString[10240];
11492 expString[0] = '\0';
11497 ComputeInstantiation(exp);
11502 struct Expression * exp1, * exp2 = (((void *)0));
11503 struct Operand op1 =
11507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11510 struct Operand op2 =
11514 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11519 ComputeExpression(exp->op.exp2);
11522 ComputeExpression(exp->op.exp1);
11523 exp1 = exp->op.exp1;
11524 exp2 = exp->op.exp2;
11525 op1 = GetOperand(exp1);
11527 op1.type->refCount++;
11530 op2 = GetOperand(exp2);
11532 op2.type->refCount++;
11537 exp1 = exp->op.exp2;
11538 op1 = GetOperand(exp1);
11540 op1.type->refCount++;
11542 CallOperator(exp, exp1, exp2, &op1, &op2);
11544 FreeType(op1.type);
11546 FreeType(op2.type);
11552 struct Expression * e, * n;
11554 for(e = (*exp->list).first; e; e = n)
11559 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
11561 ComputeExpression(e);
11562 FreeType(exp->expType);
11563 FreeType(exp->destType);
11565 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
11566 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
11577 struct Expression * memberExp = exp->member.exp;
11578 struct Identifier * memberID = exp->member.member;
11579 struct Type * type;
11581 ComputeExpression(exp->member.exp);
11582 type = exp->member.exp->expType;
11585 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)));
11586 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11587 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11588 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
11590 if(type->kind == 19 && exp->member.exp->type == 26)
11591 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
11595 struct Symbol * classSym;
11598 PrintTypeNoConst(type, string, 0x0, 0x1);
11599 classSym = FindClass(string);
11600 _class = classSym ? classSym->registered : (((void *)0));
11602 if(exp->member.member)
11604 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
11606 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
11608 if(!prop && !member && _class && exp->member.member)
11610 struct Symbol * classSym = FindClass(exp->member.member->string);
11612 convertTo = _class;
11613 _class = classSym ? classSym->registered : (((void *)0));
11614 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
11620 struct Type * type = prop->dataType;
11622 if(_class->type == 3)
11624 if(type->kind == 8)
11626 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11628 if(_class->type == 3)
11630 if(!_class->dataType)
11631 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11632 type = _class->dataType;
11640 float (* Get)(float) = (void *)prop->Get;
11642 GetFloat(exp->member.exp, &value);
11643 exp->constant = PrintFloat(Get ? Get(value) : value);
11650 double (* Get)(double);
11652 GetDouble(exp->member.exp, &value);
11654 Get = (void *)prop->Set;
11656 Get = (void *)prop->Get;
11657 exp->constant = PrintDouble(Get ? Get(value) : value);
11667 struct Expression * value = exp->member.exp;
11668 struct Type * type;
11670 if(!prop->dataType)
11671 ProcessPropertyType(prop);
11672 type = prop->dataType;
11676 else if(_class->type == 1)
11682 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11684 if(propertyClass->type == 1 && value->type == 1)
11686 void (* Set)(void *, void *) = (void *)prop->Set;
11688 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11689 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11690 exp->instance->_class = MkSpecifierName(_class->fullName);
11691 exp->instance->loc = exp->loc;
11693 Set(exp->instance->data, value->instance->data);
11694 PopulateInstance(exp->instance);
11701 void (* Set)(void *, int) = (void *)prop->Set;
11703 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11704 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11705 exp->instance->_class = MkSpecifierName(_class->fullName);
11706 exp->instance->loc = exp->loc;
11708 GetInt(value, &intValue);
11709 Set(exp->instance->data, intValue);
11710 PopulateInstance(exp->instance);
11715 long long intValue;
11716 void (* Set)(void *, long long) = (void *)prop->Set;
11718 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11719 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11720 exp->instance->_class = MkSpecifierName(_class->fullName);
11721 exp->instance->loc = exp->loc;
11723 GetInt64(value, &intValue);
11724 Set(exp->instance->data, intValue);
11725 PopulateInstance(exp->instance);
11731 void (* Set)(void *, intptr_t) = (void *)prop->Set;
11733 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11734 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11735 exp->instance->_class = MkSpecifierName(_class->fullName);
11736 exp->instance->loc = exp->loc;
11738 GetIntPtr(value, &intValue);
11739 Set(exp->instance->data, intValue);
11740 PopulateInstance(exp->instance);
11746 void (* Set)(void *, ssize_t) = (void *)prop->Set;
11748 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11749 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11750 exp->instance->_class = MkSpecifierName(_class->fullName);
11751 exp->instance->loc = exp->loc;
11753 GetIntSize(value, &intValue);
11754 Set(exp->instance->data, intValue);
11755 PopulateInstance(exp->instance);
11760 double doubleValue;
11761 void (* Set)(void *, double) = (void *)prop->Set;
11763 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11764 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11765 exp->instance->_class = MkSpecifierName(_class->fullName);
11766 exp->instance->loc = exp->loc;
11768 GetDouble(value, &doubleValue);
11769 Set(exp->instance->data, doubleValue);
11770 PopulateInstance(exp->instance);
11775 else if(_class->type == 2)
11781 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
11783 if(propertyClass->type == 1 && value->instance->data)
11785 unsigned int (* Set)(void *) = (void *)prop->Set;
11786 unsigned int bits = Set(value->instance->data);
11788 exp->constant = PrintHexUInt(bits);
11792 else if(_class->type == 2)
11794 unsigned int value;
11795 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
11798 GetUInt(exp->member.exp, &value);
11800 exp->constant = PrintHexUInt(bits);
11809 if(_class->type == 2)
11811 unsigned int value;
11813 GetUInt(exp->member.exp, &value);
11818 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11820 if(_class->type == 1)
11822 void (* Get)(unsigned int, void *) = (void *)prop->Get;
11824 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11825 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11826 exp->instance->_class = MkSpecifierName(_class->fullName);
11827 exp->instance->loc = exp->loc;
11829 Get(value, exp->instance->data);
11830 PopulateInstance(exp->instance);
11832 else if(_class->type == 2)
11834 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
11835 uint64 bits = Get(value);
11837 exp->constant = PrintHexUInt64(bits);
11844 else if(_class->type == 1)
11846 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
11852 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11854 if(_class->type == 1 && value)
11856 void (* Get)(void *, void *) = (void *)prop->Get;
11858 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
11859 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
11860 exp->instance->_class = MkSpecifierName(_class->fullName);
11861 exp->instance->loc = exp->loc;
11863 Get(value, exp->instance->data);
11864 PopulateInstance(exp->instance);
11875 exp->isConstant = 0x0;
11884 FreeExpression(memberExp);
11885 FreeIdentifier(memberID);
11891 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
11893 FreeExpContents(exp);
11894 exp->constant = PrintUInt(ComputeTypeSize(type));
11901 struct Symbol * classSym = exp->_class->symbol;
11903 if(classSym && classSym->registered)
11905 if(classSym->registered->fixed)
11907 FreeSpecifier(exp->_class);
11908 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
11913 char className[1024];
11915 strcpy(className, "__ecereClass_");
11916 FullClassNameCat(className, classSym->string, 0x1);
11917 MangleClassName(className);
11918 DeclareClass(classSym, className);
11919 FreeExpContents(exp);
11921 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
11922 exp->member.member = MkIdentifier("structSize");
11929 struct Type * type;
11930 struct Expression * e = exp;
11932 if(exp->type == 11)
11935 ComputeExpression(exp->cast.exp);
11938 if(e && exp->expType)
11940 type = exp->expType;
11941 if(type->kind == 8)
11943 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
11945 if(_class && (_class->type == 3 || _class->type == 2))
11947 if(!_class->dataType)
11948 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
11949 type = _class->dataType;
11960 GetChar(e, &value);
11961 FreeExpContents(exp);
11962 exp->constant = PrintChar(value);
11967 unsigned char value;
11969 GetUChar(e, &value);
11970 FreeExpContents(exp);
11971 exp->constant = PrintUChar(value);
11980 GetShort(e, &value);
11981 FreeExpContents(exp);
11982 exp->constant = PrintShort(value);
11987 unsigned short value;
11989 GetUShort(e, &value);
11990 FreeExpContents(exp);
11991 exp->constant = PrintUShort(value);
12001 FreeExpContents(exp);
12002 exp->constant = PrintInt(value);
12007 unsigned int value;
12009 GetUInt(e, &value);
12010 FreeExpContents(exp);
12011 exp->constant = PrintUInt(value);
12020 GetInt64(e, &value);
12021 FreeExpContents(exp);
12022 exp->constant = PrintInt64(value);
12029 GetUInt64(e, &value);
12030 FreeExpContents(exp);
12031 exp->constant = PrintUInt64(value);
12040 GetIntPtr(e, &value);
12041 FreeExpContents(exp);
12042 exp->constant = PrintInt64((long long)value);
12049 GetUIntPtr(e, &value);
12050 FreeExpContents(exp);
12051 exp->constant = PrintUInt64((uint64)value);
12060 GetIntSize(e, &value);
12061 FreeExpContents(exp);
12062 exp->constant = PrintInt64((long long)value);
12069 GetUIntSize(e, &value);
12070 FreeExpContents(exp);
12071 exp->constant = PrintUInt64((uint64)value);
12079 GetFloat(e, &value);
12080 FreeExpContents(exp);
12081 exp->constant = PrintFloat(value);
12089 GetDouble(e, &value);
12090 FreeExpContents(exp);
12091 exp->constant = PrintDouble(value);
12101 struct Operand op1 =
12105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12108 struct Operand op2 =
12112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12115 struct Operand op3 =
12119 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
12124 ComputeExpression((*exp->cond.exp).last);
12125 if(exp->cond.elseExp)
12126 ComputeExpression(exp->cond.elseExp);
12128 ComputeExpression(exp->cond.cond);
12129 op1 = GetOperand(exp->cond.cond);
12131 op1.type->refCount++;
12132 op2 = GetOperand((*exp->cond.exp).last);
12134 op2.type->refCount++;
12135 op3 = GetOperand(exp->cond.elseExp);
12137 op3.type->refCount++;
12140 FreeExpContents(exp);
12141 op1.ops.Cond(exp, &op1, &op2, &op3);
12144 FreeType(op1.type);
12146 FreeType(op2.type);
12148 FreeType(op3.type);
12154 void ApplyAnyObjectLogic(struct Expression * e);
12156 extern void CopyTypeInto(struct Type * type, struct Type * src);
12158 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
12160 unsigned int result = 0x1;
12164 struct __ecereNameSpace__ecere__sys__OldList converts =
12168 struct Conversion * convert;
12170 if(destType->kind == 0)
12172 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
12176 for(convert = converts.first; convert; convert = convert->next)
12178 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
12182 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12183 int objectType = exp->expType ? exp->expType->classObjectType : 0;
12186 newExp->destType = (((void *)0));
12190 exp->addedThis = 0x1;
12191 exp->member.exp = newExp;
12192 FreeType(exp->member.exp->expType);
12193 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
12194 exp->member.exp->expType->classObjectType = objectType;
12195 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
12196 exp->member.memberType = 1;
12197 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12198 exp->needCast = 0x1;
12200 exp->expType->refCount++;
12201 ApplyAnyObjectLogic(exp->member.exp);
12207 exp->addedThis = 0x1;
12208 exp->member.exp = newExp;
12209 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
12211 newExp->byReference = 0x1;
12213 FreeType(exp->member.exp->expType);
12214 exp->member.exp->expType = (((void *)0));
12215 if(convert->convert->dataType)
12217 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12218 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
12219 exp->member.exp->expType->refCount = 1;
12220 exp->member.exp->expType->classObjectType = objectType;
12221 ApplyAnyObjectLogic(exp->member.exp);
12223 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
12224 exp->member.memberType = 4;
12225 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12226 exp->needCast = 0x1;
12227 if(convert->resultType)
12228 convert->resultType->refCount++;
12234 FreeType(exp->expType);
12237 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
12238 exp->needCast = 0x1;
12240 exp->expType->refCount++;
12244 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
12245 exp->needCast = 0x1;
12246 if(convert->resultType)
12247 convert->resultType->refCount++;
12251 if(exp->isConstant && inCompiler)
12252 ComputeExpression(exp);
12253 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
12255 if(!result && exp->expType && converts.count)
12257 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
12259 if(!result && exp->expType && exp->destType)
12261 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))
12268 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
12270 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
12272 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
12274 void CheckTemplateTypes(struct Expression * exp)
12276 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
12278 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12279 struct Statement * compound;
12280 struct Context * context;
12284 exp->destType->refCount++;
12286 exp->expType->refCount++;
12287 newExp->prev = (((void *)0));
12288 newExp->next = (((void *)0));
12289 switch(exp->expType->kind)
12292 if(exp->destType->classObjectType)
12295 exp->destType->refCount--;
12297 exp->expType->refCount--;
12298 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12302 struct __ecereNameSpace__ecere__sys__OldList * specs;
12303 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12304 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12306 context = PushContext();
12307 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12308 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12309 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12311 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12312 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
12313 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
12314 exp->compound->compound.context = context;
12315 PopContext(context);
12320 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
12321 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12325 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
12327 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12328 struct Statement * compound;
12329 struct Context * context;
12333 exp->destType->refCount++;
12335 exp->expType->refCount++;
12336 newExp->prev = (((void *)0));
12337 newExp->next = (((void *)0));
12338 switch(exp->expType->kind)
12341 if(exp->destType->classObjectType)
12344 exp->destType->refCount--;
12346 exp->expType->refCount--;
12347 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12351 struct __ecereNameSpace__ecere__sys__OldList * specs;
12352 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
12353 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
12355 context = PushContext();
12356 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
12357 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
12358 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
12360 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
12361 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
12362 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
12363 exp->compound->compound.context = context;
12364 PopContext(context);
12369 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
12372 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
12373 ProcessExpressionType((*exp->list).first);
12379 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
12380 newExp->needCast = 0x1;
12381 ProcessExpressionType((*exp->list).first);
12387 if(exp->expType->kind == 20)
12389 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
12393 FreeType(exp->destType);
12394 FreeType(exp->expType);
12395 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12399 if(newExp->type == 8 && newExp->member.memberType == 3)
12403 exp->op.exp1 = (((void *)0));
12404 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
12408 char typeString[1024];
12409 struct Declarator * decl;
12410 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12412 typeString[0] = '\0';
12413 PrintType(exp->expType, typeString, 0x0, 0x0);
12414 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12416 exp->cast.typeName = MkTypeName(specs, decl);
12417 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
12418 exp->cast.exp->needCast = 0x1;
12426 extern int strncmp(const char * , const char * , size_t n);
12428 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
12430 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
12432 int nsLen = strlen(nameSpace);
12433 struct Symbol * symbol;
12435 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)))
12437 char * s = symbol->string;
12439 if(!strncmp(s, nameSpace, nsLen))
12444 for(c = strlen(s) - 1; c >= 0; c--)
12447 namePart = s + c + 1;
12448 if(!strcmp(namePart, name))
12456 return (((void *)0));
12459 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
12462 char nameSpace[1024];
12464 unsigned int gotColon = 0x0;
12466 nameSpace[0] = '\0';
12467 for(c = strlen(name) - 1; c >= 0; c--)
12473 namePart = name + c + 1;
12474 while(c >= 0 && name[c] == ':')
12478 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
12482 memcpy(nameSpace, name, c + 1);
12483 nameSpace[c + 1] = (char)0;
12484 return ScanWithNameSpace(tree, nameSpace, namePart);
12488 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12494 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
12498 return ScanWithNameSpace(tree, "", namePart);
12500 return (((void *)0));
12503 static void ProcessDeclaration(struct Declaration * decl);
12505 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
12507 struct Context * ctx;
12508 struct Symbol * symbol = (((void *)0));
12510 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
12512 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
12514 symbol = (((void *)0));
12517 char curName[1024];
12519 strcpy(curName, thisNameSpace);
12520 strcat(curName, "::");
12521 strcat(curName, name);
12522 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
12525 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
12528 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
12529 if(symbol || ctx == endContext)
12532 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
12534 if(symbol->pointerExternal->type == 0)
12536 struct FunctionDefinition * function = symbol->pointerExternal->function;
12537 struct Context * tmpContext = curContext;
12539 curContext = (((void *)0));
12540 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
12541 curContext = tmpContext;
12542 symbol->pointerExternal->symbol = symbol;
12543 DeclareType(symbol->type, 0x1, 0x1);
12544 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
12545 symbol->id = curExternal->symbol->idCode;
12547 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
12549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
12550 symbol->id = curExternal->symbol->idCode;
12556 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
12558 if(!type->isSigned && type->kind != 22 && type->kind != 23)
12559 ListAdd(specs, MkSpecifier(UNSIGNED));
12564 if(type->_class->registered)
12566 if(!type->_class->registered->dataType)
12567 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
12568 GetTypeSpecs(type->_class->registered->dataType, specs);
12573 ListAdd(specs, MkSpecifier(DOUBLE));
12576 ListAdd(specs, MkSpecifier(FLOAT));
12579 ListAdd(specs, MkSpecifier(CHAR));
12582 ListAdd(specs, MkSpecifier(_BOOL));
12585 ListAdd(specs, MkSpecifier(SHORT));
12588 ListAdd(specs, MkSpecifier(INT64));
12591 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
12594 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
12598 ListAdd(specs, MkSpecifier(INT));
12603 static void PrintArraySize(struct Type * arrayType, char * string)
12609 if(arrayType->enumClass)
12610 strcat(size, arrayType->enumClass->string);
12611 else if(arrayType->arraySizeExp)
12612 PrintExpression(arrayType->arraySizeExp, size);
12614 strcat(string, size);
12617 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
12621 if(printConst && type->constant)
12622 strcat(string, "const ");
12627 struct Symbol * c = type->_class;
12629 if(type->classObjectType == 2)
12630 strcat(string, "typed_object");
12631 else if(type->classObjectType == 3)
12632 strcat(string, "any_object");
12636 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
12638 if(type->byReference)
12639 strcat(string, " &");
12643 strcat(string, "void");
12646 strcat(string, type->isSigned ? "int" : "uint");
12649 strcat(string, type->isSigned ? "int64" : "uint64");
12652 strcat(string, type->isSigned ? "intptr" : "uintptr");
12655 strcat(string, type->isSigned ? "intsize" : "uintsize");
12658 strcat(string, type->isSigned ? "char" : "byte");
12661 strcat(string, "_Bool");
12664 strcat(string, type->isSigned ? "short" : "uint16");
12667 strcat(string, "float");
12670 strcat(string, "double");
12675 strcat(string, "struct ");
12676 strcat(string, type->enumName);
12678 else if(type->typeName)
12679 strcat(string, type->typeName);
12682 struct Type * member;
12684 strcat(string, "struct { ");
12685 for(member = type->members.first; member; member = member->next)
12687 PrintType(member, string, 0x1, fullName);
12688 strcat(string, "; ");
12690 strcat(string, "}");
12696 strcat(string, "union ");
12697 strcat(string, type->enumName);
12699 else if(type->typeName)
12700 strcat(string, type->typeName);
12703 strcat(string, "union ");
12704 strcat(string, "(unnamed)");
12710 strcat(string, "enum ");
12711 strcat(string, type->enumName);
12713 else if(type->typeName)
12714 strcat(string, type->typeName);
12716 strcat(string, "int");
12719 strcat(string, "...");
12722 strcat(string, "subclass(");
12723 strcat(string, type->_class ? type->_class->string : "int");
12724 strcat(string, ")");
12727 strcat(string, type->templateParameter->identifier->string);
12730 strcat(string, "thisclass");
12733 strcat(string, "__builtin_va_list");
12739 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
12741 static void PrintName(struct Type * type, char * string, unsigned int fullName)
12743 if(type->name && type->name[0])
12746 strcat(string, type->name);
12749 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
12755 strcat(string, name);
12760 static void PrintAttribs(struct Type * type, char * string)
12764 if(type->dllExport)
12765 strcat(string, "dllexport ");
12766 if(type->attrStdcall)
12767 strcat(string, "stdcall ");
12771 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
12773 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12775 struct Type * attrType = (((void *)0));
12777 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
12778 PrintAttribs(type, string);
12779 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
12780 strcat(string, " const");
12781 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
12782 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12783 strcat(string, " (");
12784 if(type->kind == 13)
12786 if(type->type->kind == 11 || type->type->kind == 16)
12787 PrintAttribs(type->type, string);
12789 if(type->kind == 13)
12791 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
12792 strcat(string, "*");
12794 strcat(string, " *");
12796 if(printConst && type->constant && type->kind == 13)
12797 strcat(string, " const");
12800 PrintTypeSpecs(type, string, fullName, printConst);
12803 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
12805 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
12806 strcat(string, ")");
12807 if(type->kind == 12)
12808 PrintArraySize(type, string);
12809 else if(type->kind == 11)
12811 struct Type * param;
12813 strcat(string, "(");
12814 for(param = type->params.first; param; param = param->next)
12816 PrintType(param, string, 0x1, fullName);
12818 strcat(string, ", ");
12820 strcat(string, ")");
12822 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
12823 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
12826 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
12828 PrePrintType(type, string, fullName, (((void *)0)), printConst);
12829 if(type->thisClass || (printName && type->name && type->name[0]))
12830 strcat(string, " ");
12831 if((type->thisClass || type->staticMethod))
12833 struct Symbol * _class = type->thisClass;
12835 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
12837 if(type->classObjectType == 1)
12838 strcat(string, "class");
12840 strcat(string, type->byReference ? "typed_object&" : "typed_object");
12842 else if(_class && _class->string)
12844 char * s = _class->string;
12850 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
12856 strcat(string, name);
12859 strcat(string, "::");
12861 if(printName && type->name)
12862 PrintName(type, string, fullName);
12863 PostPrintType(type, string, fullName);
12864 if(type->bitFieldCount)
12868 sprintf(count, ":%d", type->bitFieldCount);
12869 strcat(string, count);
12873 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12875 _PrintType(type, string, printName, fullName, 0x1);
12878 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
12880 _PrintType(type, string, printName, fullName, 0x0);
12883 static struct Type * FindMember(struct Type * type, char * string)
12885 struct Type * memberType;
12887 for(memberType = type->members.first; memberType; memberType = memberType->next)
12889 if(!memberType->name)
12891 struct Type * subType = FindMember(memberType, string);
12896 else if(!strcmp(memberType->name, string))
12899 return (((void *)0));
12902 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
12904 struct Type * memberType;
12906 for(memberType = type->members.first; memberType; memberType = memberType->next)
12908 if(!memberType->name)
12910 struct Type * subType = FindMember(memberType, string);
12914 *offset += memberType->offset;
12918 else if(!strcmp(memberType->name, string))
12920 *offset += memberType->offset;
12924 return (((void *)0));
12927 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
12929 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
12931 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__File;
12933 struct Expression * ParseExpressionString(char * expression)
12935 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12936 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
12937 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12939 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12940 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
12941 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
12942 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
12944 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
12945 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12947 parsedExpression = (((void *)0));
12949 expression_yyparse();
12950 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12951 return parsedExpression;
12954 extern char * QMkString(char * source);
12956 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
12958 struct Identifier * id = exp->identifier;
12959 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
12960 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
12961 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
12962 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
12964 if(_class && _class->type == 4)
12966 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
12967 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
12971 struct __ecereNameSpace__ecere__com__Class * baseClass;
12973 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
12975 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
12977 for(value = e->values.first; value; value = value->next)
12979 if(!strcmp(value->name, id->string))
12984 char constant[256];
12986 FreeExpContents(exp);
12988 exp->isConstant = 0x1;
12989 if(!strcmp(baseClass->dataTypeString, "int"))
12990 sprintf(constant, "%d", (int)value->data);
12992 sprintf(constant, "0x%X", (int)value->data);
12993 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
12994 exp->expType = MkClassType(baseClass->fullName);
13002 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
13004 ProcessMethodType(method);
13005 exp->expType = __extension__ ({
13006 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13008 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
13012 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
13014 if(!prop->dataType)
13015 ProcessPropertyType(prop);
13016 exp->expType = prop->dataType;
13018 prop->dataType->refCount++;
13021 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
13023 if(!member->dataType)
13024 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
13025 exp->expType = member->dataType;
13026 if(member->dataType)
13027 member->dataType->refCount++;
13030 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
13032 if(!classProp->dataType)
13033 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
13034 if(classProp->constant)
13036 FreeExpContents(exp);
13037 exp->isConstant = 0x1;
13038 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
13041 exp->constant = QMkString((char *)classProp->Get(_class));
13045 char constant[256];
13048 sprintf(constant, "%d", (int)classProp->Get(_class));
13049 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
13055 exp->expType = classProp->dataType;
13056 if(classProp->dataType)
13057 classProp->dataType->refCount++;
13063 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
13065 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
13066 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
13067 struct __ecereNameSpace__ecere__com__NameSpace * child;
13071 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)))
13073 data = ScanGlobalData(child, name);
13081 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
13083 extern char * strncpy(char * , const char * , size_t n);
13085 static struct GlobalData * FindGlobalData(char * name)
13088 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13090 nameSpace = globalData;
13091 for(c = 0; name[c]; c++)
13093 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
13095 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
13096 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
13098 strncpy(spaceName, name + start, c - start);
13099 spaceName[c - start] = '\0';
13100 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
13101 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
13103 return (((void *)0));
13104 nameSpace = newSpace;
13112 return ScanGlobalData(nameSpace, name + start);
13114 return (((void *)0));
13117 static int definedExpStackPos;
13119 static void * definedExpStack[512];
13121 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
13123 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
13125 FreeExpContents(checkedExp);
13126 FreeType(checkedExp->expType);
13127 FreeType(checkedExp->destType);
13128 *checkedExp = *newExp;
13129 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
13130 checkedExp->prev = prev;
13131 checkedExp->next = next;
13134 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
13136 extern int printf(char * , ...);
13138 void __ecereMethod_Expression_Clear();
13140 void ApplyAnyObjectLogic(struct Expression * e)
13142 struct Type * destType = e->destType;
13144 if(destType && (destType->classObjectType == 3))
13146 if(e && e->expType)
13148 struct Type * type = e->expType;
13149 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
13151 if(type->kind == 8 && type->_class && type->_class->registered)
13153 _class = type->_class->registered;
13155 else if(type->kind == 19)
13157 _class = FindClass("ecere::com::Class")->registered;
13161 char string[1024] = "";
13162 struct Symbol * classSym;
13164 PrintTypeNoConst(type, string, 0x0, 0x1);
13165 classSym = FindClass(string);
13167 _class = classSym->registered;
13169 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)))
13171 if(!_class || strcmp(_class->fullName, "char *"))
13173 struct Expression * checkedExp = e, * newExp;
13175 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13177 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13179 if(checkedExp->type == 25)
13181 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13184 checkedExp = (*checkedExp->list).last;
13186 else if(checkedExp->type == 11)
13187 checkedExp = checkedExp->cast.exp;
13189 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
13191 newExp = checkedExp->op.exp2;
13192 checkedExp->op.exp2 = (((void *)0));
13193 FreeExpContents(checkedExp);
13194 if(e->expType && e->expType->passAsTemplate)
13198 ComputeTypeSize(e->expType);
13199 sprintf(size, "%d", e->expType->size);
13200 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))))));
13202 ReplaceExpContents(checkedExp, newExp);
13203 e->byReference = 0x1;
13205 else if(!e->byReference || (_class && _class->type == 5))
13207 struct Expression * checkedExp, * newExp;
13210 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;
13212 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
13214 struct Context * context = PushContext();
13215 struct Declarator * decl;
13216 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13217 char typeString[1024];
13218 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13220 typeString[0] = '\0';
13222 newExp->prev = (((void *)0));
13223 newExp->next = (((void *)0));
13224 newExp->expType = (((void *)0));
13225 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
13226 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13227 newExp->destType = ProcessType(specs, decl);
13228 curContext = context;
13232 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
13235 sprintf(name, "__internalValue%03X", internalValueCounter++);
13236 if(!curCompound->compound.declarations)
13237 curCompound->compound.declarations = MkList();
13238 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
13239 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
13240 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
13241 e->compound = MkCompoundStmt((((void *)0)), stmts);
13244 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
13246 struct Type * type = e->destType;
13248 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13249 CopyTypeInto(e->destType, type);
13250 e->destType->refCount = 1;
13251 e->destType->classObjectType = 0;
13254 e->compound->compound.context = context;
13255 PopContext(context);
13256 curContext = context->parent;
13260 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
13262 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
13264 if(checkedExp->type == 25)
13266 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
13269 checkedExp = (*checkedExp->list).last;
13271 else if(checkedExp->type == 11)
13272 checkedExp = checkedExp->cast.exp;
13275 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13277 *operand = *checkedExp;
13278 checkedExp->destType = (((void *)0));
13279 checkedExp->expType = (((void *)0));
13280 __ecereMethod_Expression_Clear(checkedExp);
13281 checkedExp->type = 4;
13282 checkedExp->op.op = '&';
13283 checkedExp->op.exp1 = (((void *)0));
13284 checkedExp->op.exp2 = operand;
13293 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))))
13295 if(e->expType->classObjectType && destType && destType->classObjectType)
13301 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13304 thisExp->prev = (((void *)0));
13305 thisExp->next = (((void *)0));
13306 __ecereMethod_Expression_Clear(e);
13308 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
13309 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
13310 ((struct Expression *)(*e->list).first)->byReference = 0x1;
13312 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13313 CopyTypeInto(e->expType, thisExp->expType);
13314 e->expType->byReference = 0x0;
13315 e->expType->refCount = 1;
13316 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))
13318 e->expType->classObjectType = 0;
13323 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
13325 if(destType->kind == 14)
13327 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
13329 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
13331 unsigned int byReference = e->expType->byReference;
13332 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
13333 struct Declarator * decl;
13334 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13335 char typeString[1024];
13336 struct Type * type;
13337 int backupClassObjectType;
13338 unsigned int backupByReference;
13340 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
13344 backupClassObjectType = type->classObjectType;
13345 backupByReference = type->byReference;
13346 type->classObjectType = 0;
13347 type->byReference = 0x0;
13348 typeString[0] = '\0';
13349 PrintType(type, typeString, 0x0, 0x1);
13350 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13351 type->classObjectType = backupClassObjectType;
13352 type->byReference = backupByReference;
13354 thisExp->prev = (((void *)0));
13355 thisExp->next = (((void *)0));
13356 __ecereMethod_Expression_Clear(e);
13357 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)))
13361 e->op.exp1 = (((void *)0));
13362 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
13363 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13364 CopyTypeInto(e->expType, type);
13365 e->expType->byReference = 0x0;
13366 e->expType->refCount = 1;
13371 e->cast.typeName = MkTypeName(specs, decl);
13372 e->cast.exp = thisExp;
13373 e->byReference = 0x1;
13377 e->destType = destType;
13378 destType->refCount++;
13383 extern char * strstr(const char * , const char * );
13385 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
13387 struct __ecereNameSpace__ecere__com__DefinedExpression
13389 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
13390 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
13393 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
13394 } __attribute__ ((gcc_struct));
13396 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13398 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
13400 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
13402 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
13404 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
13406 extern struct Expression * CopyExpression(struct Expression * exp);
13408 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
13410 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
13412 static void ProcessStatement(struct Statement * stmt);
13414 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
13416 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
13418 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
13420 extern char * sourceFile;
13422 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
13424 void ProcessExpressionType(struct Expression * exp)
13426 unsigned int unresolved = 0x0;
13427 struct Location oldyylloc = yylloc;
13428 unsigned int notByReference = 0x0;
13430 if(!exp || exp->expType)
13437 struct Identifier * id = exp->identifier;
13441 if(id->_class && id->_class->name)
13443 id->classSym = id->_class->symbol;
13445 if(strstr(id->string, "__ecereClass") == id->string)
13447 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
13450 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
13452 ReplaceClassMembers(exp, thisClass);
13455 ProcessExpressionType(exp);
13458 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
13463 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13467 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
13473 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
13476 ProcessExpressionType(exp);
13480 else if(currentClass && !id->_class)
13482 if(ResolveIdWithClass(exp, currentClass, 0x1))
13485 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13490 struct Type * type = symbol->type;
13491 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
13493 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
13495 struct Context * context = SetupTemplatesContext(_class);
13497 type = ReplaceThisClassType(_class);
13498 FinishTemplatesContext(context);
13500 type->refCount = 0;
13502 FreeSpecifier(id->_class);
13503 id->_class = (((void *)0));
13504 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13505 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
13506 id->classSym = (((void *)0));
13507 exp->expType = type;
13510 if(type && (type->kind == 15 || (_class && _class->type == 4)))
13511 exp->isConstant = 0x1;
13512 if(symbol->isParam || !strcmp(id->string, "this"))
13514 if(_class && _class->type == 1 && !type->declaredWithStruct)
13515 exp->byReference = 0x1;
13517 if(symbol->isIterator)
13519 if(symbol->isIterator == 3)
13522 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
13523 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
13524 exp->expType = (((void *)0));
13525 ProcessExpressionType(exp);
13527 else if(symbol->isIterator != 4)
13530 exp->member.exp = MkExpIdentifier(exp->identifier);
13531 exp->member.exp->expType = exp->expType;
13532 exp->member.member = MkIdentifier("data");
13533 exp->expType = (((void *)0));
13534 ProcessExpressionType(exp);
13541 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
13543 if(thisNameSpace && !(id->_class && !id->_class->name))
13547 strcpy(name, thisNameSpace);
13548 strcat(name, "::");
13549 strcat(name, id->string);
13550 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
13553 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
13558 for(c = 0; c < definedExpStackPos; c++)
13559 if(definedExpStack[c] == definedExp)
13561 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
13563 struct Location backupYylloc = yylloc;
13565 definedExpStack[definedExpStackPos++] = definedExp;
13566 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
13567 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
13568 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13570 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13571 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
13572 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
13573 struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
13575 __internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__File->_vTbl;
13576 })[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
13578 parsedExpression = (((void *)0));
13580 expression_yyparse();
13581 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
13582 yylloc = backupYylloc;
13583 if(parsedExpression)
13585 FreeIdentifier(id);
13587 exp->list = MkListOne(parsedExpression);
13588 parsedExpression->loc = yylloc;
13589 ProcessExpressionType(exp);
13590 definedExpStackPos--;
13593 definedExpStackPos--;
13599 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
13605 struct GlobalData * data = (((void *)0));
13607 if(thisNameSpace && !(id->_class && !id->_class->name))
13611 strcpy(name, thisNameSpace);
13612 strcat(name, "::");
13613 strcat(name, id->string);
13614 data = FindGlobalData(name);
13617 data = FindGlobalData(id->string);
13620 DeclareGlobalData(data);
13621 exp->expType = data->dataType;
13623 data->dataType->refCount++;
13624 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13625 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
13626 FreeSpecifier(id->_class);
13627 id->_class = (((void *)0));
13632 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
13634 if(thisNameSpace && !(id->_class && !id->_class->name))
13638 strcpy(name, thisNameSpace);
13639 strcat(name, "::");
13640 strcat(name, id->string);
13641 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
13644 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
13649 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13650 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
13652 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
13653 strcpy(name, "__ecereFunction_");
13654 FullClassNameCat(name, id->string, 0x0);
13655 if(DeclareFunction(function, name))
13657 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
13658 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
13660 exp->expType = function->dataType;
13661 if(function->dataType)
13662 function->dataType->refCount++;
13663 FreeSpecifier(id->_class);
13664 id->_class = (((void *)0));
13676 struct __ecereNameSpace__ecere__com__Class * _class;
13678 if(!exp->instance->_class)
13680 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
13682 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
13685 ProcessInstantiationType(exp->instance);
13686 exp->isConstant = exp->instance->isConstant;
13687 if(exp->instance->_class)
13689 exp->expType = MkClassType(exp->instance->_class->name);
13697 char * constant = exp->constant;
13698 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
13700 exp->expType = type;
13701 if(constant[0] == '\'')
13703 if((int)((unsigned char *)constant)[1] > 127)
13706 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(constant + 1, &nb);
13710 (__ecereNameSpace__ecere__com__eSystem_Delete(constant), constant = 0);
13711 exp->constant = PrintUInt(ch);
13713 type->_class = FindClass("unichar");
13714 type->isSigned = 0x0;
13719 type->isSigned = 0x1;
13724 char * dot = strchr(constant, '.');
13725 unsigned int isHex = (constant[0] == '0' && (constant[1] == 'x' || constant[1] == 'X'));
13730 exponent = strchr(constant, 'p');
13732 exponent = strchr(constant, 'P');
13736 exponent = strchr(constant, 'e');
13738 exponent = strchr(constant, 'E');
13740 if(dot || exponent)
13742 if(strchr(constant, 'f') || strchr(constant, 'F'))
13746 type->isSigned = 0x1;
13750 unsigned int isSigned = constant[0] == '-';
13751 long long i64 = strtoll(constant, (((void *)0)), 0);
13752 uint64 ui64 = strtoull(constant, (((void *)0)), 0);
13753 unsigned int is64Bit = 0x0;
13757 if(i64 < (((int)0x80000000)))
13762 if(ui64 > (((int)0x7fffffff)))
13764 if(ui64 > (0xffffffff))
13767 if(ui64 <= (((long long)0x7fffffffffffffffLL)) && (constant[0] != '0' || !constant[1]))
13771 else if(constant[0] != '0' || !constant[1])
13774 type->kind = is64Bit ? 4 : 3;
13775 type->isSigned = isSigned;
13778 exp->isConstant = 0x1;
13779 if(exp->destType && exp->destType->kind == 7)
13781 else if(exp->destType && exp->destType->kind == 6)
13783 else if(exp->destType && exp->destType->kind == 4)
13790 exp->isConstant = 0x1;
13791 exp->expType = __extension__ ({
13792 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13794 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
13795 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13797 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1->isSigned = 0x1, __ecereInstance1;
13798 }), __ecereInstance2;
13804 ProcessExpressionType(exp->_new.size);
13805 exp->expType = __extension__ ({
13806 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13808 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
13810 DeclareType(exp->expType->type, 0x0, 0x0);
13814 ProcessExpressionType(exp->_renew.size);
13815 ProcessExpressionType(exp->_renew.exp);
13816 exp->expType = __extension__ ({
13817 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13819 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
13821 DeclareType(exp->expType->type, 0x0, 0x0);
13825 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
13826 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
13827 unsigned int useDestType = 0x0, useSideType = 0x0;
13828 struct Location oldyylloc = yylloc;
13829 unsigned int useSideUnit = 0x0;
13830 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13872 if(exp->op.op != '*' || exp->op.exp1)
13879 if(exp->op.op == '&')
13881 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
13883 struct Identifier * id = exp->op.exp2->identifier;
13884 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
13886 if(symbol && symbol->isIterator == 2)
13889 exp->member.exp = exp->op.exp2;
13890 exp->member.member = MkIdentifier("key");
13891 exp->expType = (((void *)0));
13892 exp->op.exp2->expType = symbol->type;
13893 symbol->type->refCount++;
13894 ProcessExpressionType(exp);
13902 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))
13904 if(exp->op.exp1->destType)
13905 FreeType(exp->op.exp1->destType);
13906 exp->op.exp1->destType = exp->destType;
13908 exp->destType->refCount++;
13912 if(exp->op.exp1->destType)
13913 FreeType(exp->op.exp1->destType);
13914 exp->op.exp1->destType = dummy;
13917 if(exp->op.exp1->destType && exp->op.op != '=')
13918 exp->op.exp1->destType->count++;
13919 ProcessExpressionType(exp->op.exp1);
13920 if(exp->op.exp1->destType && exp->op.op != '=')
13921 exp->op.exp1->destType->count--;
13922 if(exp->op.exp1->destType == dummy)
13925 exp->op.exp1->destType = (((void *)0));
13927 type1 = exp->op.exp1->expType;
13931 char expString[10240];
13933 expString[0] = '\0';
13934 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
13938 exp->op.exp2->destType = exp->op.exp1->expType;
13939 if(exp->op.exp1->expType)
13940 exp->op.exp1->expType->refCount++;
13944 exp->op.exp2->destType = exp->destType;
13946 exp->destType->refCount++;
13950 exp->expType = type1;
13955 PrintExpression(exp->op.exp2, expString);
13956 if(type1 && type1->kind == 13)
13958 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)
13959 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
13960 else if(exp->op.op == '=')
13962 if(exp->op.exp2->destType)
13963 FreeType(exp->op.exp2->destType);
13964 exp->op.exp2->destType = type1;
13971 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)
13975 if(exp->op.exp2->destType)
13976 FreeType(exp->op.exp2->destType);
13977 exp->op.exp2->destType = type1;
13984 exp->expType = type1;
13986 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)))
13988 if(exp->op.exp2->destType)
13989 FreeType(exp->op.exp2->destType);
13990 exp->op.exp2->destType = exp->destType;
13992 exp->destType->refCount++;
13996 if(exp->op.exp2->destType)
13997 FreeType(exp->op.exp2->destType);
13998 exp->op.exp2->destType = dummy;
14001 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
14003 FreeType(exp->op.exp2->destType);
14004 exp->op.exp2->destType = type1;
14007 if(exp->op.exp2->destType && exp->op.op != '=')
14008 exp->op.exp2->destType->count++;
14009 ProcessExpressionType(exp->op.exp2);
14010 if(exp->op.exp2->destType && exp->op.op != '=')
14011 exp->op.exp2->destType->count--;
14012 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
14014 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)
14016 if(exp->op.op != '=' && type1->type->kind == 0)
14017 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14019 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)))
14021 if(exp->op.op == ADD_ASSIGN)
14022 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14024 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))
14026 if(exp->op.op == ADD_ASSIGN)
14027 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14029 else if(inCompiler)
14031 char type1String[1024];
14032 char type2String[1024];
14034 type1String[0] = '\0';
14035 type2String[0] = '\0';
14036 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
14037 PrintType(type1, type2String, 0x0, 0x1);
14038 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14039 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
14042 if(exp->op.exp2->destType == dummy)
14045 exp->op.exp2->destType = (((void *)0));
14047 if(exp->op.op == '-' && !exp->op.exp1 && exp->op.exp2->expType && !exp->op.exp2->expType->isSigned)
14049 type2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14050 type2->refCount = 1;
14051 CopyTypeInto(type2, exp->op.exp2->expType);
14052 type2->isSigned = 0x1;
14054 else if(exp->op.op == '~' && !exp->op.exp1 && exp->op.exp2->expType && (!exp->op.exp2->expType->isSigned || exp->op.exp2->expType->kind != 3))
14056 type2 = __extension__ ({
14057 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14059 __ecereInstance1->kind = 3, __ecereInstance1;
14061 type2->refCount = 1;
14062 type2->isSigned = 0x1;
14065 type2 = exp->op.exp2->expType;
14068 if(exp->op.op == SIZEOF)
14070 exp->expType = __extension__ ({
14071 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14073 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14075 exp->isConstant = 0x1;
14077 else if(exp->op.op == '*' && !exp->op.exp1)
14079 exp->expType = Dereference(type2);
14080 if(type2 && type2->kind == 8)
14081 notByReference = 0x1;
14083 else if(exp->op.op == '&' && !exp->op.exp1)
14084 exp->expType = Reference(type2);
14091 if(exp->op.exp1->destType)
14092 FreeType(exp->op.exp1->destType);
14093 exp->op.exp1->destType = MkClassType("bool");
14094 exp->op.exp1->destType->truth = 0x1;
14095 if(!exp->op.exp1->expType)
14096 ProcessExpressionType(exp->op.exp1);
14098 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14099 FreeType(exp->op.exp1->expType);
14100 exp->op.exp1->expType = MkClassType("bool");
14101 exp->op.exp1->expType->truth = 0x1;
14105 if(exp->op.exp2->destType)
14106 FreeType(exp->op.exp2->destType);
14107 exp->op.exp2->destType = MkClassType("bool");
14108 exp->op.exp2->destType->truth = 0x1;
14109 if(!exp->op.exp2->expType)
14110 ProcessExpressionType(exp->op.exp2);
14112 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14113 FreeType(exp->op.exp2->expType);
14114 exp->op.exp2->expType = MkClassType("bool");
14115 exp->op.exp2->expType->truth = 0x1;
14118 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")))))
14120 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
14122 if(exp->op.exp2->destType)
14123 FreeType(exp->op.exp2->destType);
14124 exp->op.exp2->destType = type1;
14126 if(exp->op.exp1->destType)
14127 FreeType(exp->op.exp1->destType);
14128 exp->op.exp1->destType = type2;
14130 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)
14131 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operating on %s and %s with an untyped result, assuming %s\n", (((void *)0))), type1->_class->string, type2->_class->string, type1->_class->string);
14132 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
14134 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14138 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14140 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
14141 ProcessExpressionType(exp->op.exp1);
14142 if(type2->kind != 13)
14144 ProcessExpressionType(classExp);
14145 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"))))))));
14146 if(!exp->op.exp2->expType)
14147 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
14148 ProcessExpressionType(exp->op.exp2);
14152 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)))
14154 if(type1->kind != 8 && type1->type->kind == 0)
14155 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14156 exp->expType = type1;
14160 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)))
14162 if(type2->kind != 8 && type2->type->kind == 0)
14163 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
14164 exp->expType = type2;
14168 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))
14170 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
14174 unsigned int success = 0x0;
14176 if(type1->kind == 13 && type2->kind == 13)
14178 if(exp->op.op == '+')
14179 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
14180 else if(exp->op.op == '-')
14182 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
14184 exp->expType = __extension__ ({
14185 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14187 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
14190 if(type1->type->kind == 20)
14192 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
14196 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
14198 ProcessExpressionType(classExp);
14200 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")))))));
14201 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
14209 if(!success && exp->op.exp1->type == 2)
14211 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14214 FreeType(exp->expType);
14215 exp->expType = exp->op.exp1->destType;
14216 if(exp->op.exp1->destType)
14217 exp->op.exp1->destType->refCount++;
14220 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14223 FreeType(exp->expType);
14224 exp->expType = exp->op.exp2->destType;
14225 if(exp->op.exp2->destType)
14226 exp->op.exp2->destType->refCount++;
14232 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14235 FreeType(exp->expType);
14236 exp->expType = exp->op.exp2->destType;
14237 if(exp->op.exp2->destType)
14238 exp->op.exp2->destType->refCount++;
14241 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14244 FreeType(exp->expType);
14245 exp->expType = exp->op.exp1->destType;
14246 if(exp->op.exp1->destType)
14247 exp->op.exp1->destType->refCount++;
14253 char expString1[10240];
14254 char expString2[10240];
14258 expString1[0] = '\0';
14259 expString2[0] = '\0';
14264 PrintExpression(exp->op.exp1, expString1);
14265 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14266 PrintExpression(exp->op.exp2, expString2);
14267 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14268 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
14269 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
14271 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
14275 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14277 if(exp->op.exp1->destType)
14278 FreeType(exp->op.exp1->destType);
14279 exp->op.exp1->destType = type2->_class->registered->dataType;
14280 if(type2->_class->registered->dataType)
14281 type2->_class->registered->dataType->refCount++;
14282 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14283 exp->expType = type2;
14287 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14289 if(exp->op.exp2->destType)
14290 FreeType(exp->op.exp2->destType);
14291 exp->op.exp2->destType = type1->_class->registered->dataType;
14292 if(type1->_class->registered->dataType)
14293 type1->_class->registered->dataType->refCount++;
14294 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14295 exp->expType = type1;
14301 unsigned int valid = 0x0;
14303 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
14305 if(exp->op.exp2->destType)
14306 FreeType(exp->op.exp2->destType);
14307 if(!type1->_class->registered->dataType)
14308 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
14309 exp->op.exp2->destType = type1->_class->registered->dataType;
14310 exp->op.exp2->destType->refCount++;
14311 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14312 type2 = exp->op.exp2->destType;
14313 exp->expType = type2;
14316 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
14318 if(exp->op.exp1->destType)
14319 FreeType(exp->op.exp1->destType);
14320 if(!type2->_class->registered->dataType)
14321 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
14322 exp->op.exp1->destType = type2->_class->registered->dataType;
14323 exp->op.exp1->destType->refCount++;
14324 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14325 type1 = exp->op.exp1->destType;
14326 exp->expType = type1;
14329 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
14331 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
14333 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
14336 FreeType(exp->expType);
14337 exp->expType = exp->op.exp1->expType;
14338 if(exp->op.exp2->expType)
14339 exp->op.exp1->expType->refCount++;
14343 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
14345 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
14348 FreeType(exp->expType);
14349 exp->expType = exp->op.exp2->expType;
14350 if(exp->op.exp2->expType)
14351 exp->op.exp2->expType->refCount++;
14358 if(exp->op.exp2->destType)
14359 FreeType(exp->op.exp2->destType);
14360 exp->op.exp2->destType = type1;
14362 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
14365 FreeType(exp->expType);
14366 exp->expType = exp->op.exp2->destType;
14367 if(exp->op.exp2->destType)
14368 exp->op.exp2->destType->refCount++;
14370 else if(type1 && type2)
14372 char expString1[10240];
14373 char expString2[10240];
14374 char type1String[1024];
14375 char type2String[1024];
14377 expString1[0] = '\0';
14378 expString2[0] = '\0';
14379 type1String[0] = '\0';
14380 type2String[0] = '\0';
14383 PrintExpression(exp->op.exp1, expString1);
14384 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
14385 PrintExpression(exp->op.exp2, expString2);
14386 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
14387 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
14388 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
14390 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
14391 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
14393 exp->expType = exp->op.exp1->expType;
14394 if(exp->op.exp1->expType)
14395 exp->op.exp1->expType->refCount++;
14397 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14399 exp->expType = exp->op.exp2->expType;
14400 if(exp->op.exp2->expType)
14401 exp->op.exp2->expType->refCount++;
14408 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
14410 struct Type * oldType = exp->op.exp1->expType;
14412 exp->op.exp1->expType = (((void *)0));
14413 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14416 exp->op.exp1->expType = oldType;
14418 if(exp->op.exp1->destType)
14419 FreeType(exp->op.exp1->destType);
14420 exp->op.exp1->destType = type2;
14422 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
14425 FreeType(exp->expType);
14426 exp->expType = exp->op.exp1->destType;
14427 if(exp->op.exp1->destType)
14428 exp->op.exp1->destType->refCount++;
14432 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
14434 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
14436 if(exp->op.exp1->destType)
14437 FreeType(exp->op.exp1->destType);
14438 exp->op.exp1->destType = type2->_class->registered->dataType;
14439 if(type2->_class->registered->dataType)
14440 type2->_class->registered->dataType->refCount++;
14441 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
14443 if(exp->op.op == '!')
14445 exp->expType = MkClassType("bool");
14446 exp->expType->truth = 0x1;
14450 exp->expType = type2;
14455 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
14457 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
14459 if(exp->op.exp2->destType)
14460 FreeType(exp->op.exp2->destType);
14461 exp->op.exp2->destType = type1->_class->registered->dataType;
14462 if(type1->_class->registered->dataType)
14463 type1->_class->registered->dataType->refCount++;
14464 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
14466 exp->expType = type1;
14472 if(exp->op.exp1 && !exp->op.exp1->expType)
14474 char expString[10000];
14476 expString[0] = '\0';
14479 PrintExpression(exp->op.exp1, expString);
14480 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14483 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14485 if(exp->op.exp2 && !exp->op.exp2->expType)
14487 char expString[10240];
14489 expString[0] = '\0';
14492 PrintExpression(exp->op.exp2, expString);
14493 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14496 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14500 FreeType(exp->expType);
14501 exp->expType = MkClassType("bool");
14502 exp->expType->truth = 0x1;
14504 if(exp->op.op != SIZEOF)
14505 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
14506 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
14508 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
14510 yylloc = oldyylloc;
14517 struct Expression * e;
14519 exp->isConstant = 0x1;
14520 for(e = (*exp->list).first; e; e = e->next)
14522 unsigned int inced = 0x0;
14526 FreeType(e->destType);
14527 e->destType = exp->destType;
14530 exp->destType->refCount++;
14531 e->destType->count++;
14535 ProcessExpressionType(e);
14537 exp->destType->count--;
14538 if(!exp->expType && !e->next)
14540 exp->expType = e->expType;
14542 e->expType->refCount++;
14545 exp->isConstant = 0x0;
14547 e = (*exp->list).first;
14548 if(!e->next && e->type == 8)
14550 struct Expression * next = exp->next, * prev = exp->prev;
14552 FreeType(exp->expType);
14553 FreeType(exp->destType);
14554 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14558 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
14559 ProcessExpressionType(exp);
14565 struct Expression * e;
14567 exp->isConstant = 0x1;
14568 ProcessExpressionType(exp->index.exp);
14569 if(!exp->index.exp->isConstant)
14570 exp->isConstant = 0x0;
14571 if(exp->index.exp->expType)
14573 struct Type * source = exp->index.exp->expType;
14575 if(source->kind == 8 && source->_class && source->_class->registered)
14577 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
14578 struct __ecereNameSpace__ecere__com__Class * c = _class->templateClass ? _class->templateClass : _class;
14580 if(_class != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(c, containerClass) && _class->templateArgs)
14582 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
14583 if(exp->index.index && (*exp->index.index).last)
14585 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
14590 for(e = (*exp->index.index).first; e; e = e->next)
14592 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
14595 FreeType(e->destType);
14596 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
14598 ProcessExpressionType(e);
14603 exp->isConstant = 0x0;
14606 exp->expType = Dereference(exp->index.exp->expType);
14608 DeclareType(exp->expType, 0x0, 0x0);
14613 struct Expression * e;
14614 struct Type * functionType;
14615 struct Type * methodType = (((void *)0));
14621 PrintExpression(exp->call.exp, name);
14622 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
14624 PrintExpression(exp->call.exp, name);
14627 if(exp->call.exp->type == 0)
14629 struct Expression * idExp = exp->call.exp;
14630 struct Identifier * id = idExp->identifier;
14632 if(!strcmp(id->string, "__builtin_frame_address"))
14634 exp->expType = ProcessTypeString("void *", 0x1);
14635 if(exp->call.arguments && (*exp->call.arguments).first)
14636 ProcessExpressionType((*exp->call.arguments).first);
14639 else if(!strcmp(id->string, "__ENDIAN_PAD"))
14641 exp->expType = ProcessTypeString("int", 0x1);
14642 if(exp->call.arguments && (*exp->call.arguments).first)
14643 ProcessExpressionType((*exp->call.arguments).first);
14646 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
14648 struct Expression * a = (((void *)0));
14649 struct Expression * b = (((void *)0));
14650 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
14652 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
14654 a = (*exp->call.arguments).first;
14655 b = (*exp->call.arguments).last;
14659 else if((*exp->call.arguments).count == 1)
14661 a = (*exp->call.arguments).first;
14666 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
14667 idExp->identifier = (((void *)0));
14668 FreeExpContents(exp);
14669 ProcessExpressionType(a);
14671 ProcessExpressionType(b);
14673 exp->list = MkList();
14674 if(a->expType && (!b || b->expType))
14676 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
14680 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14681 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
14682 struct Declaration * decl;
14683 char temp1[1024], temp2[1024];
14685 GetTypeSpecs(a->expType, specs);
14686 if(a && !a->isConstant && a->type != 0)
14688 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
14689 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
14690 tempExp1 = QMkExpId(temp1);
14691 tempExp1->expType = a->expType;
14693 a->expType->refCount++;
14694 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
14696 if(b && !b->isConstant && b->type != 0)
14698 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
14699 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
14700 tempExp2 = QMkExpId(temp2);
14701 tempExp2->expType = b->expType;
14703 b->expType->refCount++;
14704 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
14706 decl = MkDeclaration(specs, decls);
14707 if(!curCompound->compound.declarations)
14708 curCompound->compound.declarations = MkList();
14709 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
14713 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
14715 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
14717 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
14718 exp->expType = a->expType;
14720 a->expType->refCount++;
14722 else if(!strcmp(id->string, "Abs"))
14724 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
14725 exp->expType = a->expType;
14727 a->expType->refCount++;
14729 else if(!strcmp(id->string, "Sgn"))
14731 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"))))));
14732 exp->expType = ProcessTypeString("int", 0x0);
14734 FreeExpression(tempExp1);
14736 FreeExpression(tempExp2);
14737 FreeIdentifier(id);
14743 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
14745 if(!exp->call.exp->destType)
14747 exp->call.exp->destType = dummy;
14750 ProcessExpressionType(exp->call.exp);
14751 if(exp->call.exp->destType == dummy)
14754 exp->call.exp->destType = (((void *)0));
14758 functionType = exp->call.exp->expType;
14759 if(functionType && functionType->kind == 16)
14761 methodType = functionType;
14762 functionType = methodType->method->dataType;
14763 if(exp->call.exp->expType->usedClass)
14765 char typeString[1024];
14767 typeString[0] = '\0';
14769 struct Symbol * back = functionType->thisClass;
14771 functionType->thisClass = (((void *)0));
14772 PrintType(functionType, typeString, 0x1, 0x1);
14773 functionType->thisClass = back;
14775 if(strstr(typeString, "thisclass"))
14777 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14778 struct Declarator * decl;
14781 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
14783 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14784 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
14785 thisClassParams = 0x0;
14786 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
14788 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
14790 thisClass = exp->call.exp->expType->usedClass;
14791 ProcessDeclarator(decl);
14792 thisClass = backupThisClass;
14794 thisClassParams = 0x1;
14795 functionType = ProcessType(specs, decl);
14796 functionType->refCount = 0;
14797 FinishTemplatesContext(context);
14799 FreeList(specs, FreeSpecifier);
14800 FreeDeclarator(decl);
14804 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
14806 struct Type * type = functionType->type;
14808 if(!functionType->refCount)
14810 functionType->type = (((void *)0));
14811 FreeType(functionType);
14813 functionType = type;
14815 if(functionType && functionType->kind != 11)
14817 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
14819 else if(functionType)
14821 unsigned int emptyParams = 0x0, noParams = 0x0;
14822 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
14823 struct Type * type = functionType->params.first;
14824 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
14826 struct Location oldyylloc = yylloc;
14830 if(functionType->extraParam && e && functionType->thisClass)
14832 e->destType = MkClassType(functionType->thisClass->string);
14835 if(!functionType->staticMethod && !functionType->extraParam)
14837 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
14839 type = MkClassType(memberExp->member.exp->expType->_class->string);
14842 e->destType = type;
14844 type = functionType->params.first;
14847 type->refCount = 0;
14849 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
14851 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
14852 type->byReference = functionType->byReference;
14853 type->typedByReference = functionType->typedByReference;
14856 if(e->next && type->kind == 8 && (functionType && functionType->thisClass) && functionType->classObjectType == 2)
14858 e->destType = type;
14860 type = functionType->params.first;
14863 type->refCount = 0;
14866 if(type && type->kind == 0)
14869 if(!type->refCount)
14871 type = (((void *)0));
14873 for(; e; e = e->next)
14875 if(!type && !emptyParams)
14878 if(methodType && methodType->methodClass)
14879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14881 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, (*exp->call.arguments).count, noParams ? 0 : functionType->params.count);
14884 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
14886 struct Type * templatedType = (((void *)0));
14887 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
14888 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14891 if(_class && _class->templateArgs)
14893 struct __ecereNameSpace__ecere__com__Class * sClass;
14895 for(sClass = _class; sClass; sClass = sClass->base)
14897 if(sClass->templateClass)
14898 sClass = sClass->templateClass;
14900 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14902 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
14904 struct __ecereNameSpace__ecere__com__Class * nextClass;
14906 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
14908 if(nextClass->templateClass)
14909 nextClass = nextClass->templateClass;
14910 id += nextClass->templateParams.count;
14920 if(curParam && _class->templateArgs[id].dataTypeString)
14922 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
14925 struct Context * context = SetupTemplatesContext(_class);
14927 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
14928 FinishTemplatesContext(context);
14930 e->destType = templatedType;
14933 templatedType->passAsTemplate = 0x1;
14938 e->destType = type;
14945 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
14947 e->destType = type->prev;
14948 e->destType->refCount++;
14952 e->destType = type;
14957 if(type && type->kind != 14)
14959 struct Type * next = type->next;
14961 if(!type->refCount)
14966 if(type && type->kind != 14)
14968 if(methodType && methodType->methodClass)
14969 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for method %s::%s (%d given, expected %d)\n", (((void *)0))), methodType->methodClass->fullName, methodType->method->name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
14971 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough arguments for function %s (%d given, expected %d)\n", (((void *)0))), name, exp->call.arguments ? (*exp->call.arguments).count : 0, functionType->params.count + extra);
14973 yylloc = oldyylloc;
14974 if(type && !type->refCount)
14979 functionType = __extension__ ({
14980 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14982 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
14984 if(exp->call.exp->type == 0)
14986 char * string = exp->call.exp->identifier->string;
14990 struct Symbol * symbol;
14991 struct Location oldyylloc = yylloc;
14993 yylloc = exp->call.exp->identifier->loc;
14994 if(strstr(string, "__builtin_") == string)
14998 functionType->returnType = exp->destType;
14999 exp->destType->refCount++;
15003 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
15004 symbol = __extension__ ({
15005 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
15007 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
15009 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
15010 if(strstr(symbol->string, "::"))
15011 globalContext->hasNameSpace = 0x1;
15012 yylloc = oldyylloc;
15015 else if(exp->call.exp->type == 8)
15019 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
15020 if(!functionType->returnType)
15022 functionType->returnType = __extension__ ({
15023 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15025 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15029 if(functionType && functionType->kind == 11)
15031 exp->expType = functionType->returnType;
15032 if(functionType->returnType)
15033 functionType->returnType->refCount++;
15034 if(!functionType->refCount)
15035 FreeType(functionType);
15037 if(exp->call.arguments)
15039 for(e = (*exp->call.arguments).first; e; e = e->next)
15041 struct Type * destType = e->destType;
15043 ProcessExpressionType(e);
15050 struct Type * type;
15051 struct Location oldyylloc = yylloc;
15052 unsigned int thisPtr;
15053 struct Expression * checkExp = exp->member.exp;
15057 if(checkExp->type == 11)
15058 checkExp = checkExp->cast.exp;
15059 else if(checkExp->type == 5)
15060 checkExp = checkExp->list ? (*checkExp->list).first : (((void *)0));
15064 thisPtr = (checkExp && checkExp->type == 0 && !strcmp(checkExp->identifier->string, "this"));
15065 exp->thisPtr = thisPtr;
15066 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15068 exp->member.member->classSym = exp->member.member->_class->symbol;
15070 ProcessExpressionType(exp->member.exp);
15071 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)
15073 exp->isConstant = 0x0;
15076 exp->isConstant = exp->member.exp->isConstant;
15077 type = exp->member.exp->expType;
15079 if(type && (type->kind == 20))
15081 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15082 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
15086 for(param = _class->templateParams.first; param; param = param->next)
15088 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
15092 if(param && param->defaultArg.member)
15094 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
15098 struct Expression * expMember = exp->member.exp;
15099 struct Declarator * decl;
15100 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15101 char thisClassTypeString[1024];
15103 FreeIdentifier(exp->member.member);
15104 ProcessExpressionType(argExp);
15106 char * colon = strstr(param->defaultArg.memberString, "::");
15110 char className[1024];
15111 struct __ecereNameSpace__ecere__com__Class * sClass;
15113 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
15114 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
15117 strcpy(thisClassTypeString, _class->fullName);
15119 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
15120 exp->expType = ProcessType(specs, decl);
15121 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
15123 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15124 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15126 int paramCount = 0;
15127 int lastParam = -1;
15128 char templateString[1024];
15129 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15131 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15132 for(cClass = expClass; cClass; cClass = cClass->base)
15136 for(param = cClass->templateParams.first; param; param = param->next)
15139 struct __ecereNameSpace__ecere__com__Class * sClass;
15140 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15142 for(sClass = cClass->base; sClass; sClass = sClass->base)
15143 id += sClass->templateParams.count;
15144 arg = expClass->templateArgs[id];
15145 for(sClass = _class; sClass; sClass = sClass->base)
15147 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
15149 struct __ecereNameSpace__ecere__com__Class * nextClass;
15151 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
15152 p += nextClass->templateParams.count;
15153 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
15155 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
15157 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15159 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
15160 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
15167 char argument[256];
15169 argument[0] = '\0';
15170 switch(param->type)
15174 char expString[1024];
15175 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15176 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15177 struct Expression * exp;
15178 char * string = PrintHexUInt64(arg.expression.ui64);
15180 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15181 ProcessExpressionType(exp);
15182 ComputeExpression(exp);
15183 expString[0] = '\0';
15184 PrintExpression(exp, expString);
15185 strcat(argument, expString);
15186 FreeExpression(exp);
15191 strcat(argument, arg.member->name);
15196 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15198 if(!strcmp(arg.dataTypeString, "thisclass"))
15199 strcat(argument, thisClassTypeString);
15201 strcat(argument, arg.dataTypeString);
15209 strcat(templateString, ", ");
15210 if(lastParam != p - 1)
15212 strcat(templateString, param->name);
15213 strcat(templateString, " = ");
15215 strcat(templateString, argument);
15224 int len = strlen(templateString);
15226 if(templateString[len - 1] == '>')
15227 templateString[len++] = ' ';
15228 templateString[len++] = '>';
15229 templateString[len++] = '\0';
15232 struct Context * context = SetupTemplatesContext(_class);
15234 FreeType(exp->expType);
15235 exp->expType = ProcessTypeString(templateString, 0x0);
15236 FinishTemplatesContext(context);
15240 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")))))))));
15243 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
15245 type = ProcessTemplateParameterType(type->templateParameter);
15248 if(type && (type->kind == 20))
15250 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)))
15252 struct Identifier * id = exp->member.member;
15253 int typeKind = type->kind;
15254 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));
15256 if(typeKind == 19 && exp->member.exp->type == 26)
15258 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
15263 if(typeKind == 3 || typeKind == 15)
15264 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
15267 if(type->kind == 8 && type->_class && type->_class->registered)
15269 _class = type->_class->registered;
15271 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
15273 _class = FindClass("char *")->registered;
15275 else if(type->kind == 13)
15277 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
15278 FreeType(exp->expType);
15279 exp->expType = ProcessTypeString("uintptr", 0x0);
15280 exp->byReference = 0x1;
15284 char string[1024] = "";
15285 struct Symbol * classSym;
15287 PrintTypeNoConst(type, string, 0x0, 0x1);
15288 classSym = FindClass(string);
15290 _class = classSym->registered;
15296 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
15297 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
15298 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
15299 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
15300 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
15302 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
15303 exp->member.memberType = 1;
15304 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
15305 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
15308 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
15310 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15311 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
15313 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15315 member = (((void *)0));
15317 if(!member && !prop)
15318 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15319 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
15320 exp->member.thisPtr = 0x1;
15326 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
15327 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15328 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
15330 if(!prop && !member)
15332 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
15335 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
15336 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
15337 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
15342 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
15343 prop = (((void *)0));
15345 member = (((void *)0));
15349 if(!prop && !member && !method)
15350 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
15351 if(!prop && !member && !method)
15355 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
15358 exp->member.memberType = 5;
15359 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
15363 char structName[1024];
15364 struct Identifier * id = exp->member.member;
15365 struct Expression * classExp = exp->member.exp;
15368 FreeType(classExp->expType);
15369 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
15370 strcpy(structName, "__ecereClassData_");
15371 FullClassNameCat(structName, type->_class->string, 0x0);
15373 exp->member.member = id;
15374 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"))))))));
15376 ProcessExpressionType(exp);
15382 struct Symbol * classSym = FindClass(id->string);
15386 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
15389 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
15395 exp->member.memberType = 1;
15396 if(!prop->dataType)
15397 ProcessPropertyType(prop);
15398 exp->expType = prop->dataType;
15400 prop->dataType->refCount++;
15404 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15406 FreeExpContents(exp);
15408 exp->identifier = MkIdentifier("class");
15409 ProcessExpressionType(exp);
15412 exp->member.memberType = 3;
15413 DeclareStruct(_class->fullName, 0x0);
15414 if(!member->dataType)
15416 struct Context * context = SetupTemplatesContext(_class);
15418 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
15419 FinishTemplatesContext(context);
15421 exp->expType = member->dataType;
15422 if(member->dataType)
15423 member->dataType->refCount++;
15425 else if(revConvert)
15427 exp->member.memberType = 4;
15428 exp->expType = MkClassType(revConvert->_class->fullName);
15433 exp->member.memberType = 2;
15435 if(!method->dataType)
15436 ProcessMethodType(method);
15437 exp->expType = __extension__ ({
15438 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15440 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
15442 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
15443 exp->expType->usedClass = _class;
15445 else if(!classProp)
15447 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
15449 FreeExpContents(exp);
15451 exp->identifier = MkIdentifier("class");
15452 ProcessExpressionType(exp);
15455 yylloc = exp->member.member->loc;
15456 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
15458 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
15460 if(_class && exp->expType)
15462 struct __ecereNameSpace__ecere__com__Class * tClass;
15465 while(tClass && !tClass->templateClass)
15466 tClass = tClass->base;
15467 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
15470 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15471 struct __ecereNameSpace__ecere__com__Class * sClass;
15473 for(sClass = tClass; sClass; sClass = sClass->base)
15476 if(sClass->templateClass)
15477 sClass = sClass->templateClass;
15478 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15480 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
15482 for(sClass = sClass->base; sClass; sClass = sClass->base)
15483 id += sClass->templateParams.count;
15491 if(curParam && tClass->templateArgs[id].dataTypeString)
15493 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15494 struct Context * context = SetupTemplatesContext(tClass);
15496 FreeType(exp->expType);
15497 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
15500 if(exp->expType->kind == 21)
15502 FreeType(exp->expType);
15503 exp->expType = ReplaceThisClassType(_class);
15505 if(tClass->templateClass)
15506 exp->expType->passAsTemplate = 0x1;
15509 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
15510 if(exp->destType->kind == 21)
15512 FreeType(exp->destType);
15513 exp->destType = ReplaceThisClassType(_class);
15517 FinishTemplatesContext(context);
15520 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
15523 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
15524 struct __ecereNameSpace__ecere__com__Class * sClass;
15526 for(sClass = tClass; sClass; sClass = sClass->base)
15529 if(sClass->templateClass)
15530 sClass = sClass->templateClass;
15531 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
15533 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
15535 for(sClass = sClass->base; sClass; sClass = sClass->base)
15536 id += sClass->templateParams.count;
15546 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
15547 struct Context * context = SetupTemplatesContext(tClass);
15548 struct Type * basicType;
15550 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
15553 if(basicType->kind == 21)
15555 FreeType(basicType);
15556 basicType = ReplaceThisClassType(_class);
15558 FreeType(exp->expType);
15559 exp->expType = __extension__ ({
15560 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15562 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
15566 exp->destType = exp->expType;
15567 exp->destType->refCount++;
15570 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15571 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15572 struct Declarator * decl;
15574 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
15577 exp->destType->refCount++;
15579 exp->expType->refCount++;
15581 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
15582 exp->cast.exp = newExp;
15585 FinishTemplatesContext(context);
15588 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
15590 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
15594 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
15597 int paramCount = 0;
15598 int lastParam = -1;
15599 char templateString[1024];
15600 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
15602 sprintf(templateString, "%s<", expClass->templateClass->fullName);
15603 while(cClass != expClass)
15605 struct __ecereNameSpace__ecere__com__Class * sClass;
15607 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
15610 for(param = cClass->templateParams.first; param; param = param->next)
15612 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
15615 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
15616 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
15618 while(cClassCur != tClass && !paramCur)
15620 struct __ecereNameSpace__ecere__com__Class * sClassCur;
15622 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
15624 cClassCur = sClassCur;
15625 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
15627 if(!strcmp(paramCur->name, param->name))
15634 if(paramCur && paramCur->type == 0)
15635 arg = tClass->templateArgs[cp];
15637 arg = expClass->templateArgs[p];
15639 char argument[256];
15641 argument[0] = '\0';
15642 switch(param->type)
15646 char expString[1024];
15647 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15648 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
15649 struct Expression * exp;
15650 char * string = PrintHexUInt64(arg.expression.ui64);
15652 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
15653 ProcessExpressionType(exp);
15654 ComputeExpression(exp);
15655 expString[0] = '\0';
15656 PrintExpression(exp, expString);
15657 strcat(argument, expString);
15658 FreeExpression(exp);
15663 strcat(argument, arg.member->name);
15668 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
15669 strcat(argument, arg.dataTypeString);
15676 strcat(templateString, ", ");
15677 if(lastParam != p - 1)
15679 strcat(templateString, param->name);
15680 strcat(templateString, " = ");
15682 strcat(templateString, argument);
15691 int len = strlen(templateString);
15693 if(templateString[len - 1] == '>')
15694 templateString[len++] = ' ';
15695 templateString[len++] = '>';
15696 templateString[len++] = '\0';
15698 FreeType(exp->expType);
15700 struct Context * context = SetupTemplatesContext(tClass);
15702 exp->expType = ProcessTypeString(templateString, 0x0);
15703 FinishTemplatesContext(context);
15710 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "undefined class %s\n", (((void *)0))), (id && (!id->_class || id->_class->name)) ? (id->classSym ? id->classSym->string : (type->_class ? type->_class->string : (((void *)0)))) : "(null)");
15712 else if(type && (type->kind == 9 || type->kind == 10))
15714 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
15718 exp->expType = memberType;
15720 memberType->refCount++;
15725 char expString[10240];
15727 expString[0] = '\0';
15730 PrintExpression(exp, expString);
15731 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15733 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
15735 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
15737 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
15739 struct Identifier * id = exp->member.member;
15740 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));
15744 FreeType(exp->expType);
15745 exp->expType = ReplaceThisClassType(_class);
15749 yylloc = oldyylloc;
15754 struct Type * destType = exp->destType;
15756 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
15758 exp->member.member->classSym = exp->member.member->_class->symbol;
15760 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
15764 ProcessExpressionType(exp);
15771 struct Symbol * classSym = exp->_class->symbol;
15773 if(classSym && classSym->registered)
15775 if(classSym->registered->type == 5)
15780 DeclareStruct(classSym->string, 0x0);
15781 FreeSpecifier(exp->_class);
15783 FullClassNameCat(name, classSym->string, 0x0);
15784 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
15788 if(classSym->registered->fixed)
15790 FreeSpecifier(exp->_class);
15791 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
15796 char className[1024];
15798 strcpy(className, "__ecereClass_");
15799 FullClassNameCat(className, classSym->string, 0x1);
15800 MangleClassName(className);
15801 DeclareClass(classSym, className);
15802 FreeExpContents(exp);
15804 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
15805 exp->member.member = MkIdentifier("structSize");
15809 exp->expType = __extension__ ({
15810 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15812 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15818 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
15820 exp->expType = __extension__ ({
15821 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
15823 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
15825 exp->isConstant = 0x1;
15826 DeclareType(type, 0x0, 0x0);
15832 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
15835 FreeType(exp->cast.exp->destType);
15836 exp->cast.exp->destType = type;
15838 ProcessExpressionType(exp->cast.exp);
15840 exp->expType = type;
15841 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
15843 void * prev = exp->prev, * next = exp->next;
15844 struct Type * expType = exp->cast.exp->destType;
15845 struct Expression * castExp = exp->cast.exp;
15846 struct Type * destType = exp->destType;
15849 expType->refCount++;
15850 FreeType(exp->expType);
15851 FreeTypeName(exp->cast.typeName);
15853 FreeType(exp->expType);
15854 FreeType(exp->destType);
15855 exp->expType = expType;
15856 exp->destType = destType;
15857 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
15863 exp->isConstant = exp->cast.exp->isConstant;
15869 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
15871 exp->expType = type;
15876 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
15878 ProcessExpressionType(exp->vaArg.exp);
15879 exp->expType = type;
15884 struct Expression * e;
15886 exp->isConstant = 0x1;
15887 FreeType(exp->cond.cond->destType);
15888 exp->cond.cond->destType = MkClassType("bool");
15889 exp->cond.cond->destType->truth = 0x1;
15890 ProcessExpressionType(exp->cond.cond);
15891 if(!exp->cond.cond->isConstant)
15892 exp->isConstant = 0x0;
15893 for(e = (*exp->cond.exp).first; e; e = e->next)
15897 FreeType(e->destType);
15898 e->destType = exp->destType;
15900 e->destType->refCount++;
15902 ProcessExpressionType(e);
15905 exp->expType = e->expType;
15907 e->expType->refCount++;
15910 exp->isConstant = 0x0;
15912 FreeType(exp->cond.elseExp->destType);
15913 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
15914 if(exp->cond.elseExp->destType)
15915 exp->cond.elseExp->destType->refCount++;
15916 ProcessExpressionType(exp->cond.elseExp);
15917 if(!exp->cond.elseExp->isConstant)
15918 exp->isConstant = 0x0;
15923 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
15925 struct Statement * last = (*exp->compound->compound.statements).last;
15927 if(last->type == 3 && last->expressions && (*last->expressions).last)
15929 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
15931 exp->destType->refCount++;
15933 ProcessStatement(exp->compound);
15934 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
15936 exp->expType->refCount++;
15942 struct Specifier * spec = (*exp->_classExp.specifiers).first;
15944 if(spec && spec->type == 1)
15946 exp->expType = MkClassType(spec->name);
15947 exp->expType->kind = 19;
15948 exp->byReference = 0x1;
15952 exp->expType = MkClassType("ecere::com::Class");
15953 exp->byReference = 0x1;
15959 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
15963 struct Identifier * id = exp->classData.id;
15964 char structName[1024];
15965 struct Expression * classExp;
15967 strcpy(structName, "__ecereClassData_");
15968 FullClassNameCat(structName, _class->fullName, 0x0);
15970 exp->member.member = id;
15971 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
15972 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
15974 classExp = MkExpIdentifier(MkIdentifier("class"));
15975 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"))))))));
15976 ProcessExpressionType(exp);
15983 struct Type * type = (((void *)0));
15984 char * typeString = (((void *)0));
15985 char typeStringBuf[1024];
15987 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))
15989 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
15991 typeString = templateClass->templateArgs[2].dataTypeString;
15995 struct Expression * e;
15997 for(e = (*exp->list).first; e; e = e->next)
15999 ProcessExpressionType(e);
16009 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16013 e->expType = (((void *)0));
16014 e = (*exp->list).first;
16015 ProcessExpressionType(e);
16018 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
16020 FreeType(e->expType);
16021 e->expType = (((void *)0));
16023 type = (((void *)0));
16031 FreeType(e->expType);
16032 e->expType = (((void *)0));
16038 typeStringBuf[0] = '\0';
16039 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
16040 typeString = typeStringBuf;
16042 type = (((void *)0));
16047 char templateString[1024];
16048 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
16049 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
16050 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16051 struct Expression * expExt;
16052 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16054 sprintf(templateString, "Container<%s>", typeString);
16057 struct Expression * e;
16059 type = ProcessTypeString(typeString, 0x0);
16060 while(e = (*exp->list).first)
16062 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
16063 e->destType = type;
16065 ProcessExpressionType(e);
16066 ListAdd(initializers, MkInitializerAssignment(e));
16069 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
16071 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
16072 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
16073 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16074 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
16075 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16076 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
16077 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16078 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
16079 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16080 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
16081 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16083 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
16085 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16086 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
16087 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
16088 exp->expType = ProcessTypeString(templateString, 0x0);
16090 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
16091 ProcessExpressionType(expExt);
16095 exp->expType = ProcessTypeString("Container", 0x0);
16096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
16101 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
16103 FreeType(exp->expType);
16104 exp->expType = ReplaceThisClassType(thisClass);
16106 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
16108 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
16112 if(exp->expType->kind != 15)
16114 struct Type * member;
16115 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
16117 FreeType(exp->expType);
16118 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16119 exp->expType->kind = symbol->type->kind;
16120 exp->expType->refCount++;
16121 exp->expType->enumName = enumName;
16122 exp->expType->members = symbol->type->members;
16123 for(member = symbol->type->members.first; member; member = member->next)
16124 member->refCount++;
16128 struct __ecereNameSpace__ecere__sys__NamedLink * member;
16130 for(member = symbol->type->members.first; member; member = member->next)
16132 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
16134 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
16140 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
16142 else if(exp->destType && !exp->destType->keepCast)
16144 if(!CheckExpressionType(exp, exp->destType, 0x0))
16146 if(!exp->destType->count || unresolved)
16151 if(exp->destType->kind != 14)
16158 char expString[10240];
16160 expString[0] = '\0';
16161 PrintType(exp->destType, type2, 0x0, 0x1);
16164 PrintExpression(exp, expString);
16165 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
16169 else if(exp->type != 16)
16170 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
16175 char expString[10240];
16177 expString[0] = '\0';
16180 PrintExpression(exp, expString);
16181 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
16185 else if(exp->type != 16)
16186 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16198 PrintType(exp->expType, type1, 0x0, 0x1);
16199 PrintType(exp->destType, type2, 0x0, 0x1);
16201 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)))
16205 char expString[10240];
16207 expString[0] = '\0';
16210 PrintExpression(exp, expString);
16211 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16213 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
16214 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
16215 FreeType(exp->expType);
16216 exp->destType->refCount++;
16217 exp->expType = exp->destType;
16222 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
16224 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
16225 char typeString[1024];
16226 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16227 struct Declarator * decl;
16229 typeString[0] = '\0';
16232 exp->expType->refCount++;
16234 exp->expType->refCount++;
16236 newExp->destType = exp->expType;
16237 PrintType(exp->expType, typeString, 0x0, 0x0);
16238 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
16239 exp->cast.typeName = MkTypeName(specs, decl);
16240 exp->cast.exp = newExp;
16243 else if(unresolved)
16245 if(exp->identifier->_class && exp->identifier->_class->name)
16246 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
16247 else if(exp->identifier->string && exp->identifier->string[0])
16248 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
16250 else if(!exp->expType && exp->type != 16)
16252 char expString[10240];
16254 expString[0] = '\0';
16257 PrintExpression(exp, expString);
16258 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
16260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
16263 ApplyAnyObjectLogic(exp);
16264 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)))
16266 exp->byReference = 0x1;
16268 yylloc = oldyylloc;
16271 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)
16275 *curMember = (*curMember)->next;
16276 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
16278 *curMember = subMemberStack[--(*subMemberStackPos)];
16279 *curMember = (*curMember)->next;
16281 while((*curMember) && (*curMember)->isProperty)
16282 *curMember = (*curMember)->next;
16283 if(subMemberStackPos)
16285 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16287 subMemberStack[(*subMemberStackPos)++] = *curMember;
16288 *curMember = (*curMember)->members.first;
16289 while(*curMember && (*curMember)->isProperty)
16290 *curMember = (*curMember)->next;
16298 if(subMemberStackPos && *subMemberStackPos)
16300 *curMember = subMemberStack[--(*subMemberStackPos)];
16301 *curMember = (*curMember)->next;
16305 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
16307 if(*curClass == _class)
16309 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
16311 *curMember = (*curClass)->membersAndProperties.first;
16313 while((*curMember) && (*curMember)->isProperty)
16314 *curMember = (*curMember)->next;
16315 if(subMemberStackPos)
16317 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
16319 subMemberStack[(*subMemberStackPos)++] = *curMember;
16320 *curMember = (*curMember)->members.first;
16321 while(*curMember && (*curMember)->isProperty)
16322 *curMember = (*curMember)->next;
16329 static void ProcessInitializer(struct Initializer * init, struct Type * type)
16334 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
16336 if(init->exp && !init->exp->destType)
16338 FreeType(init->exp->destType);
16339 init->exp->destType = type;
16345 ProcessExpressionType(init->exp);
16346 init->isConstant = init->exp->isConstant;
16352 struct Expression * exp = init->exp;
16353 struct Instantiation * inst = exp->instance;
16354 struct MembersInit * members;
16357 init->list = MkList();
16360 for(members = (*inst->members).first; members; members = members->next)
16362 if(members->type == 0)
16364 struct MemberInit * member;
16366 for(member = (*members->dataMembers).first; member; member = member->next)
16368 ListAdd(init->list, member->initializer);
16369 member->initializer = (((void *)0));
16374 FreeExpression(exp);
16378 struct Initializer * i;
16379 struct Type * initializerType = (((void *)0));
16380 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
16381 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
16382 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
16383 int subMemberStackPos = 0;
16385 if(type && type->kind == 12)
16386 initializerType = Dereference(type);
16387 else if(type && (type->kind == 9 || type->kind == 10))
16388 initializerType = type->members.first;
16389 for(i = (*init->list).first; i; i = i->next)
16391 if(type && type->kind == 8 && type->_class && type->_class->registered)
16393 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
16396 if(!curMember->dataType)
16397 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
16398 initializerType = curMember->dataType;
16401 ProcessInitializer(i, initializerType);
16402 if(initializerType && type && (type->kind == 9 || type->kind == 10))
16403 initializerType = initializerType->next;
16405 init->isConstant = 0x0;
16407 if(type && type->kind == 12)
16408 FreeType(initializerType);
16409 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
16411 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
16418 extern struct Symbol * FindType(struct Context * ctx, char * name);
16420 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
16422 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
16428 if(spec->specifier == THISCLASS)
16433 spec->name = ReplaceThisClass(thisClass);
16434 spec->symbol = FindClass(spec->name);
16435 ProcessSpecifier(spec, declareStruct);
16442 struct Symbol * symbol = FindType(curContext, spec->name);
16445 DeclareType(symbol->type, 0x1, 0x1);
16446 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
16447 DeclareStruct(spec->name, 0x0);
16452 struct Enumerator * e;
16456 for(e = (*spec->list).first; e; e = e->next)
16459 ProcessExpressionType(e->exp);
16467 if(spec->definitions)
16469 struct ClassDef * def;
16470 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
16472 ProcessClass(spec->definitions, symbol);
16479 static void ProcessDeclarator(struct Declarator * decl)
16484 if(decl->identifier->classSym)
16486 FreeSpecifier(decl->identifier->_class);
16487 decl->identifier->_class = (((void *)0));
16491 if(decl->array.exp)
16492 ProcessExpressionType(decl->array.exp);
16499 if(decl->declarator)
16500 ProcessDeclarator(decl->declarator);
16501 if(decl->type == 4)
16503 struct Identifier * id = GetDeclId(decl);
16505 if(id && id->_class)
16507 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
16509 if(!decl->function.parameters)
16510 decl->function.parameters = MkList();
16511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
16512 id->_class = (((void *)0));
16514 if(decl->function.parameters)
16516 struct TypeName * param;
16518 for(param = (*decl->function.parameters).first; param; param = param->next)
16520 if(param->qualifiers && (*param->qualifiers).first)
16522 struct Specifier * spec = (*param->qualifiers).first;
16524 if(spec && spec->specifier == TYPED_OBJECT)
16526 struct Declarator * d = param->declarator;
16527 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);
16529 FreeList(param->qualifiers, FreeSpecifier);
16530 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
16531 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
16532 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
16535 else if(spec && spec->specifier == ANY_OBJECT)
16537 struct Declarator * d = param->declarator;
16539 FreeList(param->qualifiers, FreeSpecifier);
16540 param->qualifiers = MkListOne(MkSpecifier(VOID));
16541 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
16543 else if(spec->specifier == THISCLASS)
16548 spec->name = ReplaceThisClass(thisClass);
16549 spec->symbol = FindClass(spec->name);
16550 ProcessSpecifier(spec, 0x0);
16554 if(param->declarator)
16555 ProcessDeclarator(param->declarator);
16563 extern struct Identifier * CopyIdentifier(struct Identifier * id);
16565 extern void FreeInitDeclarator(struct InitDeclarator * decl);
16567 static void ProcessDeclaration(struct Declaration * decl)
16569 yylloc = decl->loc;
16574 unsigned int declareStruct = 0x0;
16576 if(decl->declarators)
16578 struct InitDeclarator * d;
16580 for(d = (*decl->declarators).first; d; d = d->next)
16582 struct Type * type, * subType;
16584 ProcessDeclarator(d->declarator);
16585 type = ProcessType(decl->specifiers, d->declarator);
16588 ProcessInitializer(d->initializer, type);
16589 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
16591 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
16593 struct Instantiation * inst = d->initializer->exp->instance;
16595 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
16596 d->initializer->exp->instance = (((void *)0));
16597 if(decl->specifiers)
16598 FreeList(decl->specifiers, FreeSpecifier);
16599 FreeList(decl->declarators, FreeInitDeclarator);
16606 for(subType = type; subType; )
16608 if(subType->kind == 8)
16610 declareStruct = 0x1;
16613 else if(subType->kind == 13)
16615 else if(subType->kind == 12)
16616 subType = subType->arrayType;
16625 if(decl->specifiers)
16627 struct Specifier * s;
16629 for(s = (*decl->specifiers).first; s; s = s->next)
16631 ProcessSpecifier(s, declareStruct);
16638 ProcessInstantiationType(decl->inst);
16643 struct Specifier * spec;
16644 struct Declarator * d;
16645 unsigned int declareStruct = 0x0;
16647 if(decl->declarators)
16649 for(d = (*decl->declarators).first; d; d = d->next)
16651 struct Type * type = ProcessType(decl->specifiers, d->declarator);
16652 struct Type * subType;
16654 ProcessDeclarator(d);
16655 for(subType = type; subType; )
16657 if(subType->kind == 8)
16659 declareStruct = 0x1;
16662 else if(subType->kind == 13)
16664 else if(subType->kind == 12)
16665 subType = subType->arrayType;
16672 if(decl->specifiers)
16674 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
16675 ProcessSpecifier(spec, declareStruct);
16682 static struct FunctionDefinition * curFunction;
16684 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
16686 char propName[1024], propNameM[1024];
16687 char getName[1024], setName[1024];
16688 struct __ecereNameSpace__ecere__sys__OldList * args;
16690 DeclareProperty(prop, setName, getName);
16691 strcpy(propName, "__ecereProp_");
16692 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16693 strcat(propName, "_");
16694 FullClassNameCat(propName, prop->name, 0x1);
16695 MangleClassName(propName);
16696 strcpy(propNameM, "__ecerePropM_");
16697 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
16698 strcat(propNameM, "_");
16699 FullClassNameCat(propNameM, prop->name, 0x1);
16700 MangleClassName(propNameM);
16701 if(prop->isWatchable)
16704 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16705 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16706 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16708 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16709 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16710 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
16714 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16715 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16716 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16718 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
16719 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
16720 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
16722 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16723 curFunction->propSet->fireWatchersDone = 0x1;
16726 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
16728 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
16730 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
16732 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
16734 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
16736 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
16738 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
16740 extern void FreePropertyWatch(struct PropertyWatch * watcher);
16742 static void ProcessStatement(struct Statement * stmt)
16744 yylloc = stmt->loc;
16748 ProcessStatement(stmt->labeled.stmt);
16751 if(stmt->caseStmt.exp)
16753 FreeType(stmt->caseStmt.exp->destType);
16754 stmt->caseStmt.exp->destType = curSwitchType;
16756 curSwitchType->refCount++;
16757 ProcessExpressionType(stmt->caseStmt.exp);
16758 ComputeExpression(stmt->caseStmt.exp);
16760 if(stmt->caseStmt.stmt)
16761 ProcessStatement(stmt->caseStmt.stmt);
16765 if(stmt->compound.context)
16767 struct Declaration * decl;
16768 struct Statement * s;
16769 struct Statement * prevCompound = curCompound;
16770 struct Context * prevContext = curContext;
16772 if(!stmt->compound.isSwitch)
16773 curCompound = stmt;
16774 curContext = stmt->compound.context;
16775 if(stmt->compound.declarations)
16777 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
16778 ProcessDeclaration(decl);
16780 if(stmt->compound.statements)
16782 for(s = (*stmt->compound.statements).first; s; s = s->next)
16783 ProcessStatement(s);
16785 curContext = prevContext;
16786 curCompound = prevCompound;
16792 struct Expression * exp;
16794 if(stmt->expressions)
16796 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16797 ProcessExpressionType(exp);
16803 struct Expression * exp;
16805 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
16806 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
16807 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
16808 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
16810 ProcessExpressionType(exp);
16812 if(stmt->ifStmt.stmt)
16813 ProcessStatement(stmt->ifStmt.stmt);
16814 if(stmt->ifStmt.elseStmt)
16815 ProcessStatement(stmt->ifStmt.elseStmt);
16820 struct Type * oldSwitchType = curSwitchType;
16822 if(stmt->switchStmt.exp)
16824 struct Expression * exp;
16826 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
16830 ProcessExpressionType(exp);
16833 curSwitchType = exp->expType;
16836 ProcessStatement(stmt->switchStmt.stmt);
16837 curSwitchType = oldSwitchType;
16842 if(stmt->whileStmt.exp)
16844 struct Expression * exp;
16846 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
16847 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
16848 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
16849 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
16851 ProcessExpressionType(exp);
16854 if(stmt->whileStmt.stmt)
16855 ProcessStatement(stmt->whileStmt.stmt);
16860 if(stmt->doWhile.exp)
16862 struct Expression * exp;
16864 if((*stmt->doWhile.exp).last)
16866 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
16867 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
16868 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
16870 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
16872 ProcessExpressionType(exp);
16875 if(stmt->doWhile.stmt)
16876 ProcessStatement(stmt->doWhile.stmt);
16881 struct Expression * exp;
16883 if(stmt->forStmt.init)
16884 ProcessStatement(stmt->forStmt.init);
16885 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
16887 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
16888 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
16889 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
16891 if(stmt->forStmt.check)
16892 ProcessStatement(stmt->forStmt.check);
16893 if(stmt->forStmt.increment)
16895 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
16896 ProcessExpressionType(exp);
16898 if(stmt->forStmt.stmt)
16899 ProcessStatement(stmt->forStmt.stmt);
16904 struct Identifier * id = stmt->forEachStmt.id;
16905 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
16906 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
16907 struct Statement * block = stmt->forEachStmt.stmt;
16908 char iteratorType[1024];
16909 struct Type * source;
16910 struct Expression * e;
16911 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));
16912 struct Expression * arrayExp;
16913 char * typeString = (((void *)0));
16914 int builtinCount = 0;
16916 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
16920 FreeType(e->destType);
16921 e->destType = ProcessTypeString("Container", 0x0);
16923 if(!isBuiltin || e->next)
16924 ProcessExpressionType(e);
16926 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
16927 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
16929 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
16930 struct Symbol * symbol;
16931 struct Expression * expIt = (((void *)0));
16932 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
16933 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
16934 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
16935 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
16938 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
16939 stmt->compound.context->parent = curContext;
16940 curContext = stmt->compound.context;
16941 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
16943 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
16944 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
16946 isCustomAVLTree = 0x1;
16947 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
16949 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
16952 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
16954 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
16956 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
16959 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
16963 struct Declarator * decl;
16964 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
16966 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
16967 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
16968 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
16972 struct Type * type = (((void *)0));
16973 char typeStringBuf[1024];
16975 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
16976 if(((struct Expression *)(*exp).last)->type == 11)
16978 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
16981 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
16983 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)
16985 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
16987 typeString = templateClass->templateArgs[2].dataTypeString;
16989 else if(arrayExp->list)
16991 struct Expression * e;
16993 for(e = (*arrayExp->list).first; e; e = e->next)
16995 ProcessExpressionType(e);
17005 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17009 e->expType = (((void *)0));
17010 e = (*arrayExp->list).first;
17011 ProcessExpressionType(e);
17014 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
17016 FreeType(e->expType);
17017 e->expType = (((void *)0));
17019 type = (((void *)0));
17027 FreeType(e->expType);
17028 e->expType = (((void *)0));
17034 typeStringBuf[0] = '\0';
17035 PrintType(type, typeStringBuf, 0x0, 0x1);
17036 typeString = typeStringBuf;
17042 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
17043 struct Declarator * decl;
17044 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17048 struct Expression * e;
17050 builtinCount = (*arrayExp->list).count;
17051 type = ProcessTypeString(typeString, 0x0);
17052 while(e = (*arrayExp->list).first)
17054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
17055 e->destType = type;
17057 ProcessExpressionType(e);
17058 ListAdd(initializers, MkInitializerAssignment(e));
17061 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
17063 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
17064 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
17065 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
17066 FreeList(exp, FreeExpression);
17070 arrayExp->expType = ProcessTypeString("Container", 0x0);
17071 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
17074 else if(isLinkList && !isList)
17076 struct Declarator * decl;
17077 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17079 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
17080 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
17081 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
17083 else if(_class->templateArgs)
17086 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
17088 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
17089 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
17091 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
17094 switch(block->type)
17097 if(block->compound.context)
17098 block->compound.context->parent = stmt->compound.context;
17101 if(block->ifStmt.stmt && block->ifStmt.stmt->type == 2 && block->ifStmt.stmt->compound.context)
17102 block->ifStmt.stmt->compound.context->parent = stmt->compound.context;
17103 if(block->ifStmt.elseStmt && block->ifStmt.elseStmt->type == 2 && block->ifStmt.elseStmt->compound.context)
17104 block->ifStmt.elseStmt->compound.context->parent = stmt->compound.context;
17107 if(block->switchStmt.stmt && block->switchStmt.stmt->type == 2 && block->switchStmt.stmt->compound.context)
17108 block->switchStmt.stmt->compound.context->parent = stmt->compound.context;
17111 if(block->whileStmt.stmt && block->whileStmt.stmt->type == 2 && block->whileStmt.stmt->compound.context)
17112 block->whileStmt.stmt->compound.context->parent = stmt->compound.context;
17115 if(block->doWhile.stmt && block->doWhile.stmt->type == 2 && block->doWhile.stmt->compound.context)
17116 block->doWhile.stmt->compound.context->parent = stmt->compound.context;
17119 if(block->forStmt.stmt && block->forStmt.stmt->type == 2 && block->forStmt.stmt->compound.context)
17120 block->forStmt.stmt->compound.context->parent = stmt->compound.context;
17123 if(block->forEachStmt.stmt && block->forEachStmt.stmt->type == 2 && block->forEachStmt.stmt->compound.context)
17124 block->forEachStmt.stmt->compound.context->parent = stmt->compound.context;
17130 block = MkIfStmt(filter, block, (((void *)0)));
17134 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));
17135 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17136 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17137 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17143 sprintf(count, "%d", builtinCount);
17144 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));
17145 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17146 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17147 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17149 else if(isLinkList && !isList)
17151 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
17152 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
17154 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
17156 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));
17160 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
17161 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
17163 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));
17165 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
17166 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
17167 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
17171 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
17173 ProcessExpressionType(expIt);
17174 if((*stmt->compound.declarations).first)
17175 ProcessDeclaration((*stmt->compound.declarations).first);
17177 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
17178 ProcessStatement(stmt);
17179 curContext = stmt->compound.context->parent;
17184 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
17196 struct Expression * exp;
17198 if(stmt->expressions)
17200 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
17204 if(curFunction && !curFunction->type)
17205 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
17206 FreeType(exp->destType);
17207 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
17209 exp->destType->refCount++;
17211 ProcessExpressionType(exp);
17218 ProcessDeclaration(stmt->decl);
17223 struct AsmField * field;
17225 if(stmt->asmStmt.inputFields)
17227 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
17228 if(field->expression)
17229 ProcessExpressionType(field->expression);
17231 if(stmt->asmStmt.outputFields)
17233 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
17234 if(field->expression)
17235 ProcessExpressionType(field->expression);
17237 if(stmt->asmStmt.clobberedFields)
17239 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
17241 if(field->expression)
17242 ProcessExpressionType(field->expression);
17249 struct PropertyWatch * propWatch;
17250 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17251 struct Expression * object = stmt->_watch.object;
17252 struct Expression * watcher = stmt->_watch.watcher;
17255 ProcessExpressionType(watcher);
17257 ProcessExpressionType(object);
17260 if(watcher || thisClass)
17262 struct External * external = curExternal;
17263 struct Context * context = curContext;
17266 stmt->expressions = MkList();
17267 curExternal = external->prev;
17268 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17270 struct ClassFunction * func;
17271 char watcherName[1024];
17272 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
17273 struct External * createdExternal;
17274 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
17276 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
17277 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
17278 if(propWatch->deleteWatch)
17279 strcat(watcherName, "_delete");
17282 struct Identifier * propID;
17284 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17286 strcat(watcherName, "_");
17287 strcat(watcherName, propID->string);
17290 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
17292 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
17293 ProcessClassFunctionBody(func, propWatch->compound);
17294 propWatch->compound = (((void *)0));
17295 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
17296 createdExternal->symbol->idCode = external->symbol->idCode;
17297 curExternal = createdExternal;
17298 ProcessFunction(createdExternal->function);
17300 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
17302 externalDecl->declaration = decl;
17303 if(decl->symbol && !decl->symbol->pointerExternal)
17304 decl->symbol->pointerExternal = externalDecl;
17306 if(propWatch->deleteWatch)
17308 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17310 ListAdd(args, CopyExpression(object));
17311 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17312 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17313 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
17317 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
17318 struct Identifier * propID;
17320 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
17322 char propName[1024];
17323 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17327 char getName[1024], setName[1024];
17328 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17330 DeclareProperty(prop, setName, getName);
17331 strcpy(propName, "__ecereProp_");
17332 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17333 strcat(propName, "_");
17334 FullClassNameCat(propName, prop->name, 0x1);
17335 ListAdd(args, CopyExpression(object));
17336 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17337 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17338 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
17339 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
17342 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17347 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
17349 curExternal = external;
17350 curContext = context;
17352 FreeExpression(watcher);
17354 FreeExpression(object);
17355 FreeList(watches, FreePropertyWatch);
17358 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
17362 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
17364 ProcessStatement(propWatch->compound);
17371 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17372 struct Expression * object = stmt->_watch.object;
17373 struct __ecereNameSpace__ecere__com__Class * _class;
17376 ProcessExpressionType(object);
17379 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
17382 struct Identifier * propID;
17385 stmt->expressions = MkList();
17386 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
17388 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
17395 for(propID = (*watches).first; propID; propID = propID->next)
17397 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17401 CreateFireWatcher(prop, object, stmt);
17404 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
17409 struct __ecereNameSpace__ecere__com__Property * prop;
17410 struct __ecereNameSpace__ecere__com__Class * base;
17412 for(base = _class; base; base = base->base)
17414 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
17416 if(prop->isProperty && prop->isWatchable)
17418 CreateFireWatcher(prop, object, stmt);
17424 FreeExpression(object);
17425 FreeList(watches, FreeIdentifier);
17428 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17434 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
17435 struct Expression * object = stmt->_watch.object;
17436 struct Expression * watcher = stmt->_watch.watcher;
17437 struct __ecereNameSpace__ecere__com__Class * _class;
17440 ProcessExpressionType(object);
17442 ProcessExpressionType(watcher);
17445 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
17446 if(watcher || thisClass)
17450 struct Identifier * propID;
17453 stmt->expressions = MkList();
17456 struct __ecereNameSpace__ecere__sys__OldList * args;
17459 ListAdd(args, CopyExpression(object));
17460 ListAdd(args, MkExpConstant("0"));
17461 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17462 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17466 for(propID = (*watches).first; propID; propID = propID->next)
17468 char propName[1024];
17469 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
17473 char getName[1024], setName[1024];
17474 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
17476 DeclareProperty(prop, setName, getName);
17477 strcpy(propName, "__ecereProp_");
17478 FullClassNameCat(propName, prop->_class->fullName, 0x0);
17479 strcat(propName, "_");
17480 FullClassNameCat(propName, prop->name, 0x1);
17481 MangleClassName(propName);
17482 ListAdd(args, CopyExpression(object));
17483 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
17484 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
17485 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
17488 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
17492 FreeExpression(object);
17494 FreeExpression(watcher);
17495 FreeList(watches, FreeIdentifier);
17498 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
17501 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
17508 extern struct Expression * QBrackets(struct Expression * exp);
17510 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
17512 extern struct Declarator * QMkPtrDecl(char * id);
17514 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
17516 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
17518 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
17520 static void ProcessFunction(struct FunctionDefinition * function)
17522 struct Identifier * id = GetDeclId(function->declarator);
17523 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
17524 struct Type * type = symbol ? symbol->type : (((void *)0));
17525 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
17526 struct Context * oldTopContext = topContext;
17528 yylloc = function->loc;
17529 if(type && type->thisClass)
17531 struct Symbol * classSym = type->thisClass;
17532 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
17533 char className[1024];
17534 char structName[1024];
17535 struct Declarator * funcDecl;
17536 struct Symbol * thisSymbol;
17537 unsigned int typedObject = 0x0;
17539 if(_class && !_class->base)
17541 _class = currentClass;
17542 if(_class && !_class->symbol)
17543 _class->symbol = FindClass(_class->fullName);
17544 classSym = _class ? _class->symbol : (((void *)0));
17547 thisClass = _class;
17548 if(inCompiler && _class)
17550 if(type->kind == 11)
17552 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
17554 struct Type * param = symbol->type->params.first;
17556 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
17559 if(type->classObjectType != 1)
17561 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
17562 symbol->type->staticMethod = 0x1;
17563 symbol->type->thisClass = (((void *)0));
17564 symbol->type->extraParam = 0x0;
17567 strcpy(className, "__ecereClass_");
17568 FullClassNameCat(className, _class->fullName, 0x1);
17569 MangleClassName(className);
17570 structName[0] = (char)0;
17571 FullClassNameCat(structName, _class->fullName, 0x0);
17572 funcDecl = GetFuncDecl(function->declarator);
17575 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17577 struct TypeName * param = (*funcDecl->function.parameters).first;
17579 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17581 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17582 FreeTypeName(param);
17585 if(!function->propertyNoThis)
17587 struct TypeName * thisParam;
17589 if(type->classObjectType != 1)
17591 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17592 if(!funcDecl->function.parameters)
17593 funcDecl->function.parameters = MkList();
17594 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17598 if(type->classObjectType != 1)
17600 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
17601 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
17603 thisParam = __extension__ ({
17604 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
17606 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
17608 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17612 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17614 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17616 funcDecl = GetFuncDecl(initDecl->declarator);
17619 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
17621 struct TypeName * param = (*funcDecl->function.parameters).first;
17623 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
17625 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
17626 FreeTypeName(param);
17629 if(type->classObjectType != 1)
17631 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
17633 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
17635 if(!funcDecl->function.parameters)
17636 funcDecl->function.parameters = MkList();
17637 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
17645 if(type->classObjectType != 1)
17647 thisSymbol = __extension__ ({
17648 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17650 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
17652 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17653 if(typedObject && thisSymbol->type)
17655 thisSymbol->type->classObjectType = 2;
17656 thisSymbol->type->byReference = type->byReference;
17657 thisSymbol->type->typedByReference = type->byReference;
17661 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
17663 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
17666 struct __ecereNameSpace__ecere__com__Class * base;
17668 for(base = _class; base && base->type != 1000; base = base->next)
17670 for(member = base->membersAndProperties.first; member; member = member->next)
17671 if(!member->isProperty)
17677 for(member = _class->membersAndProperties.first; member; member = member->next)
17678 if(!member->isProperty)
17682 char pointerName[1024];
17683 struct Declaration * decl;
17684 struct Initializer * initializer;
17685 struct Expression * exp, * bytePtr;
17687 strcpy(pointerName, "__ecerePointer_");
17688 FullClassNameCat(pointerName, _class->fullName, 0x0);
17690 char className[1024];
17692 strcpy(className, "__ecereClass_");
17693 FullClassNameCat(className, classSym->string, 0x1);
17694 MangleClassName(className);
17695 DeclareClass(classSym, className);
17697 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
17702 sprintf(string, "%d", _class->offset);
17703 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
17707 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
17709 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
17710 exp->expType = __extension__ ({
17711 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17713 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
17714 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
17716 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
17717 }), __ecereInstance2;
17721 yylloc = function->body->loc;
17722 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
17724 struct Context * prevContext = curContext;
17726 curContext = function->body->compound.context;
17727 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
17728 curContext = prevContext;
17730 decl->symbol = (((void *)0));
17731 if(!function->body->compound.declarations)
17732 function->body->compound.declarations = MkList();
17733 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
17739 thisClass = (((void *)0));
17742 FreeSpecifier(id->_class);
17743 id->_class = (((void *)0));
17744 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
17746 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
17748 id = GetDeclId(initDecl->declarator);
17749 FreeSpecifier(id->_class);
17750 id->_class = (((void *)0));
17754 topContext = function->body->compound.context;
17756 struct FunctionDefinition * oldFunction = curFunction;
17758 curFunction = function;
17760 ProcessStatement(function->body);
17761 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
17763 struct Statement * prevCompound = curCompound;
17764 struct Context * prevContext = curContext;
17765 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
17767 if(!function->body->compound.statements)
17768 function->body->compound.statements = MkList();
17769 ListAdd(function->body->compound.statements, fireWatchers);
17770 curCompound = function->body;
17771 curContext = function->body->compound.context;
17772 ProcessStatement(fireWatchers);
17773 curContext = prevContext;
17774 curCompound = prevCompound;
17776 curFunction = oldFunction;
17778 if(function->declarator)
17780 ProcessDeclarator(function->declarator);
17782 topContext = oldTopContext;
17783 thisClass = oldThisClass;
17786 extern void FreeSymbol(struct Symbol * symbol);
17788 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
17790 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
17792 struct ClassDef * def;
17793 struct External * external = curExternal;
17794 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
17796 for(def = definitions->first; def; def = def->next)
17800 if(def->function->declarator)
17801 curExternal = def->function->declarator->symbol->pointerExternal;
17803 curExternal = external;
17804 ProcessFunction((struct FunctionDefinition *)def->function);
17806 else if(def->type == 2)
17808 if(def->decl->type == 2)
17810 thisClass = regClass;
17811 ProcessInstantiationType(def->decl->inst);
17812 thisClass = (((void *)0));
17816 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
17819 thisClass = regClass;
17820 ProcessDeclaration(def->decl);
17821 thisClass = backThisClass;
17824 else if(def->type == 1 && def->defProperties)
17826 struct MemberInit * defProperty;
17827 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);
17829 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17830 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
17832 thisClass = regClass;
17833 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
17834 thisClass = (((void *)0));
17836 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17837 FreeSymbol(thisSymbol);
17839 else if(def->type == 3 && def->propertyDef)
17841 struct PropertyDef * prop = def->propertyDef;
17843 thisClass = regClass;
17848 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17850 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17852 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
17853 ProcessStatement(prop->setStmt);
17859 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17861 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17863 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
17864 ProcessStatement(prop->getStmt);
17866 if(prop->issetStmt)
17870 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
17872 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17874 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
17875 ProcessStatement(prop->issetStmt);
17877 thisClass = (((void *)0));
17879 else if(def->type == 4 && def->propertyWatch)
17881 struct PropertyWatch * propertyWatch = def->propertyWatch;
17883 thisClass = regClass;
17884 if(propertyWatch->compound)
17886 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);
17888 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
17889 curExternal = (((void *)0));
17890 ProcessStatement(propertyWatch->compound);
17892 thisClass = (((void *)0));
17897 void DeclareFunctionUtil(char * s)
17899 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
17906 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
17907 strcpy(name, "__ecereFunction_");
17908 FullClassNameCat(name, s, 0x0);
17909 DeclareFunction(function, name);
17913 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
17915 void ComputeDataTypes()
17917 struct External * external;
17918 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
17919 struct External * after = (((void *)0));
17921 currentClass = (((void *)0));
17922 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
17923 for(external = (*ast).first; external; external = external->next)
17925 if(external->type == 1)
17927 struct Declaration * decl = external->declaration;
17931 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
17935 struct InitDeclarator * initDecl = (*decls).first;
17939 struct Declarator * declarator = initDecl->declarator;
17941 if(declarator && declarator->type == 1)
17943 struct Identifier * id = declarator->identifier;
17945 if(id && id->string)
17947 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
17949 external->symbol->id = -1001, external->symbol->idCode = -1001;
17959 temp->symbol = __extension__ ({
17960 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
17962 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
17964 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
17965 curExternal = temp;
17966 DeclareFunctionUtil("eSystem_New");
17967 DeclareFunctionUtil("eSystem_New0");
17968 DeclareFunctionUtil("eSystem_Renew");
17969 DeclareFunctionUtil("eSystem_Renew0");
17970 DeclareFunctionUtil("eClass_GetProperty");
17971 DeclareStruct("ecere::com::Class", 0x0);
17972 DeclareStruct("ecere::com::Instance", 0x0);
17973 DeclareStruct("ecere::com::Property", 0x0);
17974 DeclareStruct("ecere::com::DataMember", 0x0);
17975 DeclareStruct("ecere::com::Method", 0x0);
17976 DeclareStruct("ecere::com::SerialBuffer", 0x0);
17977 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
17978 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
17979 for(external = (*ast).first; external; external = external->next)
17981 afterExternal = curExternal = external;
17982 if(external->type == 0)
17984 currentClass = external->function->_class;
17985 ProcessFunction(external->function);
17987 else if(external->type == 1)
17989 currentClass = (((void *)0));
17990 ProcessDeclaration(external->declaration);
17992 else if(external->type == 2)
17994 struct ClassDefinition * _class = external->_class;
17996 currentClass = external->symbol->registered;
17997 if(_class->definitions)
17999 ProcessClass(_class->definitions, _class->symbol);
18003 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
18004 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
18007 else if(external->type == 4)
18009 thisNameSpace = external->id->string;
18012 currentClass = (((void *)0));
18013 thisNameSpace = (((void *)0));
18014 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
18015 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
18018 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);
18020 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);
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)