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 } __attribute__ ((gcc_struct));
808 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
810 struct __ecereNameSpace__ecere__com__Class
812 struct __ecereNameSpace__ecere__com__Class * prev;
813 struct __ecereNameSpace__ecere__com__Class * next;
819 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
820 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
823 struct __ecereNameSpace__ecere__com__Class * base;
824 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
825 struct __ecereNameSpace__ecere__sys__BinaryTree members;
826 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
827 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
828 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
829 struct __ecereNameSpace__ecere__sys__OldList derivatives;
833 struct __ecereNameSpace__ecere__com__Instance * module;
834 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
835 char * dataTypeString;
836 struct Type * dataType;
838 int defaultAlignment;
839 void (* Initialize)();
841 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
842 char * designerClass;
843 unsigned int noExpansion;
844 char * defaultProperty;
845 unsigned int comRedefinition;
847 unsigned int isRemote;
848 unsigned int internalDecl;
850 unsigned int computeSize;
852 int destructionWatchOffset;
854 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
855 int inheritanceAccess;
858 struct __ecereNameSpace__ecere__sys__OldList conversions;
859 struct __ecereNameSpace__ecere__sys__OldList templateParams;
860 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
861 struct __ecereNameSpace__ecere__com__Class * templateClass;
862 struct __ecereNameSpace__ecere__sys__OldList templatized;
864 unsigned int isInstanceClass;
865 } __attribute__ ((gcc_struct));
867 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
869 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
871 struct __ecereNameSpace__ecere__com__Instance
874 struct __ecereNameSpace__ecere__com__Class * _class;
876 } __attribute__ ((gcc_struct));
878 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
880 struct __ecereNameSpace__ecere__com__DataMember
882 struct __ecereNameSpace__ecere__com__DataMember * prev;
883 struct __ecereNameSpace__ecere__com__DataMember * next;
885 unsigned int isProperty;
888 struct __ecereNameSpace__ecere__com__Class * _class;
889 char * dataTypeString;
890 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
891 struct Type * dataType;
895 struct __ecereNameSpace__ecere__sys__OldList members;
896 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
899 } __attribute__ ((gcc_struct));
901 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
903 struct __ecereNameSpace__ecere__com__SerialBuffer
905 unsigned char * _buffer;
909 } __attribute__ ((gcc_struct));
911 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
913 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
919 char * dataTypeString;
920 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
921 } __attribute__ ((gcc_struct));
922 struct __ecereNameSpace__ecere__com__DataValue expression;
928 struct __ecereNameSpace__ecere__com__DataMember * member;
929 struct __ecereNameSpace__ecere__com__Property * prop;
930 struct __ecereNameSpace__ecere__com__Method * method;
931 } __attribute__ ((gcc_struct));
932 } __attribute__ ((gcc_struct));
933 } __attribute__ ((gcc_struct));
934 } __attribute__ ((gcc_struct));
936 void exit(int status);
938 void * calloc(size_t nmemb, size_t size);
940 void free(void * ptr);
942 void * malloc(size_t size);
944 void * realloc(void * ptr, size_t size);
946 long int strtol(const char * nptr, char ** endptr, int base);
948 long long int strtoll(const char * nptr, char ** endptr, int base);
950 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
954 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
957 typedef union YYSTYPE
962 struct Identifier * id;
963 struct Expression * exp;
964 struct Specifier * specifier;
965 struct __ecereNameSpace__ecere__sys__OldList * list;
966 struct Enumerator * enumerator;
967 struct Declarator * declarator;
968 struct Pointer * pointer;
969 struct Initializer * initializer;
970 struct InitDeclarator * initDeclarator;
971 struct TypeName * typeName;
972 struct Declaration * declaration;
973 struct Statement * stmt;
974 struct FunctionDefinition * function;
975 struct External * external;
976 struct Context * context;
977 struct AsmField * asmField;
978 struct Attrib * attrib;
979 struct ExtDecl * extDecl;
980 struct Attribute * attribute;
981 struct Instantiation * instance;
982 struct MembersInit * membersInit;
983 struct MemberInit * memberInit;
984 struct ClassFunction * classFunction;
985 struct ClassDefinition * _class;
986 struct ClassDef * classDef;
987 struct PropertyDef * prop;
989 struct Symbol * symbol;
990 struct PropertyWatch * propertyWatch;
991 struct TemplateParameter * templateParameter;
992 struct TemplateArgument * templateArgument;
993 struct TemplateDatatype * templateDatatype;
994 struct DBTableEntry * dbtableEntry;
995 struct DBIndexItem * dbindexItem;
996 struct DBTableDef * dbtableDef;
997 } __attribute__ ((gcc_struct)) YYSTYPE;
999 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
1003 struct Enumerator * prev;
1004 struct Enumerator * next;
1005 struct Location loc;
1006 struct Identifier * id;
1007 struct Expression * exp;
1008 } __attribute__ ((gcc_struct));
1010 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1012 struct InitDeclarator
1014 struct InitDeclarator * prev;
1015 struct InitDeclarator * next;
1016 struct Location loc;
1017 struct Declarator * declarator;
1018 struct Initializer * initializer;
1019 } __attribute__ ((gcc_struct));
1021 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1025 struct AsmField * prev;
1026 struct AsmField * next;
1027 struct Location loc;
1029 struct Expression * expression;
1030 } __attribute__ ((gcc_struct));
1032 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1036 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1038 struct ClassFunction
1040 struct ClassFunction * prev;
1041 struct ClassFunction * next;
1042 struct Location loc;
1043 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1044 struct Declarator * declarator;
1045 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1046 struct Statement * body;
1047 struct __ecereNameSpace__ecere__com__Class * _class;
1048 struct __ecereNameSpace__ecere__sys__OldList attached;
1051 struct Symbol * propSet;
1052 unsigned int isVirtual;
1053 unsigned int isConstructor;
1054 unsigned int isDestructor;
1055 unsigned int dontMangle;
1058 } __attribute__ ((gcc_struct));
1060 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1064 struct MembersInit * prev;
1065 struct MembersInit * next;
1066 struct Location loc;
1070 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1071 struct ClassFunction * function;
1072 } __attribute__ ((gcc_struct));
1073 } __attribute__ ((gcc_struct));
1075 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1079 struct MemberInit * prev;
1080 struct MemberInit * next;
1081 struct Location loc;
1082 struct Location realLoc;
1083 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1084 struct Initializer * initializer;
1086 unsigned int variable;
1087 unsigned int takeOutExp;
1088 } __attribute__ ((gcc_struct));
1090 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1094 struct PropertyDef * prev;
1095 struct PropertyDef * next;
1096 struct Location loc;
1097 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1098 struct Declarator * declarator;
1099 struct Identifier * id;
1100 struct Statement * getStmt;
1101 struct Statement * setStmt;
1102 struct Statement * issetStmt;
1103 struct Symbol * symbol;
1104 unsigned int conversion;
1105 unsigned int isWatchable;
1106 struct Expression * category;
1107 } __attribute__ ((gcc_struct));
1109 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1111 struct PropertyWatch
1113 struct PropertyWatch * prev;
1114 struct PropertyWatch * next;
1115 struct Location loc;
1116 struct Statement * compound;
1117 struct __ecereNameSpace__ecere__sys__OldList * properties;
1118 unsigned int deleteWatch;
1119 } __attribute__ ((gcc_struct));
1121 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1125 struct ClassDef * prev;
1126 struct ClassDef * next;
1127 struct Location loc;
1131 struct Declaration * decl;
1132 struct ClassFunction * function;
1133 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1134 struct PropertyDef * propertyDef;
1135 struct PropertyWatch * propertyWatch;
1137 struct Identifier * defaultProperty;
1140 struct Identifier * id;
1141 struct Initializer * initializer;
1142 } __attribute__ ((gcc_struct));
1143 } __attribute__ ((gcc_struct));
1146 } __attribute__ ((gcc_struct));
1148 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1150 struct DBTableEntry;
1152 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1156 extern YYSTYPE yylval;
1158 extern struct Location yylloc;
1160 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1162 extern int returnCode;
1164 extern struct Expression * parsedExpression;
1166 extern unsigned int yydebug;
1168 void SetYydebug(unsigned int b)
1173 extern unsigned int echoOn;
1175 void resetScanner();
1179 int expression_yyparse();
1181 static struct Statement * curCompound;
1183 struct External * curExternal, * afterExternal;
1185 static struct Type * curSwitchType;
1187 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1189 struct __ecereNameSpace__ecere__com__Class * thisClass;
1191 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1196 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1201 static char * thisNameSpace;
1203 struct __ecereNameSpace__ecere__com__Class * containerClass;
1205 unsigned int thisClassParams = 0x1;
1207 unsigned int internalValueCounter;
1209 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1211 extern size_t strlen(const char * );
1213 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1215 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1217 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1219 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1221 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1223 void PrintExpression(struct Expression * exp, char * string)
1226 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1230 OutputExpression(exp, f);
1231 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1232 count = strlen(string);
1233 count += ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(f, string + count, 1, 1023);
1234 string[count] = '\0';
1235 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1239 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1241 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1243 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1245 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1247 if(!param->baseType)
1249 if(param->dataTypeString)
1250 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1252 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1254 return param->baseType;
1256 return (((void *)0));
1259 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1261 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1263 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1267 if(type1->kind == type2->kind)
1277 if(type1->passAsTemplate && !type2->passAsTemplate)
1279 return type1->isSigned != type2->isSigned;
1281 return type1->_class != type2->_class;
1283 return NeedCast(type1->type, type2->type);
1291 extern int strcmp(const char * , const char * );
1293 extern struct Context * curContext;
1295 extern struct Context * topContext;
1297 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1299 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);
1301 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1303 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);
1305 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);
1307 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1309 struct __ecereNameSpace__ecere__com__ClassProperty
1312 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1313 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1314 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1316 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1317 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1318 char * dataTypeString;
1319 struct Type * dataType;
1320 unsigned int constant;
1321 } __attribute__ ((gcc_struct));
1323 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1325 extern struct Expression * QMkExpId(char * id);
1327 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1329 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1331 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1332 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1337 char * dataTypeString;
1339 } __attribute__ ((gcc_struct));
1340 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1342 } __attribute__ ((gcc_struct));
1344 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1346 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1348 extern void FreeIdentifier(struct Identifier * id);
1350 void ProcessExpressionType(struct Expression * exp);
1352 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1354 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1356 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1358 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1360 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1362 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1364 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1366 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1368 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1370 if(exp->type == 0 && exp->identifier)
1372 struct Identifier * id = exp->identifier;
1373 struct Context * ctx;
1374 struct Symbol * symbol = (((void *)0));
1376 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1378 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1380 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1385 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1387 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1388 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1389 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1390 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1394 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1396 if(!prop && !method)
1397 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1398 if(!prop && !method && !member)
1400 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1402 if(prop || method || member || classProp)
1405 exp->member.member = id;
1406 exp->member.memberType = 0;
1407 exp->member.exp = QMkExpId("this");
1408 exp->addedThis = 0x1;
1410 else if(_class && _class->templateParams.first)
1412 struct __ecereNameSpace__ecere__com__Class * sClass;
1414 for(sClass = _class; sClass; sClass = sClass->base)
1416 if(sClass->templateParams.first)
1418 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1420 for(param = sClass->templateParams.first; param; param = param->next)
1422 if(param->type == 2 && !strcmp(param->name, id->string))
1424 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1428 struct Declarator * decl;
1429 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1431 FreeIdentifier(exp->member.member);
1432 ProcessExpressionType(argExp);
1433 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1434 exp->expType = ProcessType(specs, decl);
1436 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1447 extern int sprintf(char * , char * , ...);
1449 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1451 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1453 char * PrintInt(long long result)
1457 if(result > (((long long)0x7fffffffffffffffLL)))
1458 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1460 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1461 return __ecereNameSpace__ecere__sys__CopyString(temp);
1464 char * PrintUInt(uint64 result)
1468 if(result > (0xffffffff))
1469 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1470 else if(result > (((int)0x7fffffff)))
1471 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1473 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1474 return __ecereNameSpace__ecere__sys__CopyString(temp);
1477 char * PrintInt64(long long result)
1481 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1482 return __ecereNameSpace__ecere__sys__CopyString(temp);
1485 char * PrintUInt64(uint64 result)
1489 if(result > (((long long)0x7fffffffffffffffLL)))
1490 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1492 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1493 return __ecereNameSpace__ecere__sys__CopyString(temp);
1496 char * PrintHexUInt(uint64 result)
1500 if(result > (0xffffffff))
1501 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1503 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1504 return __ecereNameSpace__ecere__sys__CopyString(temp);
1507 char * PrintHexUInt64(uint64 result)
1511 if(result > (0xffffffff))
1512 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1514 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1515 return __ecereNameSpace__ecere__sys__CopyString(temp);
1518 char * PrintShort(short result)
1522 sprintf(temp, "%d", (unsigned short)result);
1523 return __ecereNameSpace__ecere__sys__CopyString(temp);
1526 char * PrintUShort(unsigned short result)
1530 if(result > (unsigned short)32767)
1531 sprintf(temp, "0x%X", (int)result);
1533 sprintf(temp, "%d", (int)result);
1534 return __ecereNameSpace__ecere__sys__CopyString(temp);
1537 extern int isprint(int c);
1539 char * PrintChar(char result)
1543 if(result > (char)0 && isprint(result))
1544 sprintf(temp, "'%c'", result);
1545 else if(result < (char)0)
1546 sprintf(temp, "%d", (int)result);
1548 sprintf(temp, "0x%X", (unsigned char)result);
1549 return __ecereNameSpace__ecere__sys__CopyString(temp);
1552 char * PrintUChar(unsigned char result)
1556 sprintf(temp, "0x%X", result);
1557 return __ecereNameSpace__ecere__sys__CopyString(temp);
1560 char * PrintFloat(float result)
1564 sprintf(temp, "%.16ff", result);
1565 return __ecereNameSpace__ecere__sys__CopyString(temp);
1568 char * PrintDouble(double result)
1572 sprintf(temp, "%.16f", result);
1573 return __ecereNameSpace__ecere__sys__CopyString(temp);
1576 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1580 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1581 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1582 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1583 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1584 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1585 unsigned int (* Neg)(struct Expression *, struct Operand *);
1586 unsigned int (* Inc)(struct Expression *, struct Operand *);
1587 unsigned int (* Dec)(struct Expression *, struct Operand *);
1588 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1590 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1596 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1599 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1600 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1602 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* Not)(struct Expression *, struct Operand *);
1606 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1611 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1612 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1613 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1614 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1615 } __attribute__ ((gcc_struct));
1617 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1623 unsigned int ptrSize;
1636 } __attribute__ ((gcc_struct));
1638 } __attribute__ ((gcc_struct));
1640 struct Operand GetOperand(struct Expression * exp);
1642 unsigned int GetInt(struct Expression * exp, int * value2)
1644 struct Operand op2 = GetOperand(exp);
1646 if(op2.kind == 3 && op2.type->isSigned)
1648 else if(op2.kind == 3)
1649 *value2 = (int)op2.ui;
1650 else if(op2.kind == 4 && op2.type->isSigned)
1651 *value2 = (int)op2.i64;
1652 else if(op2.kind == 4)
1653 *value2 = (int)op2.ui64;
1654 else if(op2.kind == 23 && op2.type->isSigned)
1655 *value2 = (int)op2.i64;
1656 else if(op2.kind == 23)
1657 *value2 = (int)op2.ui64;
1658 else if(op2.kind == 22 && op2.type->isSigned)
1659 *value2 = (int)op2.i64;
1660 else if(op2.kind == 22)
1661 *value2 = (int)op2.ui64;
1662 else if(op2.kind == 2 && op2.type->isSigned)
1663 *value2 = (int)op2.s;
1664 else if(op2.kind == 2)
1665 *value2 = (int)op2.us;
1666 else if(op2.kind == 1 && op2.type->isSigned)
1667 *value2 = (int)op2.c;
1668 else if(op2.kind == 1)
1669 *value2 = (int)op2.uc;
1670 else if(op2.kind == 6)
1671 *value2 = (int)op2.f;
1672 else if(op2.kind == 7)
1673 *value2 = (int)op2.d;
1674 else if(op2.kind == 13)
1675 *value2 = (int)op2.ui64;
1681 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1683 struct Operand op2 = GetOperand(exp);
1685 if(op2.kind == 3 && op2.type->isSigned)
1686 *value2 = (unsigned int)op2.i;
1687 else if(op2.kind == 3)
1689 else if(op2.kind == 4 && op2.type->isSigned)
1690 *value2 = (unsigned int)op2.i64;
1691 else if(op2.kind == 4)
1692 *value2 = (unsigned int)op2.ui64;
1693 else if(op2.kind == 23 && op2.type->isSigned)
1694 *value2 = (unsigned int)op2.i64;
1695 else if(op2.kind == 23)
1696 *value2 = (unsigned int)op2.ui64;
1697 else if(op2.kind == 22 && op2.type->isSigned)
1698 *value2 = (unsigned int)op2.i64;
1699 else if(op2.kind == 22)
1700 *value2 = (unsigned int)op2.ui64;
1701 else if(op2.kind == 2 && op2.type->isSigned)
1702 *value2 = (unsigned int)op2.s;
1703 else if(op2.kind == 2)
1704 *value2 = (unsigned int)op2.us;
1705 else if(op2.kind == 1 && op2.type->isSigned)
1706 *value2 = (unsigned int)op2.c;
1707 else if(op2.kind == 1)
1708 *value2 = (unsigned int)op2.uc;
1709 else if(op2.kind == 6)
1710 *value2 = (unsigned int)op2.f;
1711 else if(op2.kind == 7)
1712 *value2 = (unsigned int)op2.d;
1713 else if(op2.kind == 13)
1714 *value2 = (unsigned int)op2.ui64;
1720 unsigned int GetInt64(struct Expression * exp, long long * value2)
1722 struct Operand op2 = GetOperand(exp);
1724 if(op2.kind == 3 && op2.type->isSigned)
1725 *value2 = (long long)op2.i;
1726 else if(op2.kind == 3)
1727 *value2 = (long long)op2.ui;
1728 else if(op2.kind == 4 && op2.type->isSigned)
1730 else if(op2.kind == 4)
1731 *value2 = (long long)op2.ui64;
1732 else if(op2.kind == 23 && op2.type->isSigned)
1734 else if(op2.kind == 23)
1735 *value2 = (long long)op2.ui64;
1736 else if(op2.kind == 22 && op2.type->isSigned)
1738 else if(op2.kind == 22)
1739 *value2 = (long long)op2.ui64;
1740 else if(op2.kind == 2 && op2.type->isSigned)
1741 *value2 = (long long)op2.s;
1742 else if(op2.kind == 2)
1743 *value2 = (long long)op2.us;
1744 else if(op2.kind == 1 && op2.type->isSigned)
1745 *value2 = (long long)op2.c;
1746 else if(op2.kind == 1)
1747 *value2 = (long long)op2.uc;
1748 else if(op2.kind == 6)
1749 *value2 = (long long)op2.f;
1750 else if(op2.kind == 7)
1751 *value2 = (long long)op2.d;
1752 else if(op2.kind == 13)
1753 *value2 = (long long)op2.ui64;
1759 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1761 struct Operand op2 = GetOperand(exp);
1763 if(op2.kind == 3 && op2.type->isSigned)
1764 *value2 = (uint64)op2.i;
1765 else if(op2.kind == 3)
1766 *value2 = (uint64)op2.ui;
1767 else if(op2.kind == 4 && op2.type->isSigned)
1768 *value2 = (uint64)op2.i64;
1769 else if(op2.kind == 4)
1771 else if(op2.kind == 23 && op2.type->isSigned)
1772 *value2 = (uint64)op2.i64;
1773 else if(op2.kind == 23)
1775 else if(op2.kind == 22 && op2.type->isSigned)
1776 *value2 = (uint64)op2.i64;
1777 else if(op2.kind == 22)
1779 else if(op2.kind == 2 && op2.type->isSigned)
1780 *value2 = (uint64)op2.s;
1781 else if(op2.kind == 2)
1782 *value2 = (uint64)op2.us;
1783 else if(op2.kind == 1 && op2.type->isSigned)
1784 *value2 = (uint64)op2.c;
1785 else if(op2.kind == 1)
1786 *value2 = (uint64)op2.uc;
1787 else if(op2.kind == 6)
1788 *value2 = (uint64)op2.f;
1789 else if(op2.kind == 7)
1790 *value2 = (uint64)op2.d;
1791 else if(op2.kind == 13)
1798 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1800 struct Operand op2 = GetOperand(exp);
1802 if(op2.kind == 3 && op2.type->isSigned)
1803 *value2 = (intptr_t)op2.i;
1804 else if(op2.kind == 3)
1805 *value2 = (intptr_t)op2.ui;
1806 else if(op2.kind == 4 && op2.type->isSigned)
1807 *value2 = (intptr_t)op2.i64;
1808 else if(op2.kind == 4)
1809 *value2 = (intptr_t)op2.ui64;
1810 else if(op2.kind == 23 && op2.type->isSigned)
1811 *value2 = (intptr_t)op2.i64;
1812 else if(op2.kind == 23)
1813 *value2 = (intptr_t)op2.ui64;
1814 else if(op2.kind == 22 && op2.type->isSigned)
1815 *value2 = (intptr_t)op2.i64;
1816 else if(op2.kind == 22)
1817 *value2 = (intptr_t)op2.ui64;
1818 else if(op2.kind == 2 && op2.type->isSigned)
1819 *value2 = (intptr_t)op2.s;
1820 else if(op2.kind == 2)
1821 *value2 = (intptr_t)op2.us;
1822 else if(op2.kind == 1 && op2.type->isSigned)
1823 *value2 = (intptr_t)op2.c;
1824 else if(op2.kind == 1)
1825 *value2 = (intptr_t)op2.uc;
1826 else if(op2.kind == 6)
1827 *value2 = (intptr_t)op2.f;
1828 else if(op2.kind == 7)
1829 *value2 = (intptr_t)op2.d;
1830 else if(op2.kind == 13)
1831 *value2 = (intptr_t)op2.ui64;
1837 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1839 struct Operand op2 = GetOperand(exp);
1841 if(op2.kind == 3 && op2.type->isSigned)
1842 *value2 = (uintptr_t)op2.i;
1843 else if(op2.kind == 3)
1844 *value2 = (uintptr_t)op2.ui;
1845 else if(op2.kind == 4 && op2.type->isSigned)
1846 *value2 = (uintptr_t)op2.i64;
1847 else if(op2.kind == 4)
1848 *value2 = (uintptr_t)op2.ui64;
1849 else if(op2.kind == 23 && op2.type->isSigned)
1850 *value2 = (uintptr_t)op2.i64;
1851 else if(op2.kind == 23)
1852 *value2 = (uintptr_t)op2.ui64;
1853 else if(op2.kind == 22 && op2.type->isSigned)
1854 *value2 = (uintptr_t)op2.i64;
1855 else if(op2.kind == 22)
1856 *value2 = (uintptr_t)op2.ui64;
1857 else if(op2.kind == 2 && op2.type->isSigned)
1858 *value2 = (uintptr_t)op2.s;
1859 else if(op2.kind == 2)
1860 *value2 = (uintptr_t)op2.us;
1861 else if(op2.kind == 1 && op2.type->isSigned)
1862 *value2 = (uintptr_t)op2.c;
1863 else if(op2.kind == 1)
1864 *value2 = (uintptr_t)op2.uc;
1865 else if(op2.kind == 6)
1866 *value2 = (uintptr_t)op2.f;
1867 else if(op2.kind == 7)
1868 *value2 = (uintptr_t)op2.d;
1869 else if(op2.kind == 13)
1870 *value2 = (uintptr_t)op2.ui64;
1876 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1878 struct Operand op2 = GetOperand(exp);
1880 if(op2.kind == 3 && op2.type->isSigned)
1881 *value2 = (ssize_t)op2.i;
1882 else if(op2.kind == 3)
1883 *value2 = (ssize_t)op2.ui;
1884 else if(op2.kind == 4 && op2.type->isSigned)
1885 *value2 = (ssize_t)op2.i64;
1886 else if(op2.kind == 4)
1887 *value2 = (ssize_t)op2.ui64;
1888 else if(op2.kind == 23 && op2.type->isSigned)
1889 *value2 = (ssize_t)op2.i64;
1890 else if(op2.kind == 23)
1891 *value2 = (ssize_t)op2.ui64;
1892 else if(op2.kind == 22 && op2.type->isSigned)
1893 *value2 = (ssize_t)op2.i64;
1894 else if(op2.kind == 22)
1895 *value2 = (ssize_t)op2.ui64;
1896 else if(op2.kind == 2 && op2.type->isSigned)
1897 *value2 = (ssize_t)op2.s;
1898 else if(op2.kind == 2)
1899 *value2 = (ssize_t)op2.us;
1900 else if(op2.kind == 1 && op2.type->isSigned)
1901 *value2 = (ssize_t)op2.c;
1902 else if(op2.kind == 1)
1903 *value2 = (ssize_t)op2.uc;
1904 else if(op2.kind == 6)
1905 *value2 = (ssize_t)op2.f;
1906 else if(op2.kind == 7)
1907 *value2 = (ssize_t)op2.d;
1908 else if(op2.kind == 13)
1909 *value2 = (ssize_t)op2.ui64;
1915 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1917 struct Operand op2 = GetOperand(exp);
1919 if(op2.kind == 3 && op2.type->isSigned)
1920 *value2 = (size_t)op2.i;
1921 else if(op2.kind == 3)
1922 *value2 = (size_t)op2.ui;
1923 else if(op2.kind == 4 && op2.type->isSigned)
1924 *value2 = (size_t)op2.i64;
1925 else if(op2.kind == 4)
1926 *value2 = (size_t)op2.ui64;
1927 else if(op2.kind == 23 && op2.type->isSigned)
1928 *value2 = (size_t)op2.i64;
1929 else if(op2.kind == 23)
1930 *value2 = (size_t)op2.ui64;
1931 else if(op2.kind == 22 && op2.type->isSigned)
1932 *value2 = (size_t)op2.i64;
1933 else if(op2.kind == 22)
1934 *value2 = (size_t)op2.ui64;
1935 else if(op2.kind == 2 && op2.type->isSigned)
1936 *value2 = (size_t)op2.s;
1937 else if(op2.kind == 2)
1938 *value2 = (size_t)op2.us;
1939 else if(op2.kind == 1 && op2.type->isSigned)
1940 *value2 = (size_t)op2.c;
1941 else if(op2.kind == 1)
1942 *value2 = (size_t)op2.uc;
1943 else if(op2.kind == 6)
1944 *value2 = (size_t)op2.f;
1945 else if(op2.kind == 7)
1946 *value2 = (size_t)op2.d;
1947 else if(op2.kind == 13)
1948 *value2 = (size_t)op2.ui64;
1954 unsigned int GetShort(struct Expression * exp, short * value2)
1956 struct Operand op2 = GetOperand(exp);
1958 if(op2.kind == 3 && op2.type->isSigned)
1959 *value2 = (short)op2.i;
1960 else if(op2.kind == 3)
1961 *value2 = (short)op2.ui;
1962 else if(op2.kind == 4 && op2.type->isSigned)
1963 *value2 = (short)op2.i64;
1964 else if(op2.kind == 4)
1965 *value2 = (short)op2.ui64;
1966 else if(op2.kind == 23 && op2.type->isSigned)
1967 *value2 = (short)op2.i64;
1968 else if(op2.kind == 23)
1969 *value2 = (short)op2.ui64;
1970 else if(op2.kind == 22 && op2.type->isSigned)
1971 *value2 = (short)op2.i64;
1972 else if(op2.kind == 22)
1973 *value2 = (short)op2.ui64;
1974 else if(op2.kind == 2 && op2.type->isSigned)
1976 else if(op2.kind == 2)
1977 *value2 = (short)op2.us;
1978 else if(op2.kind == 1 && op2.type->isSigned)
1979 *value2 = (short)op2.c;
1980 else if(op2.kind == 1)
1981 *value2 = (short)op2.uc;
1982 else if(op2.kind == 6)
1983 *value2 = (short)op2.f;
1984 else if(op2.kind == 7)
1985 *value2 = (short)op2.d;
1986 else if(op2.kind == 13)
1987 *value2 = (short)op2.ui64;
1993 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1995 struct Operand op2 = GetOperand(exp);
1997 if(op2.kind == 3 && op2.type->isSigned)
1998 *value2 = (unsigned short)op2.i;
1999 else if(op2.kind == 3)
2000 *value2 = (unsigned short)op2.ui;
2001 else if(op2.kind == 4 && op2.type->isSigned)
2002 *value2 = (unsigned short)op2.i64;
2003 else if(op2.kind == 4)
2004 *value2 = (unsigned short)op2.ui64;
2005 else if(op2.kind == 23 && op2.type->isSigned)
2006 *value2 = (unsigned short)op2.i64;
2007 else if(op2.kind == 23)
2008 *value2 = (unsigned short)op2.ui64;
2009 else if(op2.kind == 22 && op2.type->isSigned)
2010 *value2 = (unsigned short)op2.i64;
2011 else if(op2.kind == 22)
2012 *value2 = (unsigned short)op2.ui64;
2013 else if(op2.kind == 2 && op2.type->isSigned)
2014 *value2 = (unsigned short)op2.s;
2015 else if(op2.kind == 2)
2017 else if(op2.kind == 1 && op2.type->isSigned)
2018 *value2 = (unsigned short)op2.c;
2019 else if(op2.kind == 1)
2020 *value2 = (unsigned short)op2.uc;
2021 else if(op2.kind == 6)
2022 *value2 = (unsigned short)op2.f;
2023 else if(op2.kind == 7)
2024 *value2 = (unsigned short)op2.d;
2025 else if(op2.kind == 13)
2026 *value2 = (unsigned short)op2.ui64;
2032 unsigned int GetChar(struct Expression * exp, char * value2)
2034 struct Operand op2 = GetOperand(exp);
2036 if(op2.kind == 3 && op2.type->isSigned)
2037 *value2 = (char)op2.i;
2038 else if(op2.kind == 3)
2039 *value2 = (char)op2.ui;
2040 else if(op2.kind == 4 && op2.type->isSigned)
2041 *value2 = (char)op2.i64;
2042 else if(op2.kind == 4)
2043 *value2 = (char)op2.ui64;
2044 else if(op2.kind == 23 && op2.type->isSigned)
2045 *value2 = (char)op2.i64;
2046 else if(op2.kind == 23)
2047 *value2 = (char)op2.ui64;
2048 else if(op2.kind == 22 && op2.type->isSigned)
2049 *value2 = (char)op2.i64;
2050 else if(op2.kind == 22)
2051 *value2 = (char)op2.ui64;
2052 else if(op2.kind == 2 && op2.type->isSigned)
2053 *value2 = (char)op2.s;
2054 else if(op2.kind == 2)
2055 *value2 = (char)op2.us;
2056 else if(op2.kind == 1 && op2.type->isSigned)
2058 else if(op2.kind == 1)
2059 *value2 = (char)op2.uc;
2060 else if(op2.kind == 6)
2061 *value2 = (char)op2.f;
2062 else if(op2.kind == 7)
2063 *value2 = (char)op2.d;
2064 else if(op2.kind == 13)
2065 *value2 = (char)op2.ui64;
2071 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2073 struct Operand op2 = GetOperand(exp);
2075 if(op2.kind == 3 && op2.type->isSigned)
2076 *value2 = (unsigned char)op2.i;
2077 else if(op2.kind == 3)
2078 *value2 = (unsigned char)op2.ui;
2079 else if(op2.kind == 4 && op2.type->isSigned)
2080 *value2 = (unsigned char)op2.i64;
2081 else if(op2.kind == 4)
2082 *value2 = (unsigned char)op2.ui64;
2083 else if(op2.kind == 23 && op2.type->isSigned)
2084 *value2 = (unsigned char)op2.i64;
2085 else if(op2.kind == 23)
2086 *value2 = (unsigned char)op2.ui64;
2087 else if(op2.kind == 22 && op2.type->isSigned)
2088 *value2 = (unsigned char)op2.i64;
2089 else if(op2.kind == 22)
2090 *value2 = (unsigned char)op2.ui64;
2091 else if(op2.kind == 2 && op2.type->isSigned)
2092 *value2 = (unsigned char)op2.s;
2093 else if(op2.kind == 2)
2094 *value2 = (unsigned char)op2.us;
2095 else if(op2.kind == 1 && op2.type->isSigned)
2096 *value2 = (unsigned char)op2.c;
2097 else if(op2.kind == 1)
2099 else if(op2.kind == 6)
2100 *value2 = (unsigned char)op2.f;
2101 else if(op2.kind == 7)
2102 *value2 = (unsigned char)op2.d;
2103 else if(op2.kind == 13)
2104 *value2 = (unsigned char)op2.ui64;
2110 unsigned int GetFloat(struct Expression * exp, float * value2)
2112 struct Operand op2 = GetOperand(exp);
2114 if(op2.kind == 3 && op2.type->isSigned)
2115 *value2 = (float)(float)op2.i;
2116 else if(op2.kind == 3)
2117 *value2 = (float)(float)op2.ui;
2118 else if(op2.kind == 4 && op2.type->isSigned)
2119 *value2 = (float)(float)op2.i64;
2120 else if(op2.kind == 4)
2121 *value2 = (float)(float)op2.ui64;
2122 else if(op2.kind == 23 && op2.type->isSigned)
2123 *value2 = (float)(float)op2.i64;
2124 else if(op2.kind == 23)
2125 *value2 = (float)(float)op2.ui64;
2126 else if(op2.kind == 22 && op2.type->isSigned)
2127 *value2 = (float)(float)op2.i64;
2128 else if(op2.kind == 22)
2129 *value2 = (float)(float)op2.ui64;
2130 else if(op2.kind == 2 && op2.type->isSigned)
2131 *value2 = (float)(float)op2.s;
2132 else if(op2.kind == 2)
2133 *value2 = (float)(float)op2.us;
2134 else if(op2.kind == 1 && op2.type->isSigned)
2135 *value2 = (float)(float)op2.c;
2136 else if(op2.kind == 1)
2137 *value2 = (float)(float)op2.uc;
2138 else if(op2.kind == 6)
2139 *value2 = (float)op2.f;
2140 else if(op2.kind == 7)
2141 *value2 = (float)op2.d;
2142 else if(op2.kind == 13)
2143 *value2 = (float)(float)op2.ui64;
2149 unsigned int GetDouble(struct Expression * exp, double * value2)
2151 struct Operand op2 = GetOperand(exp);
2153 if(op2.kind == 3 && op2.type->isSigned)
2154 *value2 = (double)(double)op2.i;
2155 else if(op2.kind == 3)
2156 *value2 = (double)(double)op2.ui;
2157 else if(op2.kind == 4 && op2.type->isSigned)
2158 *value2 = (double)(double)op2.i64;
2159 else if(op2.kind == 4)
2160 *value2 = (double)(double)op2.ui64;
2161 else if(op2.kind == 23 && op2.type->isSigned)
2162 *value2 = (double)(double)op2.i64;
2163 else if(op2.kind == 23)
2164 *value2 = (double)(double)op2.ui64;
2165 else if(op2.kind == 22 && op2.type->isSigned)
2166 *value2 = (double)(double)op2.i64;
2167 else if(op2.kind == 22)
2168 *value2 = (double)(double)op2.ui64;
2169 else if(op2.kind == 2 && op2.type->isSigned)
2170 *value2 = (double)(double)op2.s;
2171 else if(op2.kind == 2)
2172 *value2 = (double)(double)op2.us;
2173 else if(op2.kind == 1 && op2.type->isSigned)
2174 *value2 = (double)(double)op2.c;
2175 else if(op2.kind == 1)
2176 *value2 = (double)(double)op2.uc;
2177 else if(op2.kind == 6)
2178 *value2 = (double)op2.f;
2179 else if(op2.kind == 7)
2180 *value2 = (double)op2.d;
2181 else if(op2.kind == 13)
2182 *value2 = (double)(double)op2.ui64;
2188 void ComputeExpression(struct Expression * exp);
2190 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2192 extern int targetBits;
2194 int ComputeTypeSize(struct Type * type);
2196 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2198 struct __ecereNameSpace__ecere__com__BitMember
2200 struct __ecereNameSpace__ecere__com__BitMember * prev;
2201 struct __ecereNameSpace__ecere__com__BitMember * next;
2203 unsigned int isProperty;
2206 struct __ecereNameSpace__ecere__com__Class * _class;
2207 char * dataTypeString;
2208 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2209 struct Type * dataType;
2214 } __attribute__ ((gcc_struct));
2216 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2218 struct __ecereNameSpace__ecere__sys__OldLink
2220 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2221 struct __ecereNameSpace__ecere__sys__OldLink * next;
2223 } __attribute__ ((gcc_struct));
2225 void FinishTemplatesContext(struct Context * context);
2227 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2229 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2230 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2232 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))
2235 int unionMemberOffset = 0;
2240 member->memberOffset = 0;
2241 if(targetBits < sizeof(void *) * 8)
2242 member->structAlignment = 0;
2244 else if(targetBits < sizeof(void *) * 8)
2245 _class->structAlignment = 0;
2246 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2247 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2248 if(!member && _class->destructionWatchOffset)
2249 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2251 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2253 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2255 if(!dataMember->isProperty)
2257 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2259 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2265 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2267 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2269 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2271 if(!isMember && _class->type == 2 && dataMember->dataType)
2273 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2277 ComputeTypeSize(dataMember->dataType);
2278 if(bitMember->pos == -1)
2279 bitMember->pos = _class->memberOffset;
2280 if(!bitMember->size)
2281 bitMember->size = dataMember->dataType->size * 8;
2282 _class->memberOffset = bitMember->pos + bitMember->size;
2283 for(d = 0; d < bitMember->size; d++)
2289 bitMember->mask = mask << bitMember->pos;
2291 else if(dataMember->type == 0 && dataMember->dataType)
2296 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2297 ComputeTypeSize(dataMember->dataType);
2298 if(dataMember->dataType->bitFieldCount)
2300 bitFields += dataMember->dataType->bitFieldCount;
2307 int size = (bitFields + 7) / 8;
2311 int __simpleStruct0;
2315 int __simpleStruct0;
2317 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2318 if(member->memberOffset % alignment)
2319 member->memberOffset += alignment - (member->memberOffset % alignment);
2321 dataMember->offset = member->memberOffset;
2322 if(member->type == 1)
2323 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2326 member->memberOffset += size;
2333 int __simpleStruct0;
2335 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2336 if(_class->memberOffset % alignment)
2337 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2339 dataMember->offset = _class->memberOffset;
2340 _class->memberOffset += size;
2344 size = dataMember->dataType->size;
2345 alignment = dataMember->dataType->alignment;
2349 int __simpleStruct0;
2353 int __simpleStruct0;
2355 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2356 if(member->memberOffset % alignment)
2357 member->memberOffset += alignment - (member->memberOffset % alignment);
2359 dataMember->offset = member->memberOffset;
2360 if(member->type == 1)
2361 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2364 member->memberOffset += size;
2371 int __simpleStruct0;
2373 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2374 if(_class->memberOffset % alignment)
2375 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2377 dataMember->offset = _class->memberOffset;
2378 _class->memberOffset += size;
2385 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2386 alignment = dataMember->structAlignment;
2389 int __simpleStruct0;
2393 int __simpleStruct0;
2395 if(member->memberOffset % alignment)
2396 member->memberOffset += alignment - (member->memberOffset % alignment);
2397 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2399 dataMember->offset = member->memberOffset;
2400 if(member->type == 1)
2401 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2403 member->memberOffset += dataMember->memberOffset;
2409 int __simpleStruct0;
2411 if(_class->memberOffset % alignment)
2412 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2413 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2415 dataMember->offset = _class->memberOffset;
2416 _class->memberOffset += dataMember->memberOffset;
2424 int size = (bitFields + 7) / 8;
2428 int __simpleStruct0;
2432 int __simpleStruct0;
2434 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2435 if(member->memberOffset % alignment)
2436 member->memberOffset += alignment - (member->memberOffset % alignment);
2438 if(member->type == 1)
2439 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2442 member->memberOffset += size;
2449 int __simpleStruct0;
2451 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2452 if(_class->memberOffset % alignment)
2453 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2455 _class->memberOffset += size;
2460 if(member && member->type == 1)
2462 member->memberOffset = unionMemberOffset;
2466 if(_class->type != 2)
2470 if(_class->structAlignment)
2472 if(_class->memberOffset % _class->structAlignment)
2473 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2475 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2478 struct __ecereNameSpace__ecere__com__Property * prop;
2480 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2482 if(prop->isProperty && prop->isWatchable)
2484 prop->watcherOffset = _class->structSize;
2485 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2490 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2492 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2494 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2496 if(deriv->computeSize)
2498 deriv->offset = _class->structSize;
2499 deriv->memberOffset = 0;
2500 deriv->structSize = deriv->offset;
2501 ComputeClassMembers(deriv, 0x0);
2509 FinishTemplatesContext(context);
2512 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2514 struct __ecereNameSpace__ecere__com__NameSpace
2517 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2518 struct __ecereNameSpace__ecere__com__NameSpace * left;
2519 struct __ecereNameSpace__ecere__com__NameSpace * right;
2521 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2522 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2523 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2524 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2525 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2526 } __attribute__ ((gcc_struct));
2528 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2530 struct __ecereNameSpace__ecere__com__Module
2532 struct __ecereNameSpace__ecere__com__Instance * application;
2533 struct __ecereNameSpace__ecere__sys__OldList classes;
2534 struct __ecereNameSpace__ecere__sys__OldList defines;
2535 struct __ecereNameSpace__ecere__sys__OldList functions;
2536 struct __ecereNameSpace__ecere__sys__OldList modules;
2537 struct __ecereNameSpace__ecere__com__Instance * prev;
2538 struct __ecereNameSpace__ecere__com__Instance * next;
2544 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2545 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2546 } __attribute__ ((gcc_struct));
2548 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2550 struct __ecereNameSpace__ecere__com__Class * _class;
2551 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2553 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2554 ComputeModuleClasses(subModule->data);
2555 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2556 ComputeClassMembers(_class, 0x0);
2559 extern unsigned int inCompiler;
2561 extern void Compiler_Error(char * format, ...);
2563 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2565 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2567 int ComputeTypeSize(struct Type * type)
2569 unsigned int size = type ? type->size : 0;
2571 if(!size && type && !type->computing)
2573 type->computing = 0x1;
2577 type->alignment = size = sizeof(char);
2580 type->alignment = size = sizeof(int);
2583 type->alignment = size = sizeof(long long);
2586 type->alignment = size = targetBits / 8;
2589 type->alignment = size = targetBits / 8;
2592 type->alignment = size = sizeof(long);
2595 type->alignment = size = sizeof(short);
2598 type->alignment = size = sizeof(float);
2601 type->alignment = size = sizeof(double);
2605 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2607 if(_class && _class->type == 1)
2609 ComputeClassMembers(_class, 0x0);
2610 type->alignment = _class->structAlignment;
2611 size = _class->structSize;
2612 if(type->alignment && size % type->alignment)
2613 size += type->alignment - (size % type->alignment);
2615 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2617 if(!_class->dataType)
2618 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2619 size = type->alignment = ComputeTypeSize(_class->dataType);
2622 size = type->alignment = targetBits / 8;
2627 size = type->alignment = targetBits / 8;
2630 if(type->arraySizeExp)
2632 ProcessExpressionType(type->arraySizeExp);
2633 ComputeExpression(type->arraySizeExp);
2634 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)))
2636 struct Location oldLoc = yylloc;
2637 char expression[10240];
2639 expression[0] = '\0';
2640 type->arraySizeExp->expType = (((void *)0));
2641 yylloc = type->arraySizeExp->loc;
2643 PrintExpression(type->arraySizeExp, expression);
2644 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2647 GetInt(type->arraySizeExp, &type->arraySize);
2649 else if(type->enumClass)
2651 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2653 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2656 type->arraySize = 0;
2660 type->arraySize = 0;
2662 size = ComputeTypeSize(type->type) * type->arraySize;
2664 type->alignment = type->type->alignment;
2668 struct Type * member;
2670 for(member = type->members.first; member; member = member->next)
2672 int __simpleStruct0, __simpleStruct1;
2673 unsigned int addSize = ComputeTypeSize(member);
2675 member->offset = size;
2676 if(member->alignment && size % member->alignment)
2677 member->offset += member->alignment - (size % member->alignment);
2678 size = member->offset;
2679 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2682 if(type->alignment && size % type->alignment)
2683 size += type->alignment - (size % type->alignment);
2688 struct Type * member;
2690 for(member = type->members.first; member; member = member->next)
2692 int __simpleStruct0, __simpleStruct1;
2693 unsigned int addSize = ComputeTypeSize(member);
2695 member->offset = size;
2696 if(member->alignment && size % member->alignment)
2697 member->offset += member->alignment - (size % member->alignment);
2698 size = member->offset;
2699 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2700 size = ((size > addSize) ? size : addSize);
2702 if(type->alignment && size % type->alignment)
2703 size += type->alignment - (size % type->alignment);
2708 struct TemplateParameter * param = type->templateParameter;
2709 struct Type * baseType = ProcessTemplateParameterType(param);
2713 size = ComputeTypeSize(baseType);
2714 type->alignment = baseType->alignment;
2717 type->alignment = size = sizeof(uint64);
2722 type->alignment = size = sizeof(enum
2730 type->alignment = size = targetBits / 8;
2735 type->computing = 0x0;
2740 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2742 extern struct Identifier * MkIdentifier(char * string);
2744 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2746 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2748 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2750 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2752 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2754 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2756 extern void FreeType(struct Type * type);
2758 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2760 extern struct Specifier * MkSpecifier(int specifier);
2762 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2764 extern struct Expression * MkExpConstant(char * string);
2766 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)
2768 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2769 unsigned int totalSize = 0;
2770 unsigned int maxSize = 0;
2771 int alignment, size;
2772 struct __ecereNameSpace__ecere__com__DataMember * member;
2773 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2776 *addedPadding = 0x0;
2777 if(!isMember && _class->base)
2779 maxSize = _class->structSize;
2781 if(_class->type == 1 || _class->type == 5)
2782 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2785 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2787 if(maxSize > baseSize)
2788 maxSize -= baseSize;
2794 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2796 if(!member->isProperty)
2798 switch(member->type)
2802 if(member->dataTypeString)
2804 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2805 struct Declarator * decl;
2807 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2808 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2809 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2810 if(!member->dataType)
2811 member->dataType = ProcessType(specs, decl);
2812 ReplaceThisClassSpecifiers(specs, topClass);
2814 struct Type * type = ProcessType(specs, decl);
2816 DeclareType(member->dataType, 0x0, 0x0);
2819 ComputeTypeSize(member->dataType);
2820 size = member->dataType->size;
2821 alignment = member->dataType->alignment;
2824 if(totalSize % alignment)
2825 totalSize += alignment - (totalSize % alignment);
2834 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2837 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2838 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2839 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2840 alignment = member->structAlignment;
2843 if(totalSize % alignment)
2844 totalSize += alignment - (totalSize % alignment);
2854 unsigned int __simpleStruct0;
2856 if(topMember && topMember->type == 1)
2857 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2859 *retSize += totalSize;
2861 else if(totalSize < maxSize && _class->type != 1000)
2863 int autoPadding = 0;
2865 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2866 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2867 if(totalSize + autoPadding < maxSize)
2869 char sizeString[50];
2871 sprintf(sizeString, "%d", maxSize - totalSize);
2872 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2874 *addedPadding = 0x1;
2878 FinishTemplatesContext(context);
2879 return topMember ? topMember->memberID : _class->memberID;
2882 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2884 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2885 unsigned int totalSize = 0;
2886 struct __ecereNameSpace__ecere__com__DataMember * member;
2887 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2889 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2890 DeclareMembers(_class->base, 0x0);
2891 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2893 if(!member->isProperty)
2895 switch(member->type)
2899 if(!member->dataType && member->dataTypeString)
2900 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2901 if(member->dataType)
2902 DeclareType(member->dataType, 0x0, 0x0);
2908 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2915 FinishTemplatesContext(context);
2916 return topMember ? topMember->memberID : _class->memberID;
2919 extern struct Symbol * FindClass(char * name);
2921 extern char * strchr(const char * , int);
2923 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2925 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* FreeFunction)(void * ));
2927 extern void FreeClassDef(struct ClassDef * def);
2929 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2931 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2933 extern char * strcpy(char * , const char * );
2935 extern void MangleClassName(char * className);
2937 extern void DeclareClass(struct Symbol * classSym, char * className);
2939 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2941 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2943 void DeclareStruct(char * name, unsigned int skipNoHead)
2945 struct External * external = (((void *)0));
2946 struct Symbol * classSym = FindClass(name);
2948 if(!inCompiler || !classSym)
2950 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2952 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2954 struct Declaration * decl;
2955 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2956 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2957 char structName[1024];
2959 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2960 classSym->declaring++;
2961 if(strchr(classSym->string, '<'))
2963 if(classSym->registered->templateClass)
2965 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2966 classSym->declaring--;
2970 DeclareMembers(classSym->registered, 0x0);
2971 structName[0] = (char)0;
2972 FullClassNameCat(structName, name, 0x0);
2975 unsigned int addedPadding = 0x0;
2977 classSym->declaredStructSym = 0x1;
2978 declarations = MkList();
2979 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2980 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2982 FreeList(declarations, FreeClassDef);
2983 declarations = (((void *)0));
2986 if(skipNoHead || declarations)
2988 if(external && external->declaration)
2990 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2991 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2993 if(classSym->structExternal)
2994 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2995 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2996 classSym->id = curExternal->symbol->idCode;
2997 classSym->idCode = curExternal->symbol->idCode;
3003 external = MkExternalDeclaration((((void *)0)));
3004 specifiers = MkList();
3005 declarators = MkList();
3006 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3007 external->declaration = decl = MkDeclaration(specifiers, declarators);
3008 if(decl->symbol && !decl->symbol->pointerExternal)
3009 decl->symbol->pointerExternal = external;
3010 if(classSym->registered && classSym->registered->type == 1)
3012 char className[1024];
3014 strcpy(className, "__ecereClass_");
3015 FullClassNameCat(className, classSym->string, 0x1);
3016 MangleClassName(className);
3017 DeclareClass(classSym, className);
3018 external->symbol = classSym;
3019 classSym->pointerExternal = external;
3020 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3021 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3025 char className[1024];
3027 strcpy(className, "__ecereClass_");
3028 FullClassNameCat(className, classSym->string, 0x1);
3029 MangleClassName(className);
3030 classSym->structExternal = external;
3031 DeclareClass(classSym, className);
3032 external->symbol = classSym;
3034 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3037 classSym->declaring--;
3039 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3041 classSym->declaring++;
3043 if(classSym->registered)
3044 DeclareMembers(classSym->registered, 0x0);
3046 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3048 if(classSym->structExternal)
3049 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3050 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3051 classSym->id = curExternal->symbol->idCode;
3052 classSym->idCode = curExternal->symbol->idCode;
3054 classSym->declaring--;
3058 extern char * strcat(char * , const char * );
3060 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3062 extern struct ModuleImport * mainModule;
3064 extern struct Specifier * MkSpecifierName(char * name);
3066 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3068 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3070 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3072 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3074 extern void FreeDeclarator(struct Declarator * decl);
3076 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3078 struct PropertyImport
3080 struct PropertyImport * prev;
3081 struct PropertyImport * next;
3083 unsigned int isVirtual;
3084 unsigned int hasSet;
3085 unsigned int hasGet;
3086 } __attribute__ ((gcc_struct));
3088 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3090 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3092 struct Symbol * symbol = prop->symbol;
3093 char propName[1024];
3095 strcpy(setName, "__ecereProp_");
3096 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3097 strcat(setName, "_Set_");
3098 FullClassNameCat(setName, prop->name, 0x1);
3099 strcpy(getName, "__ecereProp_");
3100 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3101 strcat(getName, "_Get_");
3102 FullClassNameCat(getName, prop->name, 0x1);
3103 strcpy(propName, "__ecereProp_");
3104 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3105 strcat(propName, "_");
3106 FullClassNameCat(propName, prop->name, 0x1);
3107 MangleClassName(getName);
3108 MangleClassName(setName);
3109 MangleClassName(propName);
3110 if(prop->_class->type == 1)
3111 DeclareStruct(prop->_class->fullName, 0x0);
3112 if(!symbol || curExternal->symbol->idCode < symbol->id)
3114 unsigned int imported = 0x0;
3115 unsigned int dllImport = 0x0;
3117 if(!symbol || symbol->_import)
3121 struct Symbol * classSym;
3123 if(!prop->_class->symbol)
3124 prop->_class->symbol = FindClass(prop->_class->fullName);
3125 classSym = prop->_class->symbol;
3126 if(classSym && !classSym->_import)
3128 struct ModuleImport * module;
3130 if(prop->_class->module)
3131 module = FindModule(prop->_class->module);
3133 module = mainModule;
3134 classSym->_import = __extension__ ({
3135 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3137 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3139 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3141 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3142 symbol->_import = (struct ClassImport *)__extension__ ({
3143 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3145 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3151 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3156 struct Context * context = SetupTemplatesContext(prop->_class);
3158 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3159 FinishTemplatesContext(context);
3163 if(!symbol->externalGet || symbol->externalGet->type == 0)
3165 struct Declaration * decl;
3166 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3167 struct Declarator * d;
3168 struct __ecereNameSpace__ecere__sys__OldList * params;
3169 struct Specifier * spec;
3170 struct External * external;
3171 struct Declarator * typeDecl;
3172 unsigned int simple = 0x0;
3174 specifiers = MkList();
3175 declarators = MkList();
3177 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3178 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3180 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3182 struct Context * context = SetupTemplatesContext(prop->_class);
3184 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3185 FinishTemplatesContext(context);
3187 for(spec = (*specifiers).first; spec; spec = spec->next)
3191 if((!typeDecl || typeDecl->type == 1))
3193 struct Symbol * classSym = spec->symbol;
3195 symbol->_class = classSym->registered;
3196 if(classSym->registered && classSym->registered->type == 1)
3198 DeclareStruct(spec->name, 0x0);
3205 d = PlugDeclarator(typeDecl, d);
3208 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3209 specifiers = MkList();
3211 d = MkDeclaratorFunction(d, params);
3213 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3214 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3215 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3217 ListAdd(specifiers, MkSpecifier(VOID));
3218 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3219 decl = MkDeclaration(specifiers, declarators);
3220 external = MkExternalDeclaration(decl);
3221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3222 external->symbol = symbol;
3223 symbol->externalGet = external;
3224 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3226 FreeDeclarator(typeDecl);
3230 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3235 if(!symbol->externalSet || symbol->externalSet->type == 0)
3237 struct Declaration * decl;
3238 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3239 struct Declarator * d;
3240 struct __ecereNameSpace__ecere__sys__OldList * params;
3241 struct Specifier * spec;
3242 struct External * external;
3243 struct Declarator * typeDecl;
3245 declarators = MkList();
3247 if(!prop->conversion || prop->_class->type == 1)
3249 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3251 specifiers = MkList();
3253 struct Context * context = SetupTemplatesContext(prop->_class);
3255 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3256 FinishTemplatesContext(context);
3258 ListAdd(params, MkTypeName(specifiers, d));
3259 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3261 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3262 d = MkDeclaratorFunction(d, params);
3263 for(spec = (*specifiers).first; spec; spec = spec->next)
3267 if((!typeDecl || typeDecl->type == 1))
3269 struct Symbol * classSym = spec->symbol;
3271 symbol->_class = classSym->registered;
3272 if(classSym->registered && classSym->registered->type == 1)
3273 DeclareStruct(spec->name, 0x0);
3277 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3278 specifiers = MkList();
3280 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3281 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3282 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3283 if(!prop->conversion || prop->_class->type == 1)
3284 ListAdd(specifiers, MkSpecifier(VOID));
3286 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3287 decl = MkDeclaration(specifiers, declarators);
3288 external = MkExternalDeclaration(decl);
3289 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3290 external->symbol = symbol;
3291 symbol->externalSet = external;
3292 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3299 if(!symbol->externalPtr)
3301 struct Declaration * decl;
3302 struct External * external;
3303 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3306 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3309 ListAdd(specifiers, MkSpecifierName("Property"));
3311 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3313 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3316 strcpy(propName, "__ecerePropM_");
3317 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3318 strcat(propName, "_");
3319 FullClassNameCat(propName, prop->name, 0x1);
3320 MangleClassName(propName);
3321 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3323 decl = MkDeclaration(specifiers, list);
3325 external = MkExternalDeclaration(decl);
3326 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3327 external->symbol = symbol;
3328 symbol->externalPtr = external;
3332 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3334 symbol->id = curExternal->symbol->idCode;
3338 struct Type * Dereference(struct Type * source)
3340 struct Type * type = (((void *)0));
3344 if(source->kind == 13 || source->kind == 12)
3346 type = source->type;
3347 source->type->refCount++;
3349 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3351 type = __extension__ ({
3352 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3354 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3357 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3363 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3368 static struct Type * Reference(struct Type * source)
3370 struct Type * type = (((void *)0));
3374 type = __extension__ ({
3375 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3377 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3384 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);
3386 extern void * memcpy(void * , const void * , size_t size);
3388 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3390 extern void FreeExpression(struct Expression * exp);
3392 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3394 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);
3396 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3398 extern struct Type * MkClassType(char * name);
3400 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);
3402 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)
3404 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3405 unsigned int found = 0x0;
3406 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3407 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3408 unsigned int freeType = 0x0;
3410 yylloc = member->loc;
3415 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3419 dataMember = *curMember;
3425 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3426 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3427 int _subMemberStackPos = 0;
3430 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3433 dataMember = thisMember;
3434 if(curMember && thisMember->memberAccess == 1)
3436 *curMember = thisMember;
3437 *curClass = thisMember->_class;
3438 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
3439 *subMemberStackPos = _subMemberStackPos;
3445 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3446 if(method && method->type == 1)
3449 method = (((void *)0));
3454 struct Type * type = (((void *)0));
3458 if(!dataMember->dataType && dataMember->dataTypeString)
3460 struct Context * context = SetupTemplatesContext(_class);
3462 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3463 FinishTemplatesContext(context);
3465 type = dataMember->dataType;
3469 if(!method->dataType)
3470 ProcessMethodType(method);
3471 type = method->dataType;
3473 if(ident && ident->next)
3475 for(ident = ident->next; ident && type; ident = ident->next)
3479 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3481 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3483 type = dataMember->dataType;
3485 else if(type->kind == 9 || type->kind == 10)
3487 struct Type * memberType;
3489 for(memberType = type->members.first; memberType; memberType = memberType->next)
3491 if(!strcmp(memberType->name, ident->string))
3500 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3503 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3504 struct __ecereNameSpace__ecere__com__Class * sClass;
3506 for(sClass = _class; sClass; sClass = sClass->base)
3509 if(sClass->templateClass)
3510 sClass = sClass->templateClass;
3511 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3513 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3515 for(sClass = sClass->base; sClass; sClass = sClass->base)
3517 if(sClass->templateClass)
3518 sClass = sClass->templateClass;
3519 id += sClass->templateParams.count;
3530 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3532 if(arg.dataTypeString)
3534 type = ProcessTypeString(arg.dataTypeString, 0x0);
3536 if(type && _class->templateClass)
3537 type->passAsTemplate = 0x1;
3544 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3546 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3547 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3551 char templateString[1024];
3552 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3554 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3555 for(cClass = expClass; cClass; cClass = cClass->base)
3559 if(cClass->templateClass)
3560 cClass = cClass->templateClass;
3561 for(param = cClass->templateParams.first; param; param = param->next)
3564 struct __ecereNameSpace__ecere__com__Class * sClass;
3565 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3567 for(sClass = cClass->base; sClass; sClass = sClass->base)
3569 if(sClass->templateClass)
3570 sClass = sClass->templateClass;
3571 id += sClass->templateParams.count;
3573 arg = expClass->templateArgs[id];
3574 for(sClass = _class; sClass; sClass = sClass->base)
3576 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3578 struct __ecereNameSpace__ecere__com__Class * nextClass;
3580 if(sClass->templateClass)
3581 sClass = sClass->templateClass;
3582 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3584 if(nextClass->templateClass)
3585 nextClass = nextClass->templateClass;
3586 p += nextClass->templateParams.count;
3588 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3590 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3592 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3594 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3595 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3609 char expString[1024];
3610 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3611 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3612 struct Expression * exp;
3613 char * string = PrintHexUInt64(arg.expression.ui64);
3615 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3616 ProcessExpressionType(exp);
3617 ComputeExpression(exp);
3618 expString[0] = '\0';
3619 PrintExpression(exp, expString);
3620 strcat(argument, expString);
3621 FreeExpression(exp);
3626 strcat(argument, arg.member->name);
3631 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3632 strcat(argument, arg.dataTypeString);
3639 strcat(templateString, ", ");
3640 if(lastParam != p - 1)
3642 strcat(templateString, param->name);
3643 strcat(templateString, " = ");
3645 strcat(templateString, argument);
3654 int len = strlen(templateString);
3656 if(templateString[len - 1] == '<')
3660 if(templateString[len - 1] == '>')
3661 templateString[len++] = ' ';
3662 templateString[len++] = '>';
3664 templateString[len++] = '\0';
3667 struct Context * context = SetupTemplatesContext(_class);
3671 type = ProcessTypeString(templateString, 0x0);
3673 FinishTemplatesContext(context);
3676 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3678 ProcessExpressionType(member->initializer->exp);
3679 if(!member->initializer->exp->expType)
3683 char expString[10240];
3685 expString[0] = '\0';
3686 PrintExpression(member->initializer->exp, expString);
3687 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3688 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3691 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3693 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3696 else if(member->initializer)
3698 ProcessInitializer(member->initializer, type);
3705 if(_class && _class->type == 3)
3707 if(member->initializer)
3709 struct Type * type = MkClassType(_class->fullName);
3711 ProcessInitializer(member->initializer, type);
3717 if(member->initializer)
3719 ProcessInitializer(member->initializer, (((void *)0)));
3725 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3729 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3731 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3735 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3740 extern struct Identifier * GetDeclId(struct Declarator * decl);
3742 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);
3744 extern void FreeSpecifier(struct Specifier * spec);
3746 static void ProcessFunction(struct FunctionDefinition * function);
3748 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* CopyFunction)(void * ));
3750 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3752 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3754 extern void FreeClassFunction(struct ClassFunction * func);
3756 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3758 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3760 void ProcessInstantiationType(struct Instantiation * inst)
3765 struct MembersInit * members;
3766 struct Symbol * classSym;
3767 struct __ecereNameSpace__ecere__com__Class * _class;
3769 classSym = inst->_class->symbol;
3770 _class = classSym ? classSym->registered : (((void *)0));
3771 if(!_class || _class->type != 5)
3772 DeclareStruct(inst->_class->name, 0x0);
3773 afterExternal = afterExternal ? afterExternal : curExternal;
3775 ProcessExpressionType(inst->exp);
3776 inst->isConstant = 0x1;
3779 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3780 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3781 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3782 int subMemberStackPos = 0;
3784 for(members = (*inst->members).first; members; members = members->next)
3786 switch(members->type)
3791 static unsigned int instMethodID = 0;
3792 struct External * external = curExternal;
3793 struct Context * context = curContext;
3794 struct Declarator * declarator = members->function->declarator;
3795 struct Identifier * nameID = GetDeclId(declarator);
3796 char * unmangled = nameID ? nameID->string : (((void *)0));
3797 struct Expression * exp;
3798 struct External * createdExternal = (((void *)0));
3804 strcpy(name, "__ecereInstMeth_");
3805 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3807 strcat(name, nameID->string);
3809 sprintf(number, "_%08d", instMethodID++);
3810 strcat(name, number);
3811 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3815 struct Symbol * symbol = declarator->symbol;
3816 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3818 if(method && method->type == 1)
3820 symbol->method = method;
3821 ProcessMethodType(method);
3822 if(!symbol->type->thisClass)
3824 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3826 if(!currentClass->symbol)
3827 currentClass->symbol = FindClass(currentClass->fullName);
3828 symbol->type->thisClass = currentClass->symbol;
3833 _class->symbol = FindClass(_class->fullName);
3834 symbol->type->thisClass = _class->symbol;
3837 DeclareType(symbol->type, 0x1, 0x1);
3841 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3844 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3847 FreeSpecifier(nameID->_class);
3848 nameID->_class = (((void *)0));
3852 struct Type * type = declarator->symbol->type;
3853 struct External * oldExternal = curExternal;
3855 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3857 struct External * externalDecl;
3859 externalDecl = MkExternalDeclaration((((void *)0)));
3860 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3861 if(createdExternal->function)
3863 ProcessFunction(createdExternal->function);
3865 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3867 externalDecl->declaration = decl;
3868 if(decl->symbol && !decl->symbol->pointerExternal)
3869 decl->symbol->pointerExternal = externalDecl;
3870 declarator->symbol->pointerExternal = externalDecl;
3877 curExternal = declarator->symbol->pointerExternal;
3878 ProcessFunction((struct FunctionDefinition *)members->function);
3880 curExternal = external;
3881 curContext = context;
3884 FreeClassFunction(members->function);
3885 exp = QMkExpId(name);
3887 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3888 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3894 if(members->dataMembers && classSym)
3896 struct MemberInit * member;
3897 struct Location oldyyloc = yylloc;
3899 for(member = (*members->dataMembers).first; member; member = member->next)
3901 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3902 if(member->initializer && !member->initializer->isConstant)
3903 inst->isConstant = 0x0;
3915 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3919 if(type->kind == 11)
3921 struct Type * param;
3925 for(param = type->params.first; param; param = param->next)
3926 DeclareType(param, declarePointers, 0x1);
3928 DeclareType(type->returnType, declarePointers, 0x1);
3930 else if(type->kind == 13 && declarePointers)
3931 DeclareType(type->type, declarePointers, 0x0);
3932 else if(type->kind == 8)
3934 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3935 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3937 else if(type->kind == 9 || type->kind == 10)
3939 struct Type * member;
3941 for(member = type->members.first; member; member = member->next)
3942 DeclareType(member, 0x0, 0x0);
3944 else if(type->kind == 12)
3945 DeclareType(type->arrayType, declarePointers, 0x0);
3949 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3951 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3953 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3955 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3956 struct __ecereNameSpace__ecere__com__Class * sClass;
3958 for(sClass = _class; sClass; sClass = sClass->base)
3961 if(sClass->templateClass)
3962 sClass = sClass->templateClass;
3963 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3965 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3967 for(sClass = sClass->base; sClass; sClass = sClass->base)
3969 if(sClass->templateClass)
3970 sClass = sClass->templateClass;
3971 id += sClass->templateParams.count;
3982 arg = &_class->templateArgs[id];
3983 if(arg && param->type == 0)
3984 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3989 extern struct Context * PushContext(void);
3991 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3993 struct TemplatedType
3996 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3997 struct __ecereNameSpace__ecere__sys__BTNode * left;
3998 struct __ecereNameSpace__ecere__sys__BTNode * right;
4000 struct TemplateParameter * param;
4001 } __attribute__ ((gcc_struct));
4003 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4005 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4007 struct Context * context = PushContext();
4009 context->templateTypesOnly = 0x1;
4010 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4012 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4014 for(; param; param = param->next)
4016 if(param->type == 0 && param->identifier)
4018 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4020 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4026 struct __ecereNameSpace__ecere__com__Class * sClass;
4028 for(sClass = _class; sClass; sClass = sClass->base)
4030 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4032 for(p = sClass->templateParams.first; p; p = p->next)
4036 struct TemplateParameter * param = p->param;
4037 struct TemplatedType * type;
4041 p->param = param = __extension__ ({
4042 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4044 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4047 type = __extension__ ({
4048 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4050 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4052 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4060 extern void PopContext(struct Context * ctx);
4062 extern void FreeContext(struct Context * context);
4064 void FinishTemplatesContext(struct Context * context)
4066 PopContext(context);
4067 FreeContext(context);
4068 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4071 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4073 if(!method->dataType)
4075 struct Context * context = SetupTemplatesContext(method->_class);
4077 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4078 FinishTemplatesContext(context);
4079 if(method->type != 1 && method->dataType)
4081 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4083 if(!method->_class->symbol)
4084 method->_class->symbol = FindClass(method->_class->fullName);
4085 method->dataType->thisClass = method->_class->symbol;
4091 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4095 struct Context * context = SetupTemplatesContext(prop->_class);
4097 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4098 FinishTemplatesContext(context);
4102 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4104 extern void FreeTypeName(struct TypeName * typeName);
4106 static void ProcessDeclarator(struct Declarator * decl);
4108 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4110 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4114 struct MethodImport * prev;
4115 struct MethodImport * next;
4117 unsigned int isVirtual;
4118 } __attribute__ ((gcc_struct));
4120 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4122 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4124 struct Symbol * symbol = method->symbol;
4126 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4128 unsigned int imported = 0x0;
4129 unsigned int dllImport = 0x0;
4131 if(!method->dataType)
4132 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4133 if(!symbol || symbol->_import || method->type == 1)
4135 if(!symbol || method->type == 1)
4137 struct Symbol * classSym;
4139 if(!method->_class->symbol)
4140 method->_class->symbol = FindClass(method->_class->fullName);
4141 classSym = method->_class->symbol;
4142 if(!classSym->_import)
4144 struct ModuleImport * module;
4146 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4147 module = FindModule(method->_class->module);
4149 module = mainModule;
4150 classSym->_import = __extension__ ({
4151 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4153 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4155 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4159 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4161 if(!symbol->_import)
4163 symbol->_import = (struct ClassImport *)__extension__ ({
4164 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4166 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4168 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4172 symbol->type = method->dataType;
4174 symbol->type->refCount++;
4177 if(!method->dataType->dllExport)
4180 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4184 if(method->type != 1 && method->dataType)
4185 DeclareType(method->dataType, 0x1, 0x1);
4186 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4188 struct Declaration * decl;
4189 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4190 struct Declarator * d;
4191 struct Declarator * funcDecl;
4192 struct External * external;
4194 specifiers = MkList();
4195 declarators = MkList();
4197 ListAdd(specifiers, MkSpecifier(EXTERN));
4198 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4199 ListAdd(specifiers, MkSpecifier(STATIC));
4200 if(method->type == 1)
4202 ListAdd(specifiers, MkSpecifier(INT));
4203 d = MkDeclaratorIdentifier(MkIdentifier(name));
4207 d = MkDeclaratorIdentifier(MkIdentifier(name));
4209 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4211 struct Context * context = SetupTemplatesContext(method->_class);
4213 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4214 FinishTemplatesContext(context);
4216 funcDecl = GetFuncDecl(d);
4219 struct Specifier * spec, * next;
4221 for(spec = (*specifiers).first; spec; spec = next)
4226 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4227 FreeSpecifier(spec);
4231 if(method->dataType && !method->dataType->staticMethod)
4233 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4235 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4236 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")));
4237 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4238 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4240 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4242 struct TypeName * param = (*funcDecl->function.parameters).first;
4244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4245 FreeTypeName(param);
4247 if(!funcDecl->function.parameters)
4248 funcDecl->function.parameters = MkList();
4249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4253 ProcessDeclarator(d);
4254 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4255 decl = MkDeclaration(specifiers, declarators);
4256 ReplaceThisClassSpecifiers(specifiers, method->_class);
4257 if(symbol->pointerExternal)
4259 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4262 *functionSymbol = *symbol;
4263 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4264 if(functionSymbol->type)
4265 functionSymbol->type->refCount++;
4267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4268 symbol->pointerExternal->symbol = functionSymbol;
4270 external = MkExternalDeclaration(decl);
4272 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4273 external->symbol = symbol;
4274 symbol->pointerExternal = external;
4278 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4280 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4284 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4286 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4288 unsigned int first = 0x1;
4290 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4292 char className[1024];
4294 strcpy(className, _class->fullName);
4295 for(param = _class->templateParams.first; param; param = param->next)
4299 strcat(className, "<");
4301 strcat(className, ", ");
4302 if(lastParam + 1 != p)
4304 strcat(className, param->name);
4305 strcat(className, " = ");
4307 strcat(className, param->name);
4315 int len = strlen(className);
4317 if(className[len - 1] == '>')
4318 className[len++] = ' ';
4319 className[len++] = '>';
4320 className[len++] = '\0';
4322 return __ecereNameSpace__ecere__sys__CopyString(className);
4325 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4328 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4330 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4332 unsigned int first = 0x1;
4334 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4336 char className[1024];
4338 strcpy(className, _class->fullName);
4339 for(param = _class->templateParams.first; param; param = param->next)
4343 strcat(className, "<");
4345 strcat(className, ", ");
4346 if(lastParam + 1 != p)
4348 strcat(className, param->name);
4349 strcat(className, " = ");
4351 strcat(className, param->name);
4359 int len = strlen(className);
4361 if(className[len - 1] == '>')
4362 className[len++] = ' ';
4363 className[len++] = '>';
4364 className[len++] = '\0';
4366 return MkClassType(className);
4370 return MkClassType(_class->fullName);
4374 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4376 if(specs != (((void *)0)) && _class)
4378 struct Specifier * spec;
4380 for(spec = specs->first; spec; spec = spec->next)
4382 if(spec->type == 0 && spec->specifier == THISCLASS)
4385 spec->name = ReplaceThisClass(_class);
4386 spec->symbol = FindClass(spec->name);
4392 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4394 struct __ecereNameSpace__ecere__com__GlobalFunction
4396 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4397 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4400 struct __ecereNameSpace__ecere__com__Instance * module;
4401 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4402 char * dataTypeString;
4403 struct Type * dataType;
4405 } __attribute__ ((gcc_struct));
4407 extern struct Context * globalContext;
4409 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4411 struct FunctionImport
4413 struct FunctionImport * prev;
4414 struct FunctionImport * next;
4416 } __attribute__ ((gcc_struct));
4418 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4420 struct Symbol * symbol = function->symbol;
4422 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4424 unsigned int imported = 0x0;
4425 unsigned int dllImport = 0x0;
4427 if(!function->dataType)
4429 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4430 if(!function->dataType->thisClass)
4431 function->dataType->staticMethod = 0x1;
4437 struct ModuleImport * module = FindModule(function->module);
4439 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4442 if(!function->dataType->dllExport)
4444 symbol->_import = (struct ClassImport *)__extension__ ({
4445 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4447 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4449 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4453 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4454 if(!symbol->type->thisClass)
4455 symbol->type->staticMethod = 0x1;
4458 imported = symbol->_import ? 0x1 : 0x0;
4459 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4462 DeclareType(function->dataType, 0x1, 0x1);
4465 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4467 struct Declaration * decl;
4468 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4469 struct Declarator * d;
4470 struct Declarator * funcDecl;
4471 struct External * external;
4473 specifiers = MkList();
4474 declarators = MkList();
4475 ListAdd(specifiers, MkSpecifier(EXTERN));
4476 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4478 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4479 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4480 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4482 struct Specifier * spec;
4484 for(spec = (*specifiers).first; spec; spec = spec->next)
4485 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4487 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4488 FreeSpecifier(spec);
4492 funcDecl = GetFuncDecl(d);
4493 if(funcDecl && !funcDecl->function.parameters)
4495 funcDecl->function.parameters = MkList();
4496 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4498 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4500 struct Context * oldCtx = curContext;
4502 curContext = globalContext;
4503 decl = MkDeclaration(specifiers, declarators);
4504 curContext = oldCtx;
4506 if(symbol->pointerExternal)
4508 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4511 *functionSymbol = *symbol;
4512 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4513 if(functionSymbol->type)
4514 functionSymbol->type->refCount++;
4516 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4517 symbol->pointerExternal->symbol = functionSymbol;
4519 external = MkExternalDeclaration(decl);
4521 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4522 external->symbol = symbol;
4523 symbol->pointerExternal = external;
4527 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4530 symbol->id = curExternal->symbol->idCode;
4533 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4536 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4541 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4542 struct __ecereNameSpace__ecere__sys__BTNode * left;
4543 struct __ecereNameSpace__ecere__sys__BTNode * right;
4545 struct __ecereNameSpace__ecere__com__Instance * module;
4546 char * dataTypeString;
4547 struct Type * dataType;
4550 } __attribute__ ((gcc_struct));
4552 void DeclareGlobalData(struct GlobalData * data)
4554 struct Symbol * symbol = data->symbol;
4556 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4561 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4564 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4565 DeclareType(data->dataType, 0x1, 0x1);
4568 if(!symbol->pointerExternal)
4570 struct Declaration * decl;
4571 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4572 struct Declarator * d;
4573 struct External * external;
4575 specifiers = MkList();
4576 declarators = MkList();
4577 ListAdd(specifiers, MkSpecifier(EXTERN));
4578 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4579 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4580 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4581 decl = MkDeclaration(specifiers, declarators);
4582 external = MkExternalDeclaration(decl);
4584 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4585 external->symbol = symbol;
4586 symbol->pointerExternal = external;
4590 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4593 symbol->id = curExternal->symbol->idCode;
4600 struct Conversion * prev, * next;
4601 struct __ecereNameSpace__ecere__com__Property * convert;
4603 struct Type * resultType;
4604 } __attribute__ ((gcc_struct));
4606 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4608 extern void Compiler_Warning(char * format, ...);
4610 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4612 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)
4616 if(source->kind == 20 && dest->kind != 20)
4618 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4623 if(dest->kind == 20 && source->kind != 20)
4625 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4630 if(dest->classObjectType == 2)
4632 if(source->classObjectType != 3)
4636 if((dest->_class && strcmp(dest->_class->string, "class")) || (source->_class && strcmp(source->_class->string, "class")))
4644 if(source->classObjectType == 3)
4646 if(dest->classObjectType == 3 && source->classObjectType != 2)
4649 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4651 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4654 if(dest->kind == 14 && source->kind != 0)
4656 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))
4658 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))
4660 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4662 if(source->_class->registered && source->_class->registered->type == 3)
4664 if(conversions != (((void *)0)))
4666 if(source->_class->registered == dest->_class->registered)
4671 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4673 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4675 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4677 if(sourceBase == destBase)
4681 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))
4685 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))
4687 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4694 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4698 if(source->kind == 8)
4700 struct __ecereNameSpace__ecere__com__Class * _class;
4702 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4704 struct __ecereNameSpace__ecere__com__Property * convert;
4706 for(convert = _class->conversions.first; convert; convert = convert->next)
4708 if(convert->memberAccess == 1 || _class->module == privateModule)
4710 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4712 if(!convert->dataType)
4713 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4714 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4716 if(!conversions && !convert->Get)
4718 else if(conversions != (((void *)0)))
4720 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))
4724 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4726 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4737 struct __ecereNameSpace__ecere__com__Class * _class;
4739 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4741 struct __ecereNameSpace__ecere__com__Property * convert;
4743 for(convert = _class->conversions.first; convert; convert = convert->next)
4745 if(convert->memberAccess == 1 || _class->module == privateModule)
4747 if(!convert->dataType)
4748 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4749 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4751 if(!conversions && !convert->Set)
4753 else if(conversions != (((void *)0)))
4755 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))
4759 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4761 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4769 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4771 if(!dest->_class->registered->dataType)
4772 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4773 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4775 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4782 if(source->kind == 8)
4784 struct __ecereNameSpace__ecere__com__Class * _class;
4786 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4788 struct __ecereNameSpace__ecere__com__Property * convert;
4790 for(convert = _class->conversions.first; convert; convert = convert->next)
4792 if(convert->memberAccess == 1 || _class->module == privateModule)
4794 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4796 if(!convert->dataType)
4797 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4798 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4800 if(!conversions && !convert->Get)
4802 else if(conversions != (((void *)0)))
4804 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))
4808 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4810 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4818 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4820 if(!source->_class->registered->dataType)
4821 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4822 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4829 if(source->kind == 8 || source->kind == 19)
4831 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4833 else if(dest->kind == 7 && source->kind == 6)
4835 else if(dest->kind == 2 && source->kind == 1)
4837 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4839 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4841 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4843 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4845 else if(source->kind == 15 && (dest->kind == 3 || dest->kind == 2 || dest->kind == 1 || dest->kind == 5 || dest->kind == 4 || dest->kind == 22 || dest->kind == 23))
4847 else if(dest->kind == 15 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 5 || source->kind == 4 || source->kind == 22 || source->kind == 23))
4849 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)))
4851 struct Type * paramSource, * paramDest;
4853 if(dest->kind == 16)
4854 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4855 if(source->kind == 16)
4856 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4857 if(dest->kind == 13 && dest->type->kind == 11)
4859 if(source->kind == 13 && source->type->kind == 11)
4860 source = source->type;
4861 if(dest->kind == 16)
4862 dest = dest->method->dataType;
4863 if(source->kind == 16)
4864 source = source->method->dataType;
4865 paramSource = source->params.first;
4866 if(paramSource && paramSource->kind == 0)
4867 paramSource = (((void *)0));
4868 paramDest = dest->params.first;
4869 if(paramDest && paramDest->kind == 0)
4870 paramDest = (((void *)0));
4871 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4873 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))))
4875 if(paramDest && paramDest->kind == 8)
4876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4878 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4881 paramDest = paramDest->next;
4883 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4885 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4889 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4897 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4906 paramSource = paramSource->next;
4912 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4914 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4920 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4922 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4928 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4930 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4933 for(; paramDest; paramDest = paramDest->next)
4937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4941 struct Type * paramDestType = paramDest;
4942 struct Type * paramSourceType = paramSource;
4943 struct Type * type = paramDestType;
4945 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4948 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4949 struct __ecereNameSpace__ecere__com__Class * sClass;
4951 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4954 if(sClass->templateClass)
4955 sClass = sClass->templateClass;
4956 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4958 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4960 for(sClass = sClass->base; sClass; sClass = sClass->base)
4962 if(sClass->templateClass)
4963 sClass = sClass->templateClass;
4964 id += sClass->templateParams.count;
4975 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4977 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4980 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)))
4985 PrintType(paramDest, type, 0x0, 0x1);
4986 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4987 if(paramDestType != paramDest)
4988 FreeType(paramDestType);
4991 if(paramDestType != paramDest)
4992 FreeType(paramDestType);
4994 paramSource = paramSource->next;
4998 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
5003 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
5007 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
5009 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5016 static void FreeConvert(struct Conversion * convert)
5018 if(convert->resultType)
5019 FreeType(convert->resultType);
5022 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5024 struct __ecereNameSpace__ecere__com__BTNamedLink
5027 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5028 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5029 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5032 } __attribute__ ((gcc_struct));
5034 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5036 struct __ecereNameSpace__ecere__com__EnumClassData
5038 struct __ecereNameSpace__ecere__sys__OldList values;
5040 } __attribute__ ((gcc_struct));
5042 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5044 struct __ecereNameSpace__ecere__sys__NamedLink
5046 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5047 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5050 } __attribute__ ((gcc_struct));
5052 extern void FreeExpContents(struct Expression * exp);
5054 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5056 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5058 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5060 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5062 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5064 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5066 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5068 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)))
5070 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5072 if(_class->type == 4)
5074 struct __ecereNameSpace__ecere__sys__OldList converts =
5078 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5082 _class->symbol = FindClass(_class->fullName);
5083 type->_class = _class->symbol;
5084 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5086 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5087 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5091 struct __ecereNameSpace__ecere__com__Class * baseClass;
5093 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5095 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5097 for(value = e->values.first; value; value = value->next)
5099 if(!strcmp(value->name, string))
5104 FreeExpContents(sourceExp);
5105 FreeType(sourceExp->expType);
5106 sourceExp->isConstant = 0x1;
5107 sourceExp->expType = MkClassType(baseClass->fullName);
5111 sourceExp->type = 2;
5112 if(!strcmp(baseClass->dataTypeString, "int"))
5113 sprintf(constant, "%d", (int)value->data);
5115 sprintf(constant, "0x%X", (int)value->data);
5116 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5118 while(converts.first)
5120 struct Conversion * convert = converts.first;
5122 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5123 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5125 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5132 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5133 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5136 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)))
5137 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5142 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5144 struct __ecereNameSpace__ecere__com__SubModule
5146 struct __ecereNameSpace__ecere__com__SubModule * prev;
5147 struct __ecereNameSpace__ecere__com__SubModule * next;
5148 struct __ecereNameSpace__ecere__com__Instance * module;
5150 } __attribute__ ((gcc_struct));
5152 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5154 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5156 if(searchFor == searchIn)
5158 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5160 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5162 if(ModuleVisibility(subModule->module, searchFor))
5169 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5171 struct __ecereNameSpace__ecere__com__Application
5176 unsigned int isGUIApp;
5177 struct __ecereNameSpace__ecere__sys__OldList allModules;
5178 char * parsedCommand;
5179 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5180 } __attribute__ ((gcc_struct));
5182 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5184 struct __ecereNameSpace__ecere__com__Instance * module;
5186 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))
5188 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))
5190 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))
5192 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)
5194 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5200 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5202 void ReadString(char * output, char * string);
5204 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5206 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5208 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5210 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5212 struct Type * source = sourceExp->expType;
5213 struct Type * realDest = dest;
5214 struct Type * backupSourceExpType = (((void *)0));
5216 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5218 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5220 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5222 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5224 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5226 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5228 if(sourceBase == destBase)
5234 struct __ecereNameSpace__ecere__sys__OldList * specs;
5235 unsigned int flag = 0x0;
5236 long long value = (((int)0x7fffffff));
5240 if(sourceExp->type == 2)
5242 if(source->isSigned)
5243 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5245 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5247 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5249 if(source->isSigned)
5250 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5252 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5254 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5257 source = __extension__ ({
5258 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5260 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5265 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5267 if(_class && _class->type == 3)
5269 if(source->kind != 8)
5271 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5272 struct Type * tempDest, * tempSource;
5274 for(; _class->base->type != 1000; _class = _class->base)
5277 tempDest = tempType;
5280 _class->symbol = FindClass(_class->fullName);
5281 tempType->_class = _class->symbol;
5282 tempType->truth = dest->truth;
5283 if(tempType->_class)
5284 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5285 backupSourceExpType = sourceExp->expType;
5286 sourceExp->expType = dest;
5289 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5292 if(_class && _class->type == 2 && source->kind != 8)
5294 if(!dest->_class->registered->dataType)
5295 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5296 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5299 FreeType(sourceExp->expType);
5300 source = sourceExp->expType = MkClassType(dest->_class->string);
5304 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5306 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5307 struct Declarator * decl;
5310 ReadString(string, sourceExp->string);
5311 decl = SpecDeclFromString(string, specs, (((void *)0)));
5312 FreeExpContents(sourceExp);
5313 FreeType(sourceExp->expType);
5314 sourceExp->type = 26;
5315 sourceExp->_classExp.specifiers = specs;
5316 sourceExp->_classExp.decl = decl;
5317 sourceExp->expType = dest;
5321 if(backupSourceExpType)
5322 FreeType(backupSourceExpType);
5326 else if(source->kind == 8)
5328 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5330 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5334 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5335 struct Type * tempDest, * tempSource;
5337 if(!source->_class->registered->dataType)
5338 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5339 for(; _class->base->type != 1000; _class = _class->base)
5342 tempSource = tempType;
5344 tempType->_class = FindClass(_class->fullName);
5345 tempType->truth = source->truth;
5346 tempType->classObjectType = source->classObjectType;
5347 if(tempType->_class)
5348 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5349 if(conversions->last)
5351 ((struct Conversion *)conversions->last)->resultType = dest;
5354 FreeType(sourceExp->expType);
5355 sourceExp->expType = MkClassType(_class->fullName);
5356 sourceExp->expType->truth = source->truth;
5357 sourceExp->expType->classObjectType = source->classObjectType;
5358 if(!sourceExp->destType)
5360 FreeType(sourceExp->destType);
5361 sourceExp->destType = sourceExp->expType;
5362 if(sourceExp->expType)
5363 sourceExp->expType->refCount++;
5365 if(!_class->dataType)
5366 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5368 dest = MkClassType(source->_class->string);
5369 dest->truth = source->truth;
5370 dest->classObjectType = source->classObjectType;
5372 source = _class->dataType;
5374 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5380 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5389 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5391 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5393 if(_class->type == 0 || _class->type == 5)
5395 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5397 *newExp = *sourceExp;
5398 if(sourceExp->destType)
5399 sourceExp->destType->refCount++;
5400 if(sourceExp->expType)
5401 sourceExp->expType->refCount++;
5402 sourceExp->type = 11;
5403 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5404 sourceExp->cast.exp = newExp;
5405 FreeType(sourceExp->expType);
5406 sourceExp->expType = (((void *)0));
5407 ProcessExpressionType(sourceExp);
5410 FreeType(sourceExp->expType);
5411 sourceExp->expType = dest;
5416 if(backupSourceExpType)
5417 FreeType(backupSourceExpType);
5420 if(!_class->dataType)
5421 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5423 dest = _class->dataType;
5426 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5428 specs = MkListOne(MkSpecifier(DOUBLE));
5430 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5432 specs = MkListOne(MkSpecifier(FLOAT));
5434 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5438 ListAdd(specs, MkSpecifier(UNSIGNED));
5439 ListAdd(specs, MkSpecifier(INT64));
5441 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5445 ListAdd(specs, MkSpecifier(UNSIGNED));
5446 ListAdd(specs, MkSpecifier(INT));
5448 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5452 ListAdd(specs, MkSpecifier(UNSIGNED));
5453 ListAdd(specs, MkSpecifier(SHORT));
5455 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5459 ListAdd(specs, MkSpecifier(UNSIGNED));
5460 ListAdd(specs, MkSpecifier(CHAR));
5466 if(backupSourceExpType)
5468 if(sourceExp->expType)
5469 FreeType(sourceExp->expType);
5470 sourceExp->expType = backupSourceExpType;
5475 else if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || source->kind == 4 || source->kind == 3 || source->kind == 15 || source->kind == 2 || source->kind == 1))
5477 specs = MkListOne(MkSpecifier(DOUBLE));
5479 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5481 specs = MkListOne(MkSpecifier(FLOAT));
5483 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 15 || source->kind == 2 || source->kind == 3) && (dest->isSigned ? (value >= -128 && value <= 127) : (value >= 0 && value <= 255)))
5487 ListAdd(specs, MkSpecifier(UNSIGNED));
5488 ListAdd(specs, MkSpecifier(CHAR));
5490 else if(dest->kind == 2 && (source->kind == 15 || source->kind == 1 || source->kind == 2 || (source->kind == 3 && (dest->isSigned ? (value >= -32768 && value <= 32767) : (value >= 0 && value <= 65535)))))
5494 ListAdd(specs, MkSpecifier(UNSIGNED));
5495 ListAdd(specs, MkSpecifier(SHORT));
5497 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5501 ListAdd(specs, MkSpecifier(UNSIGNED));
5502 ListAdd(specs, MkSpecifier(INT));
5504 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5508 ListAdd(specs, MkSpecifier(UNSIGNED));
5509 ListAdd(specs, MkSpecifier(INT64));
5511 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5513 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5519 if(backupSourceExpType)
5521 if(sourceExp->expType)
5522 FreeType(sourceExp->expType);
5523 sourceExp->expType = backupSourceExpType;
5529 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5531 *newExp = *sourceExp;
5532 newExp->prev = (((void *)0));
5533 newExp->next = (((void *)0));
5534 if(sourceExp->destType)
5535 sourceExp->destType->refCount++;
5536 if(sourceExp->expType)
5537 sourceExp->expType->refCount++;
5538 sourceExp->type = 11;
5539 if(realDest->kind == 8)
5541 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5542 FreeList(specs, FreeSpecifier);
5545 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5546 if(newExp->type == 4)
5548 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5551 sourceExp->cast.exp = newExp;
5552 FreeType(sourceExp->expType);
5553 sourceExp->expType = (((void *)0));
5554 ProcessExpressionType(sourceExp);
5557 FreeList(specs, FreeSpecifier);
5560 if(backupSourceExpType)
5561 FreeType(backupSourceExpType);
5566 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5567 sourceExp = (*sourceExp->list).last;
5568 if(sourceExp->type == 0)
5570 struct Identifier * id = sourceExp->identifier;
5574 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5576 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5577 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5581 for(; _class && _class->type == 4; _class = _class->base)
5583 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5584 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5586 for(value = e->values.first; value; value = value->next)
5588 if(!strcmp(value->name, id->string))
5593 FreeExpContents(sourceExp);
5594 FreeType(sourceExp->expType);
5595 sourceExp->isConstant = 0x1;
5596 sourceExp->expType = MkClassType(_class->fullName);
5600 sourceExp->type = 2;
5601 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5602 sprintf(constant, "%d", (int)value->data);
5604 sprintf(constant, "0x%X", (int)value->data);
5605 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5613 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5620 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5622 int value2 = op2->i;
5625 exp->string = PrintInt(op1->i + value2);
5628 exp->expType = op1->type;
5630 op1->type->refCount++;
5635 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5637 unsigned int value2 = op2->ui;
5640 exp->string = PrintUInt(op1->ui + value2);
5643 exp->expType = op1->type;
5645 op1->type->refCount++;
5650 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5652 short value2 = op2->s;
5655 exp->string = PrintShort(op1->s + value2);
5658 exp->expType = op1->type;
5660 op1->type->refCount++;
5665 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5667 unsigned short value2 = op2->us;
5670 exp->string = PrintUShort(op1->us + value2);
5673 exp->expType = op1->type;
5675 op1->type->refCount++;
5680 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5682 char value2 = op2->c;
5685 exp->string = PrintChar(op1->c + value2);
5688 exp->expType = op1->type;
5690 op1->type->refCount++;
5695 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5697 unsigned char value2 = op2->uc;
5700 exp->string = PrintUChar(op1->uc + value2);
5703 exp->expType = op1->type;
5705 op1->type->refCount++;
5710 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5712 float value2 = op2->f;
5715 exp->string = PrintFloat(op1->f + value2);
5718 exp->expType = op1->type;
5720 op1->type->refCount++;
5725 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5727 double value2 = op2->d;
5730 exp->string = PrintDouble(op1->d + value2);
5733 exp->expType = op1->type;
5735 op1->type->refCount++;
5740 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5742 int value2 = op2->i;
5745 exp->string = PrintInt(op1->i - value2);
5748 exp->expType = op1->type;
5750 op1->type->refCount++;
5755 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5757 unsigned int value2 = op2->ui;
5760 exp->string = PrintUInt(op1->ui - value2);
5763 exp->expType = op1->type;
5765 op1->type->refCount++;
5770 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5772 short value2 = op2->s;
5775 exp->string = PrintShort(op1->s - value2);
5778 exp->expType = op1->type;
5780 op1->type->refCount++;
5785 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5787 unsigned short value2 = op2->us;
5790 exp->string = PrintUShort(op1->us - value2);
5793 exp->expType = op1->type;
5795 op1->type->refCount++;
5800 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5802 char value2 = op2->c;
5805 exp->string = PrintChar(op1->c - value2);
5808 exp->expType = op1->type;
5810 op1->type->refCount++;
5815 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5817 unsigned char value2 = op2->uc;
5820 exp->string = PrintUChar(op1->uc - value2);
5823 exp->expType = op1->type;
5825 op1->type->refCount++;
5830 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5832 float value2 = op2->f;
5835 exp->string = PrintFloat(op1->f - value2);
5838 exp->expType = op1->type;
5840 op1->type->refCount++;
5845 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5847 double value2 = op2->d;
5850 exp->string = PrintDouble(op1->d - value2);
5853 exp->expType = op1->type;
5855 op1->type->refCount++;
5860 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5862 int value2 = op2->i;
5865 exp->string = PrintInt(op1->i * value2);
5868 exp->expType = op1->type;
5870 op1->type->refCount++;
5875 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5877 unsigned int value2 = op2->ui;
5880 exp->string = PrintUInt(op1->ui * value2);
5883 exp->expType = op1->type;
5885 op1->type->refCount++;
5890 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5892 short value2 = op2->s;
5895 exp->string = PrintShort(op1->s * value2);
5898 exp->expType = op1->type;
5900 op1->type->refCount++;
5905 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5907 unsigned short value2 = op2->us;
5910 exp->string = PrintUShort(op1->us * value2);
5913 exp->expType = op1->type;
5915 op1->type->refCount++;
5920 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5922 char value2 = op2->c;
5925 exp->string = PrintChar(op1->c * value2);
5928 exp->expType = op1->type;
5930 op1->type->refCount++;
5935 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5937 unsigned char value2 = op2->uc;
5940 exp->string = PrintUChar(op1->uc * value2);
5943 exp->expType = op1->type;
5945 op1->type->refCount++;
5950 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5952 float value2 = op2->f;
5955 exp->string = PrintFloat(op1->f * value2);
5958 exp->expType = op1->type;
5960 op1->type->refCount++;
5965 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5967 double value2 = op2->d;
5970 exp->string = PrintDouble(op1->d * value2);
5973 exp->expType = op1->type;
5975 op1->type->refCount++;
5980 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5982 int value2 = op2->i;
5985 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5988 exp->expType = op1->type;
5990 op1->type->refCount++;
5995 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 unsigned int value2 = op2->ui;
6000 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
6003 exp->expType = op1->type;
6005 op1->type->refCount++;
6010 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 short value2 = op2->s;
6015 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6018 exp->expType = op1->type;
6020 op1->type->refCount++;
6025 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 unsigned short value2 = op2->us;
6030 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6033 exp->expType = op1->type;
6035 op1->type->refCount++;
6040 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 char value2 = op2->c;
6045 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6048 exp->expType = op1->type;
6050 op1->type->refCount++;
6055 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6057 unsigned char value2 = op2->uc;
6060 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6063 exp->expType = op1->type;
6065 op1->type->refCount++;
6070 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6072 float value2 = op2->f;
6075 exp->string = PrintFloat(value2 ? (op1->f / value2) : 0);
6078 exp->expType = op1->type;
6080 op1->type->refCount++;
6085 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6087 double value2 = op2->d;
6090 exp->string = PrintDouble(value2 ? (op1->d / value2) : 0);
6093 exp->expType = op1->type;
6095 op1->type->refCount++;
6100 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6102 int value2 = op2->i;
6105 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6108 exp->expType = op1->type;
6110 op1->type->refCount++;
6115 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6117 unsigned int value2 = op2->ui;
6120 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6123 exp->expType = op1->type;
6125 op1->type->refCount++;
6130 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6132 short value2 = op2->s;
6135 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6138 exp->expType = op1->type;
6140 op1->type->refCount++;
6145 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6147 unsigned short value2 = op2->us;
6150 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6153 exp->expType = op1->type;
6155 op1->type->refCount++;
6160 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6162 char value2 = op2->c;
6165 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6168 exp->expType = op1->type;
6170 op1->type->refCount++;
6175 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6177 unsigned char value2 = op2->uc;
6180 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6183 exp->expType = op1->type;
6185 op1->type->refCount++;
6190 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6193 exp->string = PrintInt(-op1->i);
6196 exp->expType = op1->type;
6198 op1->type->refCount++;
6203 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6206 exp->string = PrintUInt(-op1->ui);
6209 exp->expType = op1->type;
6211 op1->type->refCount++;
6216 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6219 exp->string = PrintShort(-op1->s);
6222 exp->expType = op1->type;
6224 op1->type->refCount++;
6229 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6232 exp->string = PrintUShort(-op1->us);
6235 exp->expType = op1->type;
6237 op1->type->refCount++;
6242 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6245 exp->string = PrintChar(-op1->c);
6248 exp->expType = op1->type;
6250 op1->type->refCount++;
6255 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6258 exp->string = PrintUChar(-op1->uc);
6261 exp->expType = op1->type;
6263 op1->type->refCount++;
6268 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6271 exp->string = PrintFloat(-op1->f);
6274 exp->expType = op1->type;
6276 op1->type->refCount++;
6281 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6284 exp->string = PrintDouble(-op1->d);
6287 exp->expType = op1->type;
6289 op1->type->refCount++;
6294 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6297 exp->string = PrintInt(++op1->i);
6300 exp->expType = op1->type;
6302 op1->type->refCount++;
6307 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6310 exp->string = PrintUInt(++op1->ui);
6313 exp->expType = op1->type;
6315 op1->type->refCount++;
6320 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6323 exp->string = PrintShort(++op1->s);
6326 exp->expType = op1->type;
6328 op1->type->refCount++;
6333 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6336 exp->string = PrintUShort(++op1->us);
6339 exp->expType = op1->type;
6341 op1->type->refCount++;
6346 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6349 exp->string = PrintChar(++op1->c);
6352 exp->expType = op1->type;
6354 op1->type->refCount++;
6359 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6362 exp->string = PrintUChar(++op1->uc);
6365 exp->expType = op1->type;
6367 op1->type->refCount++;
6372 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6375 exp->string = PrintFloat(++op1->f);
6378 exp->expType = op1->type;
6380 op1->type->refCount++;
6385 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6388 exp->string = PrintDouble(++op1->d);
6391 exp->expType = op1->type;
6393 op1->type->refCount++;
6398 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6401 exp->string = PrintInt(--op1->i);
6404 exp->expType = op1->type;
6406 op1->type->refCount++;
6411 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6414 exp->string = PrintUInt(--op1->ui);
6417 exp->expType = op1->type;
6419 op1->type->refCount++;
6424 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6427 exp->string = PrintShort(--op1->s);
6430 exp->expType = op1->type;
6432 op1->type->refCount++;
6437 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6440 exp->string = PrintUShort(--op1->us);
6443 exp->expType = op1->type;
6445 op1->type->refCount++;
6450 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6453 exp->string = PrintChar(--op1->c);
6456 exp->expType = op1->type;
6458 op1->type->refCount++;
6463 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6466 exp->string = PrintUChar(--op1->uc);
6469 exp->expType = op1->type;
6471 op1->type->refCount++;
6476 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6479 exp->string = PrintFloat(--op1->f);
6482 exp->expType = op1->type;
6484 op1->type->refCount++;
6489 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6492 exp->string = PrintDouble(--op1->d);
6495 exp->expType = op1->type;
6497 op1->type->refCount++;
6502 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6504 int value2 = op2->i;
6507 exp->string = PrintInt(op1->i = value2);
6510 exp->expType = op1->type;
6512 op1->type->refCount++;
6517 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6519 unsigned int value2 = op2->ui;
6522 exp->string = PrintUInt(op1->ui = value2);
6525 exp->expType = op1->type;
6527 op1->type->refCount++;
6532 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6534 short value2 = op2->s;
6537 exp->string = PrintShort(op1->s = value2);
6540 exp->expType = op1->type;
6542 op1->type->refCount++;
6547 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6549 unsigned short value2 = op2->us;
6552 exp->string = PrintUShort(op1->us = value2);
6555 exp->expType = op1->type;
6557 op1->type->refCount++;
6562 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6564 char value2 = op2->c;
6567 exp->string = PrintChar(op1->c = value2);
6570 exp->expType = op1->type;
6572 op1->type->refCount++;
6577 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6579 unsigned char value2 = op2->uc;
6582 exp->string = PrintUChar(op1->uc = value2);
6585 exp->expType = op1->type;
6587 op1->type->refCount++;
6592 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6594 float value2 = op2->f;
6597 exp->string = PrintFloat(op1->f = value2);
6600 exp->expType = op1->type;
6602 op1->type->refCount++;
6607 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6609 double value2 = op2->d;
6612 exp->string = PrintDouble(op1->d = value2);
6615 exp->expType = op1->type;
6617 op1->type->refCount++;
6622 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6624 int value2 = op2->i;
6627 exp->string = PrintInt(op1->i += value2);
6630 exp->expType = op1->type;
6632 op1->type->refCount++;
6637 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6639 unsigned int value2 = op2->ui;
6642 exp->string = PrintUInt(op1->ui += value2);
6645 exp->expType = op1->type;
6647 op1->type->refCount++;
6652 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6654 short value2 = op2->s;
6657 exp->string = PrintShort(op1->s += value2);
6660 exp->expType = op1->type;
6662 op1->type->refCount++;
6667 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6669 unsigned short value2 = op2->us;
6672 exp->string = PrintUShort(op1->us += value2);
6675 exp->expType = op1->type;
6677 op1->type->refCount++;
6682 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6684 char value2 = op2->c;
6687 exp->string = PrintChar(op1->c += value2);
6690 exp->expType = op1->type;
6692 op1->type->refCount++;
6697 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6699 unsigned char value2 = op2->uc;
6702 exp->string = PrintUChar(op1->uc += value2);
6705 exp->expType = op1->type;
6707 op1->type->refCount++;
6712 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6714 float value2 = op2->f;
6717 exp->string = PrintFloat(op1->f += value2);
6720 exp->expType = op1->type;
6722 op1->type->refCount++;
6727 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6729 double value2 = op2->d;
6732 exp->string = PrintDouble(op1->d += value2);
6735 exp->expType = op1->type;
6737 op1->type->refCount++;
6742 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6744 int value2 = op2->i;
6747 exp->string = PrintInt(op1->i -= value2);
6750 exp->expType = op1->type;
6752 op1->type->refCount++;
6757 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6759 unsigned int value2 = op2->ui;
6762 exp->string = PrintUInt(op1->ui -= value2);
6765 exp->expType = op1->type;
6767 op1->type->refCount++;
6772 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6774 short value2 = op2->s;
6777 exp->string = PrintShort(op1->s -= value2);
6780 exp->expType = op1->type;
6782 op1->type->refCount++;
6787 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6789 unsigned short value2 = op2->us;
6792 exp->string = PrintUShort(op1->us -= value2);
6795 exp->expType = op1->type;
6797 op1->type->refCount++;
6802 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6804 char value2 = op2->c;
6807 exp->string = PrintChar(op1->c -= value2);
6810 exp->expType = op1->type;
6812 op1->type->refCount++;
6817 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6819 unsigned char value2 = op2->uc;
6822 exp->string = PrintUChar(op1->uc -= value2);
6825 exp->expType = op1->type;
6827 op1->type->refCount++;
6832 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6834 float value2 = op2->f;
6837 exp->string = PrintFloat(op1->f -= value2);
6840 exp->expType = op1->type;
6842 op1->type->refCount++;
6847 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6849 double value2 = op2->d;
6852 exp->string = PrintDouble(op1->d -= value2);
6855 exp->expType = op1->type;
6857 op1->type->refCount++;
6862 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6864 int value2 = op2->i;
6867 exp->string = PrintInt(op1->i *= value2);
6870 exp->expType = op1->type;
6872 op1->type->refCount++;
6877 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6879 unsigned int value2 = op2->ui;
6882 exp->string = PrintUInt(op1->ui *= value2);
6885 exp->expType = op1->type;
6887 op1->type->refCount++;
6892 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6894 short value2 = op2->s;
6897 exp->string = PrintShort(op1->s *= value2);
6900 exp->expType = op1->type;
6902 op1->type->refCount++;
6907 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6909 unsigned short value2 = op2->us;
6912 exp->string = PrintUShort(op1->us *= value2);
6915 exp->expType = op1->type;
6917 op1->type->refCount++;
6922 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6924 char value2 = op2->c;
6927 exp->string = PrintChar(op1->c *= value2);
6930 exp->expType = op1->type;
6932 op1->type->refCount++;
6937 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6939 unsigned char value2 = op2->uc;
6942 exp->string = PrintUChar(op1->uc *= value2);
6945 exp->expType = op1->type;
6947 op1->type->refCount++;
6952 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6954 float value2 = op2->f;
6957 exp->string = PrintFloat(op1->f *= value2);
6960 exp->expType = op1->type;
6962 op1->type->refCount++;
6967 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6969 double value2 = op2->d;
6972 exp->string = PrintDouble(op1->d *= value2);
6975 exp->expType = op1->type;
6977 op1->type->refCount++;
6982 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6984 int value2 = op2->i;
6987 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6990 exp->expType = op1->type;
6992 op1->type->refCount++;
6997 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6999 unsigned int value2 = op2->ui;
7002 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
7005 exp->expType = op1->type;
7007 op1->type->refCount++;
7012 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7014 short value2 = op2->s;
7017 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7020 exp->expType = op1->type;
7022 op1->type->refCount++;
7027 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7029 unsigned short value2 = op2->us;
7032 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7035 exp->expType = op1->type;
7037 op1->type->refCount++;
7042 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7044 char value2 = op2->c;
7047 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7050 exp->expType = op1->type;
7052 op1->type->refCount++;
7057 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7059 unsigned char value2 = op2->uc;
7062 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7065 exp->expType = op1->type;
7067 op1->type->refCount++;
7072 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7074 float value2 = op2->f;
7077 exp->string = PrintFloat(value2 ? (op1->f /= value2) : 0);
7080 exp->expType = op1->type;
7082 op1->type->refCount++;
7087 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7089 double value2 = op2->d;
7092 exp->string = PrintDouble(value2 ? (op1->d /= value2) : 0);
7095 exp->expType = op1->type;
7097 op1->type->refCount++;
7102 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7104 int value2 = op2->i;
7107 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7110 exp->expType = op1->type;
7112 op1->type->refCount++;
7117 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7119 unsigned int value2 = op2->ui;
7122 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7125 exp->expType = op1->type;
7127 op1->type->refCount++;
7132 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7134 short value2 = op2->s;
7137 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7140 exp->expType = op1->type;
7142 op1->type->refCount++;
7147 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7149 unsigned short value2 = op2->us;
7152 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7155 exp->expType = op1->type;
7157 op1->type->refCount++;
7162 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7164 char value2 = op2->c;
7167 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7170 exp->expType = op1->type;
7172 op1->type->refCount++;
7177 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7179 unsigned char value2 = op2->uc;
7182 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7185 exp->expType = op1->type;
7187 op1->type->refCount++;
7192 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7194 int value2 = op2->i;
7197 exp->string = PrintInt(op1->i & value2);
7200 exp->expType = op1->type;
7202 op1->type->refCount++;
7207 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7209 unsigned int value2 = op2->ui;
7212 exp->string = PrintUInt(op1->ui & value2);
7215 exp->expType = op1->type;
7217 op1->type->refCount++;
7222 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7224 short value2 = op2->s;
7227 exp->string = PrintShort(op1->s & value2);
7230 exp->expType = op1->type;
7232 op1->type->refCount++;
7237 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7239 unsigned short value2 = op2->us;
7242 exp->string = PrintUShort(op1->us & value2);
7245 exp->expType = op1->type;
7247 op1->type->refCount++;
7252 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7254 char value2 = op2->c;
7257 exp->string = PrintChar(op1->c & value2);
7260 exp->expType = op1->type;
7262 op1->type->refCount++;
7267 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7269 unsigned char value2 = op2->uc;
7272 exp->string = PrintUChar(op1->uc & value2);
7275 exp->expType = op1->type;
7277 op1->type->refCount++;
7282 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7284 int value2 = op2->i;
7287 exp->string = PrintInt(op1->i | value2);
7290 exp->expType = op1->type;
7292 op1->type->refCount++;
7297 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7299 unsigned int value2 = op2->ui;
7302 exp->string = PrintUInt(op1->ui | value2);
7305 exp->expType = op1->type;
7307 op1->type->refCount++;
7312 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7314 short value2 = op2->s;
7317 exp->string = PrintShort(op1->s | value2);
7320 exp->expType = op1->type;
7322 op1->type->refCount++;
7327 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7329 unsigned short value2 = op2->us;
7332 exp->string = PrintUShort(op1->us | value2);
7335 exp->expType = op1->type;
7337 op1->type->refCount++;
7342 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7344 char value2 = op2->c;
7347 exp->string = PrintChar(op1->c | value2);
7350 exp->expType = op1->type;
7352 op1->type->refCount++;
7357 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7359 unsigned char value2 = op2->uc;
7362 exp->string = PrintUChar(op1->uc | value2);
7365 exp->expType = op1->type;
7367 op1->type->refCount++;
7372 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7374 int value2 = op2->i;
7377 exp->string = PrintInt(op1->i ^ value2);
7380 exp->expType = op1->type;
7382 op1->type->refCount++;
7387 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7389 unsigned int value2 = op2->ui;
7392 exp->string = PrintUInt(op1->ui ^ value2);
7395 exp->expType = op1->type;
7397 op1->type->refCount++;
7402 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7404 short value2 = op2->s;
7407 exp->string = PrintShort(op1->s ^ value2);
7410 exp->expType = op1->type;
7412 op1->type->refCount++;
7417 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7419 unsigned short value2 = op2->us;
7422 exp->string = PrintUShort(op1->us ^ value2);
7425 exp->expType = op1->type;
7427 op1->type->refCount++;
7432 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7434 char value2 = op2->c;
7437 exp->string = PrintChar(op1->c ^ value2);
7440 exp->expType = op1->type;
7442 op1->type->refCount++;
7447 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7449 unsigned char value2 = op2->uc;
7452 exp->string = PrintUChar(op1->uc ^ value2);
7455 exp->expType = op1->type;
7457 op1->type->refCount++;
7462 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7464 int value2 = op2->i;
7467 exp->string = PrintInt(op1->i << value2);
7470 exp->expType = op1->type;
7472 op1->type->refCount++;
7477 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7479 unsigned int value2 = op2->ui;
7482 exp->string = PrintUInt(op1->ui << value2);
7485 exp->expType = op1->type;
7487 op1->type->refCount++;
7492 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7494 short value2 = op2->s;
7497 exp->string = PrintShort(op1->s << value2);
7500 exp->expType = op1->type;
7502 op1->type->refCount++;
7507 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7509 unsigned short value2 = op2->us;
7512 exp->string = PrintUShort(op1->us << value2);
7515 exp->expType = op1->type;
7517 op1->type->refCount++;
7522 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7524 char value2 = op2->c;
7527 exp->string = PrintChar(op1->c << value2);
7530 exp->expType = op1->type;
7532 op1->type->refCount++;
7537 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7539 unsigned char value2 = op2->uc;
7542 exp->string = PrintUChar(op1->uc << value2);
7545 exp->expType = op1->type;
7547 op1->type->refCount++;
7552 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7554 int value2 = op2->i;
7557 exp->string = PrintInt(op1->i >> value2);
7560 exp->expType = op1->type;
7562 op1->type->refCount++;
7567 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7569 unsigned int value2 = op2->ui;
7572 exp->string = PrintUInt(op1->ui >> value2);
7575 exp->expType = op1->type;
7577 op1->type->refCount++;
7582 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7584 short value2 = op2->s;
7587 exp->string = PrintShort(op1->s >> value2);
7590 exp->expType = op1->type;
7592 op1->type->refCount++;
7597 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7599 unsigned short value2 = op2->us;
7602 exp->string = PrintUShort(op1->us >> value2);
7605 exp->expType = op1->type;
7607 op1->type->refCount++;
7612 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7614 char value2 = op2->c;
7617 exp->string = PrintChar(op1->c >> value2);
7620 exp->expType = op1->type;
7622 op1->type->refCount++;
7627 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7629 unsigned char value2 = op2->uc;
7632 exp->string = PrintUChar(op1->uc >> value2);
7635 exp->expType = op1->type;
7637 op1->type->refCount++;
7642 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7645 exp->string = PrintInt(~op1->i);
7648 exp->expType = op1->type;
7650 op1->type->refCount++;
7655 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7658 exp->string = PrintUInt(~op1->ui);
7661 exp->expType = op1->type;
7663 op1->type->refCount++;
7668 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7671 exp->string = PrintShort(~op1->s);
7674 exp->expType = op1->type;
7676 op1->type->refCount++;
7681 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7684 exp->string = PrintUShort(~op1->us);
7687 exp->expType = op1->type;
7689 op1->type->refCount++;
7694 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7697 exp->string = PrintChar(~op1->c);
7700 exp->expType = op1->type;
7702 op1->type->refCount++;
7707 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7710 exp->string = PrintUChar(~op1->uc);
7713 exp->expType = op1->type;
7715 op1->type->refCount++;
7720 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7722 int value2 = op2->i;
7725 exp->string = PrintInt(op1->i &= value2);
7728 exp->expType = op1->type;
7730 op1->type->refCount++;
7735 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7737 unsigned int value2 = op2->ui;
7740 exp->string = PrintUInt(op1->ui &= value2);
7743 exp->expType = op1->type;
7745 op1->type->refCount++;
7750 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7752 short value2 = op2->s;
7755 exp->string = PrintShort(op1->s &= value2);
7758 exp->expType = op1->type;
7760 op1->type->refCount++;
7765 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7767 unsigned short value2 = op2->us;
7770 exp->string = PrintUShort(op1->us &= value2);
7773 exp->expType = op1->type;
7775 op1->type->refCount++;
7780 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7782 char value2 = op2->c;
7785 exp->string = PrintChar(op1->c &= value2);
7788 exp->expType = op1->type;
7790 op1->type->refCount++;
7795 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7797 unsigned char value2 = op2->uc;
7800 exp->string = PrintUChar(op1->uc &= value2);
7803 exp->expType = op1->type;
7805 op1->type->refCount++;
7810 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7812 int value2 = op2->i;
7815 exp->string = PrintInt(op1->i |= value2);
7818 exp->expType = op1->type;
7820 op1->type->refCount++;
7825 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7827 unsigned int value2 = op2->ui;
7830 exp->string = PrintUInt(op1->ui |= value2);
7833 exp->expType = op1->type;
7835 op1->type->refCount++;
7840 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7842 short value2 = op2->s;
7845 exp->string = PrintShort(op1->s |= value2);
7848 exp->expType = op1->type;
7850 op1->type->refCount++;
7855 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7857 unsigned short value2 = op2->us;
7860 exp->string = PrintUShort(op1->us |= value2);
7863 exp->expType = op1->type;
7865 op1->type->refCount++;
7870 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7872 char value2 = op2->c;
7875 exp->string = PrintChar(op1->c |= value2);
7878 exp->expType = op1->type;
7880 op1->type->refCount++;
7885 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7887 unsigned char value2 = op2->uc;
7890 exp->string = PrintUChar(op1->uc |= value2);
7893 exp->expType = op1->type;
7895 op1->type->refCount++;
7900 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7902 int value2 = op2->i;
7905 exp->string = PrintInt(op1->i ^= value2);
7908 exp->expType = op1->type;
7910 op1->type->refCount++;
7915 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7917 unsigned int value2 = op2->ui;
7920 exp->string = PrintUInt(op1->ui ^= value2);
7923 exp->expType = op1->type;
7925 op1->type->refCount++;
7930 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7932 short value2 = op2->s;
7935 exp->string = PrintShort(op1->s ^= value2);
7938 exp->expType = op1->type;
7940 op1->type->refCount++;
7945 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7947 unsigned short value2 = op2->us;
7950 exp->string = PrintUShort(op1->us ^= value2);
7953 exp->expType = op1->type;
7955 op1->type->refCount++;
7960 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7962 char value2 = op2->c;
7965 exp->string = PrintChar(op1->c ^= value2);
7968 exp->expType = op1->type;
7970 op1->type->refCount++;
7975 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7977 unsigned char value2 = op2->uc;
7980 exp->string = PrintUChar(op1->uc ^= value2);
7983 exp->expType = op1->type;
7985 op1->type->refCount++;
7990 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7992 int value2 = op2->i;
7995 exp->string = PrintInt(op1->i <<= value2);
7998 exp->expType = op1->type;
8000 op1->type->refCount++;
8005 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8007 unsigned int value2 = op2->ui;
8010 exp->string = PrintUInt(op1->ui <<= value2);
8013 exp->expType = op1->type;
8015 op1->type->refCount++;
8020 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8022 short value2 = op2->s;
8025 exp->string = PrintShort(op1->s <<= value2);
8028 exp->expType = op1->type;
8030 op1->type->refCount++;
8035 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8037 unsigned short value2 = op2->us;
8040 exp->string = PrintUShort(op1->us <<= value2);
8043 exp->expType = op1->type;
8045 op1->type->refCount++;
8050 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8052 char value2 = op2->c;
8055 exp->string = PrintChar(op1->c <<= value2);
8058 exp->expType = op1->type;
8060 op1->type->refCount++;
8065 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8067 unsigned char value2 = op2->uc;
8070 exp->string = PrintUChar(op1->uc <<= value2);
8073 exp->expType = op1->type;
8075 op1->type->refCount++;
8080 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8082 int value2 = op2->i;
8085 exp->string = PrintInt(op1->i >>= value2);
8088 exp->expType = op1->type;
8090 op1->type->refCount++;
8095 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8097 unsigned int value2 = op2->ui;
8100 exp->string = PrintUInt(op1->ui >>= value2);
8103 exp->expType = op1->type;
8105 op1->type->refCount++;
8110 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8112 short value2 = op2->s;
8115 exp->string = PrintShort(op1->s >>= value2);
8118 exp->expType = op1->type;
8120 op1->type->refCount++;
8125 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8127 unsigned short value2 = op2->us;
8130 exp->string = PrintUShort(op1->us >>= value2);
8133 exp->expType = op1->type;
8135 op1->type->refCount++;
8140 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8142 char value2 = op2->c;
8145 exp->string = PrintChar(op1->c >>= value2);
8148 exp->expType = op1->type;
8150 op1->type->refCount++;
8155 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8157 unsigned char value2 = op2->uc;
8160 exp->string = PrintUChar(op1->uc >>= value2);
8163 exp->expType = op1->type;
8165 op1->type->refCount++;
8170 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8173 exp->string = PrintInt(!op1->i);
8176 exp->expType = op1->type;
8178 op1->type->refCount++;
8183 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8186 exp->string = PrintUInt(!op1->ui);
8189 exp->expType = op1->type;
8191 op1->type->refCount++;
8196 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8199 exp->string = PrintShort(!op1->s);
8202 exp->expType = op1->type;
8204 op1->type->refCount++;
8209 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8212 exp->string = PrintUShort(!op1->us);
8215 exp->expType = op1->type;
8217 op1->type->refCount++;
8222 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8225 exp->string = PrintChar(!op1->c);
8228 exp->expType = op1->type;
8230 op1->type->refCount++;
8235 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8238 exp->string = PrintUChar(!op1->uc);
8241 exp->expType = op1->type;
8243 op1->type->refCount++;
8248 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8250 int value2 = op2->i;
8253 exp->string = PrintInt(op1->i == value2);
8256 exp->expType = op1->type;
8258 op1->type->refCount++;
8263 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8265 unsigned int value2 = op2->ui;
8268 exp->string = PrintUInt(op1->ui == value2);
8271 exp->expType = op1->type;
8273 op1->type->refCount++;
8278 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8280 short value2 = op2->s;
8283 exp->string = PrintShort(op1->s == value2);
8286 exp->expType = op1->type;
8288 op1->type->refCount++;
8293 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8295 unsigned short value2 = op2->us;
8298 exp->string = PrintUShort(op1->us == value2);
8301 exp->expType = op1->type;
8303 op1->type->refCount++;
8308 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8310 char value2 = op2->c;
8313 exp->string = PrintChar(op1->c == value2);
8316 exp->expType = op1->type;
8318 op1->type->refCount++;
8323 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 unsigned char value2 = op2->uc;
8328 exp->string = PrintUChar(op1->uc == value2);
8331 exp->expType = op1->type;
8333 op1->type->refCount++;
8338 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 float value2 = op2->f;
8343 exp->string = PrintFloat(op1->f == value2);
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 double value2 = op2->d;
8358 exp->string = PrintDouble(op1->d == value2);
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 int value2 = op2->i;
8373 exp->string = PrintInt(op1->i != value2);
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 unsigned int value2 = op2->ui;
8388 exp->string = PrintUInt(op1->ui != value2);
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 short value2 = op2->s;
8403 exp->string = PrintShort(op1->s != value2);
8406 exp->expType = op1->type;
8408 op1->type->refCount++;
8413 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 unsigned short value2 = op2->us;
8418 exp->string = PrintUShort(op1->us != value2);
8421 exp->expType = op1->type;
8423 op1->type->refCount++;
8428 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 char value2 = op2->c;
8433 exp->string = PrintChar(op1->c != value2);
8436 exp->expType = op1->type;
8438 op1->type->refCount++;
8443 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 unsigned char value2 = op2->uc;
8448 exp->string = PrintUChar(op1->uc != value2);
8451 exp->expType = op1->type;
8453 op1->type->refCount++;
8458 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 float value2 = op2->f;
8463 exp->string = PrintFloat(op1->f != value2);
8466 exp->expType = op1->type;
8468 op1->type->refCount++;
8473 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 double value2 = op2->d;
8478 exp->string = PrintDouble(op1->d != value2);
8481 exp->expType = op1->type;
8483 op1->type->refCount++;
8488 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 int value2 = op2->i;
8493 exp->string = PrintInt(op1->i && value2);
8496 exp->expType = op1->type;
8498 op1->type->refCount++;
8503 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 unsigned int value2 = op2->ui;
8508 exp->string = PrintUInt(op1->ui && value2);
8511 exp->expType = op1->type;
8513 op1->type->refCount++;
8518 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 short value2 = op2->s;
8523 exp->string = PrintShort(op1->s && value2);
8526 exp->expType = op1->type;
8528 op1->type->refCount++;
8533 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 unsigned short value2 = op2->us;
8538 exp->string = PrintUShort(op1->us && value2);
8541 exp->expType = op1->type;
8543 op1->type->refCount++;
8548 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 char value2 = op2->c;
8553 exp->string = PrintChar(op1->c && value2);
8556 exp->expType = op1->type;
8558 op1->type->refCount++;
8563 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 unsigned char value2 = op2->uc;
8568 exp->string = PrintUChar(op1->uc && value2);
8571 exp->expType = op1->type;
8573 op1->type->refCount++;
8578 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 float value2 = op2->f;
8583 exp->string = PrintFloat(op1->f && value2);
8586 exp->expType = op1->type;
8588 op1->type->refCount++;
8593 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 double value2 = op2->d;
8598 exp->string = PrintDouble(op1->d && value2);
8601 exp->expType = op1->type;
8603 op1->type->refCount++;
8608 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 int value2 = op2->i;
8613 exp->string = PrintInt(op1->i || value2);
8616 exp->expType = op1->type;
8618 op1->type->refCount++;
8623 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 unsigned int value2 = op2->ui;
8628 exp->string = PrintUInt(op1->ui || value2);
8631 exp->expType = op1->type;
8633 op1->type->refCount++;
8638 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 short value2 = op2->s;
8643 exp->string = PrintShort(op1->s || value2);
8646 exp->expType = op1->type;
8648 op1->type->refCount++;
8653 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 unsigned short value2 = op2->us;
8658 exp->string = PrintUShort(op1->us || value2);
8661 exp->expType = op1->type;
8663 op1->type->refCount++;
8668 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 char value2 = op2->c;
8673 exp->string = PrintChar(op1->c || value2);
8676 exp->expType = op1->type;
8678 op1->type->refCount++;
8683 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 unsigned char value2 = op2->uc;
8688 exp->string = PrintUChar(op1->uc || value2);
8691 exp->expType = op1->type;
8693 op1->type->refCount++;
8698 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 float value2 = op2->f;
8703 exp->string = PrintFloat(op1->f || value2);
8706 exp->expType = op1->type;
8708 op1->type->refCount++;
8713 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 double value2 = op2->d;
8718 exp->string = PrintDouble(op1->d || value2);
8721 exp->expType = op1->type;
8723 op1->type->refCount++;
8728 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 int value2 = op2->i;
8733 exp->string = PrintInt(op1->i > value2);
8736 exp->expType = op1->type;
8738 op1->type->refCount++;
8743 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 unsigned int value2 = op2->ui;
8748 exp->string = PrintUInt(op1->ui > value2);
8751 exp->expType = op1->type;
8753 op1->type->refCount++;
8758 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 short value2 = op2->s;
8763 exp->string = PrintShort(op1->s > value2);
8766 exp->expType = op1->type;
8768 op1->type->refCount++;
8773 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 unsigned short value2 = op2->us;
8778 exp->string = PrintUShort(op1->us > value2);
8781 exp->expType = op1->type;
8783 op1->type->refCount++;
8788 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 char value2 = op2->c;
8793 exp->string = PrintChar(op1->c > value2);
8796 exp->expType = op1->type;
8798 op1->type->refCount++;
8803 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 unsigned char value2 = op2->uc;
8808 exp->string = PrintUChar(op1->uc > value2);
8811 exp->expType = op1->type;
8813 op1->type->refCount++;
8818 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 float value2 = op2->f;
8823 exp->string = PrintFloat(op1->f > value2);
8826 exp->expType = op1->type;
8828 op1->type->refCount++;
8833 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 double value2 = op2->d;
8838 exp->string = PrintDouble(op1->d > value2);
8841 exp->expType = op1->type;
8843 op1->type->refCount++;
8848 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 int value2 = op2->i;
8853 exp->string = PrintInt(op1->i < value2);
8856 exp->expType = op1->type;
8858 op1->type->refCount++;
8863 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 unsigned int value2 = op2->ui;
8868 exp->string = PrintUInt(op1->ui < value2);
8871 exp->expType = op1->type;
8873 op1->type->refCount++;
8878 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 short value2 = op2->s;
8883 exp->string = PrintShort(op1->s < value2);
8886 exp->expType = op1->type;
8888 op1->type->refCount++;
8893 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 unsigned short value2 = op2->us;
8898 exp->string = PrintUShort(op1->us < value2);
8901 exp->expType = op1->type;
8903 op1->type->refCount++;
8908 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 char value2 = op2->c;
8913 exp->string = PrintChar(op1->c < value2);
8916 exp->expType = op1->type;
8918 op1->type->refCount++;
8923 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8925 unsigned char value2 = op2->uc;
8928 exp->string = PrintUChar(op1->uc < value2);
8931 exp->expType = op1->type;
8933 op1->type->refCount++;
8938 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8940 float value2 = op2->f;
8943 exp->string = PrintFloat(op1->f < value2);
8946 exp->expType = op1->type;
8948 op1->type->refCount++;
8953 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8955 double value2 = op2->d;
8958 exp->string = PrintDouble(op1->d < value2);
8961 exp->expType = op1->type;
8963 op1->type->refCount++;
8968 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8970 int value2 = op2->i;
8973 exp->string = PrintInt(op1->i >= value2);
8976 exp->expType = op1->type;
8978 op1->type->refCount++;
8983 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8985 unsigned int value2 = op2->ui;
8988 exp->string = PrintUInt(op1->ui >= value2);
8991 exp->expType = op1->type;
8993 op1->type->refCount++;
8998 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9000 short value2 = op2->s;
9003 exp->string = PrintShort(op1->s >= value2);
9006 exp->expType = op1->type;
9008 op1->type->refCount++;
9013 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9015 unsigned short value2 = op2->us;
9018 exp->string = PrintUShort(op1->us >= value2);
9021 exp->expType = op1->type;
9023 op1->type->refCount++;
9028 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9030 char value2 = op2->c;
9033 exp->string = PrintChar(op1->c >= value2);
9036 exp->expType = op1->type;
9038 op1->type->refCount++;
9043 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9045 unsigned char value2 = op2->uc;
9048 exp->string = PrintUChar(op1->uc >= value2);
9051 exp->expType = op1->type;
9053 op1->type->refCount++;
9058 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9060 float value2 = op2->f;
9063 exp->string = PrintFloat(op1->f >= value2);
9066 exp->expType = op1->type;
9068 op1->type->refCount++;
9073 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9075 double value2 = op2->d;
9078 exp->string = PrintDouble(op1->d >= value2);
9081 exp->expType = op1->type;
9083 op1->type->refCount++;
9088 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9090 int value2 = op2->i;
9093 exp->string = PrintInt(op1->i <= value2);
9096 exp->expType = op1->type;
9098 op1->type->refCount++;
9103 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9105 unsigned int value2 = op2->ui;
9108 exp->string = PrintUInt(op1->ui <= value2);
9111 exp->expType = op1->type;
9113 op1->type->refCount++;
9118 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9120 short value2 = op2->s;
9123 exp->string = PrintShort(op1->s <= value2);
9126 exp->expType = op1->type;
9128 op1->type->refCount++;
9133 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9135 unsigned short value2 = op2->us;
9138 exp->string = PrintUShort(op1->us <= value2);
9141 exp->expType = op1->type;
9143 op1->type->refCount++;
9148 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9150 char value2 = op2->c;
9153 exp->string = PrintChar(op1->c <= value2);
9156 exp->expType = op1->type;
9158 op1->type->refCount++;
9163 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9165 unsigned char value2 = op2->uc;
9168 exp->string = PrintUChar(op1->uc <= value2);
9171 exp->expType = op1->type;
9173 op1->type->refCount++;
9178 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9180 float value2 = op2->f;
9183 exp->string = PrintFloat(op1->f <= value2);
9186 exp->expType = op1->type;
9188 op1->type->refCount++;
9193 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9195 double value2 = op2->d;
9198 exp->string = PrintDouble(op1->d <= value2);
9201 exp->expType = op1->type;
9203 op1->type->refCount++;
9208 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9211 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9214 exp->expType = op1->type;
9216 op1->type->refCount++;
9221 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9224 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9227 exp->expType = op1->type;
9229 op1->type->refCount++;
9234 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9237 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9240 exp->expType = op1->type;
9242 op1->type->refCount++;
9247 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9250 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9253 exp->expType = op1->type;
9255 op1->type->refCount++;
9260 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9263 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9266 exp->expType = op1->type;
9268 op1->type->refCount++;
9273 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9276 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9279 exp->expType = op1->type;
9281 op1->type->refCount++;
9286 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9289 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9292 exp->expType = op1->type;
9294 op1->type->refCount++;
9299 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9302 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9305 exp->expType = op1->type;
9307 op1->type->refCount++;
9312 struct OpTable intOps =
9314 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
9317 struct OpTable uintOps =
9319 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
9322 struct OpTable shortOps =
9324 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
9327 struct OpTable ushortOps =
9329 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
9332 struct OpTable floatOps =
9334 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
9337 struct OpTable doubleOps =
9339 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
9342 struct OpTable charOps =
9344 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
9347 struct OpTable ucharOps =
9349 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
9352 void ReadString(char * output, char * string)
9354 int len = strlen(string);
9356 unsigned int quoted = 0x0, escaped = 0x0;
9358 for(c = 0; c < len; c++)
9360 char ch = string[c];
9416 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9418 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9420 extern double strtod(char * , char * * );
9422 struct Operand GetOperand(struct Expression * exp)
9428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9431 struct Type * type = exp->expType;
9435 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9437 if(!type->_class->registered->dataType)
9438 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9439 type = type->_class->registered->dataType;
9441 op.kind = type->kind;
9442 op.type = exp->expType;
9443 if(exp->isConstant && exp->type == 2)
9449 if(exp->constant[0] == '\'')
9450 op.c = exp->constant[1];
9451 else if(type->isSigned)
9453 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9458 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9466 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9471 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9479 op.i = strtol(exp->constant, (((void *)0)), 0);
9484 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9492 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9497 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9505 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9510 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9518 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9523 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9529 op.f = (float)strtod(exp->constant, (((void *)0)));
9533 op.d = (double)strtod(exp->constant, (((void *)0)));
9539 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9549 int __ecereVMethodID_class_OnGetString;
9551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9553 static void UnusedFunction()
9557 ((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);
9560 extern int __ecereVMethodID_class_OnGetString;
9562 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9564 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9566 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9568 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9569 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9572 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9573 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9575 void * ptr = inst->data + dataMember->offset + offset;
9576 char * result = (((void *)0));
9578 exp->loc = member->loc = inst->loc;
9579 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9580 if(!dataMember->dataType)
9581 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9582 type = dataMember->dataType;
9585 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9587 if(_class->type == 4)
9589 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9593 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9594 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9596 for(item = e->values.first; item; item = item->next)
9598 if((int)item->data == *(int *)ptr)
9600 result = item->name;
9606 exp->identifier = MkIdentifier(result);
9608 exp->destType = MkClassType(_class->fullName);
9609 ProcessExpressionType(exp);
9613 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9615 if(!_class->dataType)
9616 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9617 type = _class->dataType;
9626 FreeExpContents(exp);
9627 exp->constant = PrintFloat(*(float *)ptr);
9633 FreeExpContents(exp);
9634 exp->constant = PrintDouble(*(double *)ptr);
9640 FreeExpContents(exp);
9641 exp->constant = PrintInt(*(int *)ptr);
9647 FreeExpContents(exp);
9648 exp->constant = PrintInt64(*(long long *)ptr);
9654 FreeExpContents(exp);
9655 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9661 FreeExpContents(exp);
9662 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9667 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9670 ListAdd(memberList, member);
9672 if(parentDataMember->type == 1)
9677 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9679 void PopulateInstance(struct Instantiation * inst)
9681 struct Symbol * classSym = inst->_class->symbol;
9682 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9683 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9684 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9687 inst->members = MkListOne(MkMembersInitList(memberList));
9689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*inst->members), MkMembersInitList(memberList));
9690 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9692 if(!dataMember->isProperty)
9694 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9695 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9698 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9699 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9701 void * ptr = inst->data + dataMember->offset;
9702 char * result = (((void *)0));
9704 exp->loc = member->loc = inst->loc;
9705 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9706 if(!dataMember->dataType)
9707 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9708 type = dataMember->dataType;
9711 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9713 if(_class->type == 4)
9715 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9719 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9720 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9722 for(item = e->values.first; item; item = item->next)
9724 if((int)item->data == *(int *)ptr)
9726 result = item->name;
9733 exp->identifier = MkIdentifier(result);
9735 exp->destType = MkClassType(_class->fullName);
9736 ProcessExpressionType(exp);
9739 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9741 if(!_class->dataType)
9742 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9743 type = _class->dataType;
9752 exp->constant = PrintFloat(*(float *)ptr);
9758 exp->constant = PrintDouble(*(double *)ptr);
9764 exp->constant = PrintInt(*(int *)ptr);
9770 exp->constant = PrintInt64(*(long long *)ptr);
9776 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9781 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9784 ListAdd(memberList, member);
9790 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);
9792 extern void FreeInstance(struct Instantiation * inst);
9794 void ComputeInstantiation(struct Expression * exp)
9796 struct Instantiation * inst = exp->instance;
9797 struct MembersInit * members;
9798 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9799 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9800 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9801 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9802 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9803 int subMemberStackPos = 0;
9806 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9810 if(_class->type == 0 || _class->type == 5)
9811 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9813 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9817 for(members = (*inst->members).first; members; members = members->next)
9819 switch(members->type)
9823 if(members->dataMembers)
9825 struct MemberInit * member;
9827 for(member = (*members->dataMembers).first; member; member = member->next)
9829 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9830 unsigned int found = 0x0;
9831 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9832 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9833 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9834 unsigned int dataMemberOffset;
9838 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9841 if(curMember->isProperty)
9842 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9845 dataMember = curMember;
9846 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9847 if(_class->type == 0)
9848 dataMemberOffset += _class->base->structSize;
9855 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9859 if(prop->memberAccess == 1)
9861 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9862 curClass = prop->_class;
9867 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9868 int _subMemberStackPos = 0;
9870 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9874 if(dataMember->memberAccess == 1)
9876 curMember = dataMember;
9877 curClass = dataMember->_class;
9878 memcpy(subMemberStack, _subMemberStack, sizeof(struct __ecereNameSpace__ecere__com__DataMember *) * _subMemberStackPos);
9879 subMemberStackPos = _subMemberStackPos;
9884 if(found && member->initializer && member->initializer->type == 0)
9886 struct Expression * value = member->initializer->exp;
9887 struct Type * type = (((void *)0));
9888 unsigned int deepMember = 0x0;
9892 type = prop->dataType;
9896 if(!dataMember->dataType)
9897 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9898 type = dataMember->dataType;
9900 if(ident && ident->next)
9903 for(ident = ident->next; ident && type; ident = ident->next)
9907 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9909 type = prop->dataType;
9912 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9914 type = dataMember->dataType;
9917 else if(type->kind == 9 || type->kind == 10)
9919 struct Type * memberType;
9921 for(memberType = type->members.first; memberType; memberType = memberType->next)
9923 if(!strcmp(memberType->name, ident->string))
9934 FreeType(value->destType);
9935 value->destType = type;
9938 ComputeExpression(value);
9940 if(!deepMember && type && value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9944 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9946 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9948 if(!_class->dataType)
9949 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9950 type = _class->dataType;
9955 void * ptr = inst->data + dataMemberOffset;
9957 if(value->type == 2)
9963 GetInt(value, (int *)ptr);
9968 GetInt64(value, (long long *)ptr);
9973 GetIntPtr(value, (intptr_t *)ptr);
9978 GetIntSize(value, (ssize_t *)ptr);
9983 GetFloat(value, (float *)ptr);
9988 GetDouble(value, (double *)ptr);
9993 else if(value->type == 1)
9997 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9999 if(_class->type == 1)
10001 ComputeTypeSize(type);
10002 if(value->instance->data)
10003 memcpy(ptr, value->instance->data, type->size);
10010 if(value->type == 1 && value->instance->data)
10012 if(type->kind == 8)
10014 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10016 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)))
10018 void (* Set)(void *, void *) = (void *)prop->Set;
10020 Set(inst->data, value->instance->data);
10021 PopulateInstance(inst);
10025 else if(value->type == 2)
10031 void (* Set)(void *, double) = (void *)prop->Set;
10033 Set(inst->data, strtod(value->constant, (((void *)0))));
10038 void (* Set)(void *, float) = (void *)prop->Set;
10040 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
10045 void (* Set)(void *, int) = (void *)prop->Set;
10047 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
10052 void (* Set)(void *, long long) = (void *)prop->Set;
10054 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10059 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10061 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10066 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10068 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10073 else if(value->type == 3)
10077 ReadString(temp, value->string);
10078 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10082 else if(!deepMember && type && _class->type == 3)
10086 if(value->type == 2)
10088 if(type->kind == 8)
10090 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10092 if(_class->type == 3)
10094 if(!_class->dataType)
10095 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10096 type = _class->dataType;
10104 float (* Set)(float) = (void *)prop->Set;
10106 GetFloat(member->initializer->exp, &fValue);
10107 exp->constant = PrintFloat(Set(fValue));
10114 double (* Set)(double) = (void *)prop->Set;
10116 GetDouble(member->initializer->exp, &dValue);
10117 exp->constant = PrintDouble(Set(dValue));
10125 else if(!deepMember && type && _class->type == 2)
10129 if(value->type == 1 && value->instance->data)
10131 unsigned int (* Set)(void *) = (void *)prop->Set;
10133 bits = Set(value->instance->data);
10135 else if(value->type == 2)
10139 else if(dataMember)
10141 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10142 struct Type * type;
10145 GetInt(value, &part);
10146 bits = (bits & ~bitMember->mask);
10147 if(!bitMember->dataType)
10148 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10149 type = bitMember->dataType;
10150 if(type->kind == 8 && type->_class && type->_class->registered)
10152 if(!type->_class->registered->dataType)
10153 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10154 type = type->_class->registered->dataType;
10160 bits |= ((char)part << bitMember->pos);
10162 bits |= ((unsigned char)part << bitMember->pos);
10166 bits |= ((short)part << bitMember->pos);
10168 bits |= ((unsigned short)part << bitMember->pos);
10173 bits |= (part << bitMember->pos);
10175 bits |= ((unsigned int)part << bitMember->pos);
10179 bits |= ((long long)part << bitMember->pos);
10181 bits |= ((uint64)part << bitMember->pos);
10186 bits |= ((intptr_t)part << bitMember->pos);
10190 bits |= ((uintptr_t)part << bitMember->pos);
10196 bits |= ((ssize_t)part << bitMember->pos);
10200 bits |= ((size_t)part << bitMember->pos);
10209 if(_class && _class->type == 3)
10211 ComputeExpression(member->initializer->exp);
10212 exp->constant = member->initializer->exp->constant;
10214 member->initializer->exp->constant = (((void *)0));
10224 if(_class && _class->type == 2)
10226 exp->constant = PrintHexUInt(bits);
10231 FreeInstance(inst);
10235 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10237 if(exp->op.op == SIZEOF)
10239 FreeExpContents(exp);
10241 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10251 struct Expression * exp2 = exp->op.exp2;
10253 exp->op.exp2 = (((void *)0));
10254 FreeExpContents(exp);
10255 FreeType(exp->expType);
10256 FreeType(exp->destType);
10258 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10264 FreeExpContents(exp);
10265 op1->ops.Neg(exp, op1);
10269 if(op1->ops.BitNot)
10271 FreeExpContents(exp);
10272 op1->ops.BitNot(exp, op1);
10278 FreeExpContents(exp);
10279 op1->ops.Not(exp, op1);
10291 FreeExpContents(exp);
10292 op1->ops.Add(exp, op1, op2);
10298 FreeExpContents(exp);
10299 op1->ops.Sub(exp, op1, op2);
10305 FreeExpContents(exp);
10306 op1->ops.Mul(exp, op1, op2);
10312 FreeExpContents(exp);
10313 op1->ops.Div(exp, op1, op2);
10319 FreeExpContents(exp);
10320 op1->ops.Mod(exp, op1, op2);
10326 if(op1->ops.BitAnd)
10328 FreeExpContents(exp);
10329 op1->ops.BitAnd(exp, op1, op2);
10336 FreeExpContents(exp);
10337 op1->ops.BitOr(exp, op1, op2);
10341 if(op1->ops.BitXor)
10343 FreeExpContents(exp);
10344 op1->ops.BitXor(exp, op1, op2);
10348 if(op1->ops.LShift)
10350 FreeExpContents(exp);
10351 op1->ops.LShift(exp, op1, op2);
10355 if(op1->ops.RShift)
10357 FreeExpContents(exp);
10358 op1->ops.RShift(exp, op1, op2);
10364 FreeExpContents(exp);
10365 op1->ops.Equ(exp, op1, op2);
10371 FreeExpContents(exp);
10372 op1->ops.Nqu(exp, op1, op2);
10378 FreeExpContents(exp);
10379 op1->ops.And(exp, op1, op2);
10385 FreeExpContents(exp);
10386 op1->ops.Or(exp, op1, op2);
10392 FreeExpContents(exp);
10393 op1->ops.Grt(exp, op1, op2);
10399 FreeExpContents(exp);
10400 op1->ops.Sma(exp, op1, op2);
10404 if(op1->ops.GrtEqu)
10406 FreeExpContents(exp);
10407 op1->ops.GrtEqu(exp, op1, op2);
10411 if(op1->ops.SmaEqu)
10413 FreeExpContents(exp);
10414 op1->ops.SmaEqu(exp, op1, op2);
10422 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
10424 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10426 void ComputeExpression(struct Expression * exp)
10428 char expString[10240];
10430 expString[0] = '\0';
10435 ComputeInstantiation(exp);
10440 struct Expression * exp1, * exp2 = (((void *)0));
10441 struct Operand op1 =
10445 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10448 struct Operand op2 =
10452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10457 ComputeExpression(exp->op.exp2);
10460 ComputeExpression(exp->op.exp1);
10461 exp1 = exp->op.exp1;
10462 exp2 = exp->op.exp2;
10463 op1 = GetOperand(exp1);
10465 op1.type->refCount++;
10468 op2 = GetOperand(exp2);
10470 op2.type->refCount++;
10475 exp1 = exp->op.exp2;
10476 op1 = GetOperand(exp1);
10478 op1.type->refCount++;
10480 CallOperator(exp, exp1, exp2, &op1, &op2);
10482 FreeType(op1.type);
10484 FreeType(op2.type);
10490 struct Expression * e, * n;
10492 for(e = (*exp->list).first; e; e = n)
10497 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10499 ComputeExpression(e);
10500 FreeType(exp->expType);
10501 FreeType(exp->destType);
10503 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10504 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10515 struct Expression * memberExp = exp->member.exp;
10516 struct Identifier * memberID = exp->member.member;
10517 struct Type * type;
10519 ComputeExpression(exp->member.exp);
10520 type = exp->member.exp->expType;
10523 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)));
10524 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10525 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10526 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10528 if(type->kind == 19 && exp->member.exp->type == 26)
10529 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10533 struct Symbol * classSym;
10536 PrintTypeNoConst(type, string, 0x0, 0x1);
10537 classSym = FindClass(string);
10538 _class = classSym ? classSym->registered : (((void *)0));
10540 if(exp->member.member)
10542 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10544 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10546 if(!prop && !member && _class && exp->member.member)
10548 struct Symbol * classSym = FindClass(exp->member.member->string);
10550 convertTo = _class;
10551 _class = classSym ? classSym->registered : (((void *)0));
10552 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10558 struct Type * type = prop->dataType;
10560 if(_class->type == 3)
10562 if(type->kind == 8)
10564 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10566 if(_class->type == 3)
10568 if(!_class->dataType)
10569 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10570 type = _class->dataType;
10578 float (* Get)(float) = (void *)prop->Get;
10580 GetFloat(exp->member.exp, &value);
10581 exp->constant = PrintFloat(Get ? Get(value) : value);
10588 double (* Get)(double);
10590 GetDouble(exp->member.exp, &value);
10592 Get = (void *)prop->Set;
10594 Get = (void *)prop->Get;
10595 exp->constant = PrintDouble(Get ? Get(value) : value);
10605 struct Expression * value = exp->member.exp;
10606 struct Type * type;
10608 if(!prop->dataType)
10609 ProcessPropertyType(prop);
10610 type = prop->dataType;
10614 else if(_class->type == 1)
10620 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10622 if(propertyClass->type == 1 && value->type == 1)
10624 void (* Set)(void *, void *) = (void *)prop->Set;
10626 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10627 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10628 exp->instance->_class = MkSpecifierName(_class->fullName);
10629 exp->instance->loc = exp->loc;
10631 Set(exp->instance->data, value->instance->data);
10632 PopulateInstance(exp->instance);
10639 void (* Set)(void *, int) = (void *)prop->Set;
10641 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10642 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10643 exp->instance->_class = MkSpecifierName(_class->fullName);
10644 exp->instance->loc = exp->loc;
10646 GetInt(value, &intValue);
10647 Set(exp->instance->data, intValue);
10648 PopulateInstance(exp->instance);
10653 long long intValue;
10654 void (* Set)(void *, long long) = (void *)prop->Set;
10656 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10657 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10658 exp->instance->_class = MkSpecifierName(_class->fullName);
10659 exp->instance->loc = exp->loc;
10661 GetInt64(value, &intValue);
10662 Set(exp->instance->data, intValue);
10663 PopulateInstance(exp->instance);
10669 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10671 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10672 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10673 exp->instance->_class = MkSpecifierName(_class->fullName);
10674 exp->instance->loc = exp->loc;
10676 GetIntPtr(value, &intValue);
10677 Set(exp->instance->data, intValue);
10678 PopulateInstance(exp->instance);
10684 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10686 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10687 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10688 exp->instance->_class = MkSpecifierName(_class->fullName);
10689 exp->instance->loc = exp->loc;
10691 GetIntSize(value, &intValue);
10692 Set(exp->instance->data, intValue);
10693 PopulateInstance(exp->instance);
10698 double doubleValue;
10699 void (* Set)(void *, double) = (void *)prop->Set;
10701 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10702 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10703 exp->instance->_class = MkSpecifierName(_class->fullName);
10704 exp->instance->loc = exp->loc;
10706 GetDouble(value, &doubleValue);
10707 Set(exp->instance->data, doubleValue);
10708 PopulateInstance(exp->instance);
10713 else if(_class->type == 2)
10719 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10721 if(propertyClass->type == 1 && value->instance->data)
10723 unsigned int (* Set)(void *) = (void *)prop->Set;
10724 unsigned int bits = Set(value->instance->data);
10726 exp->constant = PrintHexUInt(bits);
10730 else if(_class->type == 2)
10732 unsigned int value;
10733 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10736 GetUInt(exp->member.exp, &value);
10738 exp->constant = PrintHexUInt(bits);
10747 if(_class->type == 2)
10749 unsigned int value;
10751 GetUInt(exp->member.exp, &value);
10756 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10758 if(_class->type == 1)
10760 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10762 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10763 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10764 exp->instance->_class = MkSpecifierName(_class->fullName);
10765 exp->instance->loc = exp->loc;
10767 Get(value, exp->instance->data);
10768 PopulateInstance(exp->instance);
10770 else if(_class->type == 2)
10772 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10773 uint64 bits = Get(value);
10775 exp->constant = PrintHexUInt64(bits);
10782 else if(_class->type == 1)
10784 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10790 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10792 if(_class->type == 1 && value)
10794 void (* Get)(void *, void *) = (void *)prop->Get;
10796 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10797 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10798 exp->instance->_class = MkSpecifierName(_class->fullName);
10799 exp->instance->loc = exp->loc;
10801 Get(value, exp->instance->data);
10802 PopulateInstance(exp->instance);
10813 exp->isConstant = 0x0;
10822 FreeExpression(memberExp);
10823 FreeIdentifier(memberID);
10829 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10831 FreeExpContents(exp);
10832 exp->constant = PrintUInt(ComputeTypeSize(type));
10839 struct Symbol * classSym = exp->_class->symbol;
10841 if(classSym && classSym->registered)
10843 if(classSym->registered->fixed)
10845 FreeSpecifier(exp->_class);
10846 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10851 char className[1024];
10853 strcpy(className, "__ecereClass_");
10854 FullClassNameCat(className, classSym->string, 0x1);
10855 MangleClassName(className);
10856 FreeExpContents(exp);
10858 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10859 exp->member.member = MkIdentifier("structSize");
10866 struct Type * type;
10867 struct Expression * e = exp;
10869 if(exp->type == 11)
10872 ComputeExpression(exp->cast.exp);
10875 if(e && exp->expType)
10877 type = exp->expType;
10878 if(type->kind == 8)
10880 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10882 if(_class && (_class->type == 3 || _class->type == 2))
10884 if(!_class->dataType)
10885 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10886 type = _class->dataType;
10896 GetChar(e, &value);
10897 FreeExpContents(exp);
10898 exp->constant = PrintChar(value);
10903 unsigned char value;
10905 GetUChar(e, &value);
10906 FreeExpContents(exp);
10907 exp->constant = PrintUChar(value);
10916 GetShort(e, &value);
10917 FreeExpContents(exp);
10918 exp->constant = PrintShort(value);
10923 unsigned short value;
10925 GetUShort(e, &value);
10926 FreeExpContents(exp);
10927 exp->constant = PrintUShort(value);
10937 FreeExpContents(exp);
10938 exp->constant = PrintInt(value);
10943 unsigned int value;
10945 GetUInt(e, &value);
10946 FreeExpContents(exp);
10947 exp->constant = PrintUInt(value);
10956 GetInt64(e, &value);
10957 FreeExpContents(exp);
10958 exp->constant = PrintInt64(value);
10965 GetUInt64(e, &value);
10966 FreeExpContents(exp);
10967 exp->constant = PrintUInt64(value);
10976 GetIntPtr(e, &value);
10977 FreeExpContents(exp);
10978 exp->constant = PrintInt64((long long)value);
10985 GetUIntPtr(e, &value);
10986 FreeExpContents(exp);
10987 exp->constant = PrintUInt64((uint64)value);
10996 GetIntSize(e, &value);
10997 FreeExpContents(exp);
10998 exp->constant = PrintInt64((long long)value);
11005 GetUIntSize(e, &value);
11006 FreeExpContents(exp);
11007 exp->constant = PrintUInt64((uint64)value);
11015 GetFloat(e, &value);
11016 FreeExpContents(exp);
11017 exp->constant = PrintFloat(value);
11025 GetDouble(e, &value);
11026 FreeExpContents(exp);
11027 exp->constant = PrintDouble(value);
11037 struct Operand op1 =
11041 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11044 struct Operand op2 =
11048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11051 struct Operand op3 =
11055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11060 ComputeExpression((*exp->cond.exp).last);
11061 if(exp->cond.elseExp)
11062 ComputeExpression(exp->cond.elseExp);
11064 ComputeExpression(exp->cond.cond);
11065 op1 = GetOperand(exp->cond.cond);
11067 op1.type->refCount++;
11068 op2 = GetOperand((*exp->cond.exp).last);
11070 op2.type->refCount++;
11071 op3 = GetOperand(exp->cond.elseExp);
11073 op3.type->refCount++;
11076 FreeExpContents(exp);
11077 op1.ops.Cond(exp, &op1, &op2, &op3);
11080 FreeType(op1.type);
11082 FreeType(op2.type);
11084 FreeType(op3.type);
11090 void ApplyAnyObjectLogic(struct Expression * e);
11092 extern void CopyTypeInto(struct Type * type, struct Type * src);
11094 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11096 unsigned int result = 0x1;
11100 struct __ecereNameSpace__ecere__sys__OldList converts =
11104 struct Conversion * convert;
11106 if(destType->kind == 0)
11108 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11112 for(convert = converts.first; convert; convert = convert->next)
11114 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11118 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11119 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11122 newExp->destType = (((void *)0));
11126 exp->addedThis = 0x1;
11127 exp->member.exp = newExp;
11128 FreeType(exp->member.exp->expType);
11129 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11130 exp->member.exp->expType->classObjectType = objectType;
11131 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11132 exp->member.memberType = 1;
11133 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11134 exp->needCast = 0x1;
11136 exp->expType->refCount++;
11137 ApplyAnyObjectLogic(exp->member.exp);
11143 exp->addedThis = 0x1;
11144 exp->member.exp = newExp;
11145 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11147 newExp->byReference = 0x1;
11149 FreeType(exp->member.exp->expType);
11150 exp->member.exp->expType = (((void *)0));
11151 if(convert->convert->dataType)
11153 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11154 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11155 exp->member.exp->expType->refCount = 1;
11156 exp->member.exp->expType->classObjectType = objectType;
11157 ApplyAnyObjectLogic(exp->member.exp);
11159 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11160 exp->member.memberType = 4;
11161 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11162 exp->needCast = 0x1;
11163 if(convert->resultType)
11164 convert->resultType->refCount++;
11170 FreeType(exp->expType);
11173 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11174 exp->needCast = 0x1;
11176 exp->expType->refCount++;
11180 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11181 exp->needCast = 0x1;
11182 if(convert->resultType)
11183 convert->resultType->refCount++;
11187 if(exp->isConstant && inCompiler)
11188 ComputeExpression(exp);
11189 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11191 if(!result && exp->expType && converts.count)
11193 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11195 if(!result && exp->expType && exp->destType)
11197 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))
11204 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11206 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11208 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11210 void CheckTemplateTypes(struct Expression * exp)
11212 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11214 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11215 struct Statement * compound;
11216 struct Context * context;
11220 exp->destType->refCount++;
11222 exp->expType->refCount++;
11223 newExp->prev = (((void *)0));
11224 newExp->next = (((void *)0));
11225 switch(exp->expType->kind)
11228 if(exp->destType->classObjectType)
11231 exp->destType->refCount--;
11233 exp->expType->refCount--;
11234 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11238 struct __ecereNameSpace__ecere__sys__OldList * specs;
11239 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11240 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11242 context = PushContext();
11243 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11244 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11245 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11247 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11248 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11249 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11250 exp->compound->compound.context = context;
11251 PopContext(context);
11256 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11257 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11261 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11263 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11264 struct Statement * compound;
11265 struct Context * context;
11269 exp->destType->refCount++;
11271 exp->expType->refCount++;
11272 newExp->prev = (((void *)0));
11273 newExp->next = (((void *)0));
11274 switch(exp->expType->kind)
11277 if(exp->destType->classObjectType)
11280 exp->destType->refCount--;
11282 exp->expType->refCount--;
11283 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11287 struct __ecereNameSpace__ecere__sys__OldList * specs;
11288 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11289 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11291 context = PushContext();
11292 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11293 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11294 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11296 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11297 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11298 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11299 exp->compound->compound.context = context;
11300 PopContext(context);
11305 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11308 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11309 ProcessExpressionType((*exp->list).first);
11315 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11316 newExp->needCast = 0x1;
11317 ProcessExpressionType((*exp->list).first);
11323 if(exp->expType->kind == 20)
11325 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11329 FreeType(exp->destType);
11330 FreeType(exp->expType);
11331 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11335 if(newExp->type == 8 && newExp->member.memberType == 3)
11339 exp->op.exp1 = (((void *)0));
11340 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11344 char typeString[1024];
11345 struct Declarator * decl;
11346 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11348 typeString[0] = '\0';
11349 PrintType(exp->expType, typeString, 0x0, 0x0);
11350 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11352 exp->cast.typeName = MkTypeName(specs, decl);
11353 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11354 exp->cast.exp->needCast = 0x1;
11362 extern int strncmp(const char * , const char * , size_t n);
11364 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11366 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11368 int nsLen = strlen(nameSpace);
11369 struct Symbol * symbol;
11371 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)))
11373 char * s = symbol->string;
11375 if(!strncmp(s, nameSpace, nsLen))
11380 for(c = strlen(s) - 1; c >= 0; c--)
11383 namePart = s + c + 1;
11384 if(!strcmp(namePart, name))
11392 return (((void *)0));
11395 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11398 char nameSpace[1024];
11400 unsigned int gotColon = 0x0;
11402 nameSpace[0] = '\0';
11403 for(c = strlen(name) - 1; c >= 0; c--)
11409 namePart = name + c + 1;
11410 while(c >= 0 && name[c] == ':')
11414 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11418 memcpy(nameSpace, name, c + 1);
11419 nameSpace[c + 1] = (char)0;
11420 return ScanWithNameSpace(tree, nameSpace, namePart);
11424 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11430 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11434 return ScanWithNameSpace(tree, "", namePart);
11436 return (((void *)0));
11439 static void ProcessDeclaration(struct Declaration * decl);
11441 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11443 struct Context * ctx;
11444 struct Symbol * symbol = (((void *)0));
11446 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11448 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11450 symbol = (((void *)0));
11453 char curName[1024];
11455 strcpy(curName, thisNameSpace);
11456 strcat(curName, "::");
11457 strcat(curName, name);
11458 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11461 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11464 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11465 if(symbol || ctx == endContext)
11468 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11470 if(symbol->pointerExternal->type == 0)
11472 struct FunctionDefinition * function = symbol->pointerExternal->function;
11473 struct Context * tmpContext = curContext;
11475 curContext = (((void *)0));
11476 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11477 curContext = tmpContext;
11478 symbol->pointerExternal->symbol = symbol;
11479 DeclareType(symbol->type, 0x1, 0x1);
11480 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11481 symbol->id = curExternal->symbol->idCode;
11483 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11486 symbol->id = curExternal->symbol->idCode;
11492 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11494 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11495 ListAdd(specs, MkSpecifier(UNSIGNED));
11500 if(type->_class->registered)
11502 if(!type->_class->registered->dataType)
11503 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11504 GetTypeSpecs(type->_class->registered->dataType, specs);
11509 ListAdd(specs, MkSpecifier(DOUBLE));
11512 ListAdd(specs, MkSpecifier(FLOAT));
11515 ListAdd(specs, MkSpecifier(CHAR));
11518 ListAdd(specs, MkSpecifier(SHORT));
11521 ListAdd(specs, MkSpecifier(INT64));
11524 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11527 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11531 ListAdd(specs, MkSpecifier(INT));
11536 static void PrintArraySize(struct Type * arrayType, char * string)
11542 if(arrayType->enumClass)
11543 strcat(size, arrayType->enumClass->string);
11544 else if(arrayType->arraySizeExp)
11545 PrintExpression(arrayType->arraySizeExp, size);
11547 strcat(string, size);
11550 static void PrintTypeSpecs(struct Type * type, char * string, unsigned int fullName, unsigned int printConst)
11554 if(printConst && type->constant)
11555 strcat(string, "const ");
11560 struct Symbol * c = type->_class;
11562 if(type->classObjectType == 2)
11563 strcat(string, "typed_object");
11564 else if(type->classObjectType == 3)
11565 strcat(string, "any_object");
11569 strcat(string, (fullName || !c->registered) ? c->string : c->registered->name);
11571 if(type->byReference)
11572 strcat(string, " &");
11576 strcat(string, "void");
11579 strcat(string, type->isSigned ? "int" : "uint");
11582 strcat(string, type->isSigned ? "int64" : "uint64");
11585 strcat(string, type->isSigned ? "intptr" : "uintptr");
11588 strcat(string, type->isSigned ? "intsize" : "uintsize");
11591 strcat(string, type->isSigned ? "char" : "byte");
11594 strcat(string, type->isSigned ? "short" : "uint16");
11597 strcat(string, "float");
11600 strcat(string, "double");
11605 strcat(string, "struct ");
11606 strcat(string, type->enumName);
11608 else if(type->typeName)
11609 strcat(string, type->typeName);
11612 struct Type * member;
11614 strcat(string, "struct { ");
11615 for(member = type->members.first; member; member = member->next)
11617 PrintType(member, string, 0x1, fullName);
11618 strcat(string, "; ");
11620 strcat(string, "}");
11626 strcat(string, "union ");
11627 strcat(string, type->enumName);
11629 else if(type->typeName)
11630 strcat(string, type->typeName);
11633 strcat(string, "union ");
11634 strcat(string, "(unnamed)");
11640 strcat(string, "enum ");
11641 strcat(string, type->enumName);
11643 else if(type->typeName)
11644 strcat(string, type->typeName);
11646 strcat(string, "int");
11649 strcat(string, "...");
11652 strcat(string, "subclass(");
11653 strcat(string, type->_class ? type->_class->string : "int");
11654 strcat(string, ")");
11657 strcat(string, type->templateParameter->identifier->string);
11660 strcat(string, "thisclass");
11663 strcat(string, "__builtin_va_list");
11669 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11671 static void PrintName(struct Type * type, char * string, unsigned int fullName)
11673 if(type->name && type->name[0])
11676 strcat(string, type->name);
11679 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11685 strcat(string, name);
11690 static void PrintAttribs(struct Type * type, char * string)
11694 if(type->dllExport)
11695 strcat(string, "dllexport ");
11696 if(type->attrStdcall)
11697 strcat(string, "stdcall ");
11701 static void PrePrintType(struct Type * type, char * string, unsigned int fullName, struct Type * parentType, unsigned int printConst)
11703 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11705 struct Type * attrType = (((void *)0));
11707 if((type->kind == 11 || type->kind == 16) && (!parentType || parentType->kind != 13))
11708 PrintAttribs(type, string);
11709 if(printConst && type->constant && (type->kind == 11 || type->kind == 16))
11710 strcat(string, " const");
11711 PrePrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName, type, printConst);
11712 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11713 strcat(string, " (");
11714 if(type->kind == 13)
11716 if(type->type->kind == 11 || type->type->kind == 16)
11717 PrintAttribs(type->type, string);
11719 if(type->kind == 13)
11721 if(type->type->kind == 11 || type->type->kind == 16 || type->type->kind == 12)
11722 strcat(string, "*");
11724 strcat(string, " *");
11726 if(printConst && type->constant && type->kind == 13)
11727 strcat(string, " const");
11730 PrintTypeSpecs(type, string, fullName, printConst);
11733 static void PostPrintType(struct Type * type, char * string, unsigned int fullName)
11735 if(type->kind == 13 && (type->type->kind == 12 || type->type->kind == 11 || type->type->kind == 16))
11736 strcat(string, ")");
11737 if(type->kind == 12)
11738 PrintArraySize(type, string);
11739 else if(type->kind == 11)
11741 struct Type * param;
11743 strcat(string, "(");
11744 for(param = type->params.first; param; param = param->next)
11746 PrintType(param, string, 0x1, fullName);
11748 strcat(string, ", ");
11750 strcat(string, ")");
11752 if(type->kind == 12 || type->kind == 13 || type->kind == 11 || type->kind == 16)
11753 PostPrintType(type->kind == 16 ? type->method->dataType : type->type, string, fullName);
11756 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName, unsigned int printConst)
11758 PrePrintType(type, string, fullName, (((void *)0)), printConst);
11759 if(type->thisClass || (printName && type->name && type->name[0]))
11760 strcat(string, " ");
11761 if((type->thisClass || type->staticMethod))
11763 struct Symbol * _class = type->thisClass;
11765 if((type->classObjectType == 2 || type->classObjectType == 1) || (_class && !strcmp(_class->string, "class")))
11767 if(type->classObjectType == 1)
11768 strcat(string, "class");
11770 strcat(string, type->byReference ? "typed_object&" : "typed_object");
11772 else if(_class && _class->string)
11774 char * s = _class->string;
11780 char * name = __ecereNameSpace__ecere__sys__RSearchString(s, "::", strlen(s), 0x1, 0x0);
11786 strcat(string, name);
11789 strcat(string, "::");
11791 if(printName && type->name)
11792 PrintName(type, string, fullName);
11793 PostPrintType(type, string, fullName);
11794 if(type->bitFieldCount)
11798 sprintf(count, ":%d", type->bitFieldCount);
11799 strcat(string, count);
11803 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11805 _PrintType(type, string, printName, fullName, 0x1);
11808 void PrintTypeNoConst(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11810 _PrintType(type, string, printName, fullName, 0x0);
11813 static struct Type * FindMember(struct Type * type, char * string)
11815 struct Type * memberType;
11817 for(memberType = type->members.first; memberType; memberType = memberType->next)
11819 if(!memberType->name)
11821 struct Type * subType = FindMember(memberType, string);
11826 else if(!strcmp(memberType->name, string))
11829 return (((void *)0));
11832 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11834 struct Type * memberType;
11836 for(memberType = type->members.first; memberType; memberType = memberType->next)
11838 if(!memberType->name)
11840 struct Type * subType = FindMember(memberType, string);
11844 *offset += memberType->offset;
11848 else if(!strcmp(memberType->name, string))
11850 *offset += memberType->offset;
11854 return (((void *)0));
11857 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11859 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11861 struct Expression * ParseExpressionString(char * expression)
11863 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11864 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, expression, 1, strlen(expression));
11865 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11867 parsedExpression = (((void *)0));
11869 expression_yyparse();
11870 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11871 return parsedExpression;
11874 extern char * QMkString(char * source);
11876 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11878 struct Identifier * id = exp->identifier;
11879 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11880 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11881 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11882 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11884 if(_class && _class->type == 4)
11886 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11887 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11891 struct __ecereNameSpace__ecere__com__Class * baseClass;
11893 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11895 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11897 for(value = e->values.first; value; value = value->next)
11899 if(!strcmp(value->name, id->string))
11904 char constant[256];
11906 FreeExpContents(exp);
11908 exp->isConstant = 0x1;
11909 if(!strcmp(baseClass->dataTypeString, "int"))
11910 sprintf(constant, "%d", (int)value->data);
11912 sprintf(constant, "0x%X", (int)value->data);
11913 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11914 exp->expType = MkClassType(baseClass->fullName);
11922 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11924 ProcessMethodType(method);
11925 exp->expType = __extension__ ({
11926 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11928 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
11932 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11934 if(!prop->dataType)
11935 ProcessPropertyType(prop);
11936 exp->expType = prop->dataType;
11938 prop->dataType->refCount++;
11941 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11943 if(!member->dataType)
11944 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11945 exp->expType = member->dataType;
11946 if(member->dataType)
11947 member->dataType->refCount++;
11950 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11952 if(!classProp->dataType)
11953 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11954 if(classProp->constant)
11956 FreeExpContents(exp);
11957 exp->isConstant = 0x1;
11958 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11961 exp->constant = QMkString((char *)classProp->Get(_class));
11965 char constant[256];
11968 sprintf(constant, "%d", (int)classProp->Get(_class));
11969 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11975 exp->expType = classProp->dataType;
11976 if(classProp->dataType)
11977 classProp->dataType->refCount++;
11983 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11985 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11986 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11987 struct __ecereNameSpace__ecere__com__NameSpace * child;
11991 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)))
11993 data = ScanGlobalData(child, name);
12001 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
12003 extern char * strncpy(char * , const char * , size_t n);
12005 static struct GlobalData * FindGlobalData(char * name)
12008 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12010 nameSpace = globalData;
12011 for(c = 0; name[c]; c++)
12013 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
12015 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
12016 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
12018 strncpy(spaceName, name + start, c - start);
12019 spaceName[c - start] = '\0';
12020 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
12021 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
12023 return (((void *)0));
12024 nameSpace = newSpace;
12032 return ScanGlobalData(nameSpace, name + start);
12034 return (((void *)0));
12037 static int definedExpStackPos;
12039 static void * definedExpStack[512];
12041 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
12043 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
12045 FreeExpContents(checkedExp);
12046 FreeType(checkedExp->expType);
12047 FreeType(checkedExp->destType);
12048 *checkedExp = *newExp;
12049 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
12050 checkedExp->prev = prev;
12051 checkedExp->next = next;
12054 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
12056 extern int printf(char * , ...);
12058 void __ecereMethod_Expression_Clear();
12060 void ApplyAnyObjectLogic(struct Expression * e)
12062 struct Type * destType = e->destType;
12064 if(destType && (destType->classObjectType == 3))
12066 if(e && e->expType)
12068 struct Type * type = e->expType;
12069 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
12071 if(type->kind == 8 && type->_class && type->_class->registered)
12073 _class = type->_class->registered;
12075 else if(type->kind == 19)
12077 _class = FindClass("ecere::com::Class")->registered;
12081 char string[1024] = "";
12082 struct Symbol * classSym;
12084 PrintTypeNoConst(type, string, 0x0, 0x1);
12085 classSym = FindClass(string);
12087 _class = classSym->registered;
12089 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)))
12091 if(!_class || strcmp(_class->fullName, "char *"))
12093 struct Expression * checkedExp = e, * newExp;
12095 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12097 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12099 if(checkedExp->type == 25)
12101 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12104 checkedExp = (*checkedExp->list).last;
12106 else if(checkedExp->type == 11)
12107 checkedExp = checkedExp->cast.exp;
12109 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12111 newExp = checkedExp->op.exp2;
12112 checkedExp->op.exp2 = (((void *)0));
12113 FreeExpContents(checkedExp);
12114 if(e->expType && e->expType->passAsTemplate)
12118 ComputeTypeSize(e->expType);
12119 sprintf(size, "%d", e->expType->size);
12120 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))))));
12122 ReplaceExpContents(checkedExp, newExp);
12123 e->byReference = 0x1;
12125 else if(!e->byReference || (_class && _class->type == 5))
12127 struct Expression * checkedExp, * newExp;
12130 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;
12132 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12134 struct Context * context = PushContext();
12135 struct Declarator * decl;
12136 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12137 char typeString[1024];
12138 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12140 typeString[0] = '\0';
12142 newExp->prev = (((void *)0));
12143 newExp->next = (((void *)0));
12144 newExp->expType = (((void *)0));
12145 PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
12146 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12147 newExp->destType = ProcessType(specs, decl);
12148 curContext = context;
12152 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12155 sprintf(name, "__internalValue%03X", internalValueCounter++);
12156 if(!curCompound->compound.declarations)
12157 curCompound->compound.declarations = MkList();
12158 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12159 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12160 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12161 e->compound = MkCompoundStmt((((void *)0)), stmts);
12164 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12166 struct Type * type = e->destType;
12168 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12169 CopyTypeInto(e->destType, type);
12170 e->destType->refCount = 1;
12171 e->destType->classObjectType = 0;
12174 e->compound->compound.context = context;
12175 PopContext(context);
12176 curContext = context->parent;
12180 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12182 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12184 if(checkedExp->type == 25)
12186 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12189 checkedExp = (*checkedExp->list).last;
12191 else if(checkedExp->type == 11)
12192 checkedExp = checkedExp->cast.exp;
12195 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12197 *operand = *checkedExp;
12198 checkedExp->destType = (((void *)0));
12199 checkedExp->expType = (((void *)0));
12200 __ecereMethod_Expression_Clear(checkedExp);
12201 checkedExp->type = 4;
12202 checkedExp->op.op = '&';
12203 checkedExp->op.exp1 = (((void *)0));
12204 checkedExp->op.exp2 = operand;
12213 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))))
12215 if(e->expType->classObjectType && destType && destType->classObjectType)
12221 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12224 thisExp->prev = (((void *)0));
12225 thisExp->next = (((void *)0));
12226 __ecereMethod_Expression_Clear(e);
12228 e->list = MkListOne(MkExpOp((((void *)0)), '*', thisExp->type == 0 ? thisExp : MkExpBrackets(MkListOne(thisExp))));
12229 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12230 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12232 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12233 CopyTypeInto(e->expType, thisExp->expType);
12234 e->expType->byReference = 0x0;
12235 e->expType->refCount = 1;
12236 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))
12238 e->expType->classObjectType = 0;
12243 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12245 if(destType->kind == 14)
12247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12249 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12251 unsigned int byReference = e->expType->byReference;
12252 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12253 struct Declarator * decl;
12254 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12255 char typeString[1024];
12256 struct Type * type;
12257 int backupClassObjectType;
12258 unsigned int backupByReference;
12260 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12264 backupClassObjectType = type->classObjectType;
12265 backupByReference = type->byReference;
12266 type->classObjectType = 0;
12267 type->byReference = 0x0;
12268 typeString[0] = '\0';
12269 PrintType(type, typeString, 0x0, 0x1);
12270 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12271 type->classObjectType = backupClassObjectType;
12272 type->byReference = backupByReference;
12274 thisExp->prev = (((void *)0));
12275 thisExp->next = (((void *)0));
12276 __ecereMethod_Expression_Clear(e);
12277 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)))
12281 e->op.exp1 = (((void *)0));
12282 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12287 e->cast.typeName = MkTypeName(specs, decl);
12288 e->cast.exp = thisExp;
12289 e->byReference = 0x1;
12292 e->destType = destType;
12294 destType->refCount++;
12299 extern char * strstr(const char * , const char * );
12301 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12303 struct __ecereNameSpace__ecere__com__DefinedExpression
12305 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12306 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12309 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12310 } __attribute__ ((gcc_struct));
12312 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12314 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12316 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12318 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12320 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12322 extern struct Expression * CopyExpression(struct Expression * exp);
12324 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12326 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12328 static void ProcessStatement(struct Statement * stmt);
12330 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12332 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12334 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12336 extern char * sourceFile;
12338 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12340 void ProcessExpressionType(struct Expression * exp)
12342 unsigned int unresolved = 0x0;
12343 struct Location oldyylloc = yylloc;
12344 unsigned int notByReference = 0x0;
12346 if(!exp || exp->expType)
12353 struct Identifier * id = exp->identifier;
12357 if(id->_class && id->_class->name)
12359 id->classSym = id->_class->symbol;
12361 if(strstr(id->string, "__ecereClass") == id->string)
12363 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12366 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12368 ReplaceClassMembers(exp, thisClass);
12371 ProcessExpressionType(exp);
12374 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12379 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12383 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12389 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12392 ProcessExpressionType(exp);
12396 else if(currentClass && !id->_class)
12398 if(ResolveIdWithClass(exp, currentClass, 0x1))
12401 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12406 struct Type * type = symbol->type;
12407 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12409 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12411 struct Context * context = SetupTemplatesContext(_class);
12413 type = ReplaceThisClassType(_class);
12414 FinishTemplatesContext(context);
12416 type->refCount = 0;
12418 FreeSpecifier(id->_class);
12419 id->_class = (((void *)0));
12420 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12421 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12422 id->classSym = (((void *)0));
12423 exp->expType = type;
12426 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12427 exp->isConstant = 0x1;
12428 if(symbol->isParam || !strcmp(id->string, "this"))
12430 if(_class && _class->type == 1 && !type->declaredWithStruct)
12431 exp->byReference = 0x1;
12433 if(symbol->isIterator)
12435 if(symbol->isIterator == 3)
12438 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12439 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12440 exp->expType = (((void *)0));
12441 ProcessExpressionType(exp);
12443 else if(symbol->isIterator != 4)
12446 exp->member.exp = MkExpIdentifier(exp->identifier);
12447 exp->member.exp->expType = exp->expType;
12448 exp->member.member = MkIdentifier("data");
12449 exp->expType = (((void *)0));
12450 ProcessExpressionType(exp);
12457 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12459 if(thisNameSpace && !(id->_class && !id->_class->name))
12463 strcpy(name, thisNameSpace);
12464 strcat(name, "::");
12465 strcat(name, id->string);
12466 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12469 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12474 for(c = 0; c < definedExpStackPos; c++)
12475 if(definedExpStack[c] == definedExp)
12477 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12479 struct Location backupYylloc = yylloc;
12481 definedExpStack[definedExpStackPos++] = definedExp;
12482 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12483 ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, definedExp->value, 1, strlen(definedExp->value));
12484 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12486 parsedExpression = (((void *)0));
12488 expression_yyparse();
12489 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12490 yylloc = backupYylloc;
12491 if(parsedExpression)
12493 FreeIdentifier(id);
12495 exp->list = MkListOne(parsedExpression);
12496 parsedExpression->loc = yylloc;
12497 ProcessExpressionType(exp);
12498 definedExpStackPos--;
12501 definedExpStackPos--;
12507 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12513 struct GlobalData * data = (((void *)0));
12515 if(thisNameSpace && !(id->_class && !id->_class->name))
12519 strcpy(name, thisNameSpace);
12520 strcat(name, "::");
12521 strcat(name, id->string);
12522 data = FindGlobalData(name);
12525 data = FindGlobalData(id->string);
12528 DeclareGlobalData(data);
12529 exp->expType = data->dataType;
12531 data->dataType->refCount++;
12532 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12533 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12534 FreeSpecifier(id->_class);
12535 id->_class = (((void *)0));
12540 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12542 if(thisNameSpace && !(id->_class && !id->_class->name))
12546 strcpy(name, thisNameSpace);
12547 strcat(name, "::");
12548 strcat(name, id->string);
12549 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12552 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12557 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12558 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12560 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12561 strcpy(name, "__ecereFunction_");
12562 FullClassNameCat(name, id->string, 0x0);
12563 if(DeclareFunction(function, name))
12565 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12566 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12568 exp->expType = function->dataType;
12569 if(function->dataType)
12570 function->dataType->refCount++;
12571 FreeSpecifier(id->_class);
12572 id->_class = (((void *)0));
12584 struct __ecereNameSpace__ecere__com__Class * _class;
12586 if(!exp->instance->_class)
12588 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12590 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12593 ProcessInstantiationType(exp->instance);
12594 exp->isConstant = exp->instance->isConstant;
12595 if(exp->instance->_class)
12597 exp->expType = MkClassType(exp->instance->_class->name);
12605 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12607 exp->expType = type;
12608 if(exp->constant[0] == '\'')
12610 if((int)((unsigned char *)exp->constant)[1] > 127)
12613 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12616 ch = exp->constant[1];
12617 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12618 exp->constant = PrintUInt(ch);
12620 type->_class = FindClass("unichar");
12621 type->isSigned = 0x0;
12626 type->isSigned = 0x1;
12629 else if(strchr(exp->constant, '.'))
12631 char ch = exp->constant[strlen(exp->constant) - 1];
12637 type->isSigned = 0x1;
12641 if(exp->constant[0] == '0' && exp->constant[1])
12642 type->isSigned = 0x0;
12643 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12644 type->isSigned = 0x0;
12645 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12646 type->isSigned = 0x0;
12648 type->isSigned = 0x1;
12651 exp->isConstant = 0x1;
12652 if(exp->destType && exp->destType->kind == 7)
12654 else if(exp->destType && exp->destType->kind == 6)
12656 else if(exp->destType && exp->destType->kind == 4)
12663 exp->isConstant = 0x1;
12664 exp->expType = __extension__ ({
12665 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12667 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
12668 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12670 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
12671 }), __ecereInstance2;
12677 ProcessExpressionType(exp->_new.size);
12678 exp->expType = __extension__ ({
12679 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12681 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
12683 DeclareType(exp->expType->type, 0x0, 0x0);
12687 ProcessExpressionType(exp->_renew.size);
12688 ProcessExpressionType(exp->_renew.exp);
12689 exp->expType = __extension__ ({
12690 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12692 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
12694 DeclareType(exp->expType->type, 0x0, 0x0);
12698 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12699 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12700 unsigned int useDestType = 0x0, useSideType = 0x0;
12701 struct Location oldyylloc = yylloc;
12702 unsigned int useSideUnit = 0x0;
12703 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
12745 if(exp->op.op != '*' || exp->op.exp1)
12752 if(exp->op.op == '&')
12754 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12756 struct Identifier * id = exp->op.exp2->identifier;
12757 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12759 if(symbol && symbol->isIterator == 2)
12762 exp->member.exp = exp->op.exp2;
12763 exp->member.member = MkIdentifier("key");
12764 exp->expType = (((void *)0));
12765 exp->op.exp2->expType = symbol->type;
12766 symbol->type->refCount++;
12767 ProcessExpressionType(exp);
12775 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))
12777 if(exp->op.exp1->destType)
12778 FreeType(exp->op.exp1->destType);
12779 exp->op.exp1->destType = exp->destType;
12781 exp->destType->refCount++;
12785 if(exp->op.exp1->destType)
12786 FreeType(exp->op.exp1->destType);
12787 exp->op.exp1->destType = dummy;
12790 if(exp->op.exp1->destType && exp->op.op != '=')
12791 exp->op.exp1->destType->count++;
12792 ProcessExpressionType(exp->op.exp1);
12793 if(exp->op.exp1->destType && exp->op.op != '=')
12794 exp->op.exp1->destType->count--;
12795 if(exp->op.exp1->destType == dummy)
12798 exp->op.exp1->destType = (((void *)0));
12800 type1 = exp->op.exp1->expType;
12804 char expString[10240];
12806 expString[0] = '\0';
12807 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12811 exp->op.exp2->destType = exp->op.exp1->expType;
12812 if(exp->op.exp1->expType)
12813 exp->op.exp1->expType->refCount++;
12817 exp->op.exp2->destType = exp->destType;
12819 exp->destType->refCount++;
12823 exp->expType = type1;
12828 PrintExpression(exp->op.exp2, expString);
12829 if(type1 && type1->kind == 13)
12831 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)
12832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12833 else if(exp->op.op == '=')
12835 if(exp->op.exp2->destType)
12836 FreeType(exp->op.exp2->destType);
12837 exp->op.exp2->destType = type1;
12844 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)
12848 if(exp->op.exp2->destType)
12849 FreeType(exp->op.exp2->destType);
12850 exp->op.exp2->destType = type1;
12857 exp->expType = type1;
12859 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)))
12861 if(exp->op.exp2->destType)
12862 FreeType(exp->op.exp2->destType);
12863 exp->op.exp2->destType = exp->destType;
12865 exp->destType->refCount++;
12869 if(exp->op.exp2->destType)
12870 FreeType(exp->op.exp2->destType);
12871 exp->op.exp2->destType = dummy;
12874 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12876 FreeType(exp->op.exp2->destType);
12877 exp->op.exp2->destType = type1;
12880 if(exp->op.exp2->destType && exp->op.op != '=')
12881 exp->op.exp2->destType->count++;
12882 ProcessExpressionType(exp->op.exp2);
12883 if(exp->op.exp2->destType && exp->op.op != '=')
12884 exp->op.exp2->destType->count--;
12885 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12887 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)
12889 if(exp->op.op != '=' && type1->type->kind == 0)
12890 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12892 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)))
12894 if(exp->op.op == ADD_ASSIGN)
12895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12897 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))
12899 if(exp->op.op == ADD_ASSIGN)
12900 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12902 else if(inCompiler)
12904 char type1String[1024];
12905 char type2String[1024];
12907 type1String[0] = '\0';
12908 type2String[0] = '\0';
12909 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12910 PrintType(type1, type2String, 0x0, 0x1);
12911 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12912 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12915 if(exp->op.exp2->destType == dummy)
12918 exp->op.exp2->destType = (((void *)0));
12920 type2 = exp->op.exp2->expType;
12923 if(exp->op.op == SIZEOF)
12925 exp->expType = __extension__ ({
12926 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12928 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
12930 exp->isConstant = 0x1;
12932 else if(exp->op.op == '*' && !exp->op.exp1)
12934 exp->expType = Dereference(type2);
12935 if(type2 && type2->kind == 8)
12936 notByReference = 0x1;
12938 else if(exp->op.op == '&' && !exp->op.exp1)
12939 exp->expType = Reference(type2);
12946 if(exp->op.exp1->destType)
12947 FreeType(exp->op.exp1->destType);
12948 exp->op.exp1->destType = MkClassType("bool");
12949 exp->op.exp1->destType->truth = 0x1;
12950 if(!exp->op.exp1->expType)
12951 ProcessExpressionType(exp->op.exp1);
12953 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12954 FreeType(exp->op.exp1->expType);
12955 exp->op.exp1->expType = MkClassType("bool");
12956 exp->op.exp1->expType->truth = 0x1;
12960 if(exp->op.exp2->destType)
12961 FreeType(exp->op.exp2->destType);
12962 exp->op.exp2->destType = MkClassType("bool");
12963 exp->op.exp2->destType->truth = 0x1;
12964 if(!exp->op.exp2->expType)
12965 ProcessExpressionType(exp->op.exp2);
12967 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12968 FreeType(exp->op.exp2->expType);
12969 exp->op.exp2->expType = MkClassType("bool");
12970 exp->op.exp2->expType->truth = 0x1;
12973 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")))))
12975 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12977 if(exp->op.exp2->destType)
12978 FreeType(exp->op.exp2->destType);
12979 exp->op.exp2->destType = type1;
12981 if(exp->op.exp1->destType)
12982 FreeType(exp->op.exp1->destType);
12983 exp->op.exp1->destType = type2;
12985 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)
12986 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);
12987 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12989 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12993 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12995 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12996 ProcessExpressionType(exp->op.exp1);
12997 if(type2->kind != 13)
12999 ProcessExpressionType(classExp);
13000 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"))))))));
13001 if(!exp->op.exp2->expType)
13002 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
13003 ProcessExpressionType(exp->op.exp2);
13007 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)))
13009 if(type1->kind != 8 && type1->type->kind == 0)
13010 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13011 exp->expType = type1;
13015 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)))
13017 if(type2->kind != 8 && type2->type->kind == 0)
13018 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
13019 exp->expType = type2;
13023 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))
13025 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
13029 unsigned int success = 0x0;
13031 if(type1->kind == 13 && type2->kind == 13)
13033 if(exp->op.op == '+')
13034 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
13035 else if(exp->op.op == '-')
13037 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
13039 exp->expType = __extension__ ({
13040 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13042 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
13045 if(type1->type->kind == 20)
13047 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
13051 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
13053 ProcessExpressionType(classExp);
13055 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")))))));
13056 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
13064 if(!success && exp->op.exp1->type == 2)
13066 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13069 FreeType(exp->expType);
13070 exp->expType = exp->op.exp1->destType;
13071 if(exp->op.exp1->destType)
13072 exp->op.exp1->destType->refCount++;
13075 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13078 FreeType(exp->expType);
13079 exp->expType = exp->op.exp2->destType;
13080 if(exp->op.exp2->destType)
13081 exp->op.exp2->destType->refCount++;
13087 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13090 FreeType(exp->expType);
13091 exp->expType = exp->op.exp2->destType;
13092 if(exp->op.exp2->destType)
13093 exp->op.exp2->destType->refCount++;
13096 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13099 FreeType(exp->expType);
13100 exp->expType = exp->op.exp1->destType;
13101 if(exp->op.exp1->destType)
13102 exp->op.exp1->destType->refCount++;
13108 char expString1[10240];
13109 char expString2[10240];
13113 expString1[0] = '\0';
13114 expString2[0] = '\0';
13119 PrintExpression(exp->op.exp1, expString1);
13120 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13121 PrintExpression(exp->op.exp2, expString2);
13122 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13123 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
13124 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
13126 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
13130 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13132 if(exp->op.exp1->destType)
13133 FreeType(exp->op.exp1->destType);
13134 exp->op.exp1->destType = type2->_class->registered->dataType;
13135 if(type2->_class->registered->dataType)
13136 type2->_class->registered->dataType->refCount++;
13137 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13138 exp->expType = type2;
13142 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13144 if(exp->op.exp2->destType)
13145 FreeType(exp->op.exp2->destType);
13146 exp->op.exp2->destType = type1->_class->registered->dataType;
13147 if(type1->_class->registered->dataType)
13148 type1->_class->registered->dataType->refCount++;
13149 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13150 exp->expType = type1;
13156 unsigned int valid = 0x0;
13158 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13160 if(exp->op.exp2->destType)
13161 FreeType(exp->op.exp2->destType);
13162 if(!type1->_class->registered->dataType)
13163 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13164 exp->op.exp2->destType = type1->_class->registered->dataType;
13165 exp->op.exp2->destType->refCount++;
13166 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13167 type2 = exp->op.exp2->destType;
13168 exp->expType = type2;
13171 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13173 if(exp->op.exp1->destType)
13174 FreeType(exp->op.exp1->destType);
13175 if(!type2->_class->registered->dataType)
13176 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13177 exp->op.exp1->destType = type2->_class->registered->dataType;
13178 exp->op.exp1->destType->refCount++;
13179 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13180 type1 = exp->op.exp1->destType;
13181 exp->expType = type1;
13184 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13186 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13188 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13191 FreeType(exp->expType);
13192 exp->expType = exp->op.exp1->expType;
13193 if(exp->op.exp2->expType)
13194 exp->op.exp1->expType->refCount++;
13198 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13200 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13203 FreeType(exp->expType);
13204 exp->expType = exp->op.exp2->expType;
13205 if(exp->op.exp2->expType)
13206 exp->op.exp2->expType->refCount++;
13213 if(exp->op.exp2->destType)
13214 FreeType(exp->op.exp2->destType);
13215 exp->op.exp2->destType = type1;
13217 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13220 FreeType(exp->expType);
13221 exp->expType = exp->op.exp2->destType;
13222 if(exp->op.exp2->destType)
13223 exp->op.exp2->destType->refCount++;
13225 else if(type1 && type2)
13227 char expString1[10240];
13228 char expString2[10240];
13229 char type1String[1024];
13230 char type2String[1024];
13232 expString1[0] = '\0';
13233 expString2[0] = '\0';
13234 type1String[0] = '\0';
13235 type2String[0] = '\0';
13238 PrintExpression(exp->op.exp1, expString1);
13239 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13240 PrintExpression(exp->op.exp2, expString2);
13241 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13242 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13243 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13245 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13246 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13248 exp->expType = exp->op.exp1->expType;
13249 if(exp->op.exp1->expType)
13250 exp->op.exp1->expType->refCount++;
13252 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13254 exp->expType = exp->op.exp2->expType;
13255 if(exp->op.exp2->expType)
13256 exp->op.exp2->expType->refCount++;
13263 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13265 struct Type * oldType = exp->op.exp1->expType;
13267 exp->op.exp1->expType = (((void *)0));
13268 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13271 exp->op.exp1->expType = oldType;
13273 if(exp->op.exp1->destType)
13274 FreeType(exp->op.exp1->destType);
13275 exp->op.exp1->destType = type2;
13277 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13280 FreeType(exp->expType);
13281 exp->expType = exp->op.exp1->destType;
13282 if(exp->op.exp1->destType)
13283 exp->op.exp1->destType->refCount++;
13287 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13289 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13291 if(exp->op.exp1->destType)
13292 FreeType(exp->op.exp1->destType);
13293 exp->op.exp1->destType = type2->_class->registered->dataType;
13294 if(type2->_class->registered->dataType)
13295 type2->_class->registered->dataType->refCount++;
13296 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13298 if(exp->op.op == '!')
13300 exp->expType = MkClassType("bool");
13301 exp->expType->truth = 0x1;
13305 exp->expType = type2;
13310 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13312 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13314 if(exp->op.exp2->destType)
13315 FreeType(exp->op.exp2->destType);
13316 exp->op.exp2->destType = type1->_class->registered->dataType;
13317 if(type1->_class->registered->dataType)
13318 type1->_class->registered->dataType->refCount++;
13319 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13321 exp->expType = type1;
13327 if(exp->op.exp1 && !exp->op.exp1->expType)
13329 char expString[10000];
13331 expString[0] = '\0';
13334 PrintExpression(exp->op.exp1, expString);
13335 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13338 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13340 if(exp->op.exp2 && !exp->op.exp2->expType)
13342 char expString[10240];
13344 expString[0] = '\0';
13347 PrintExpression(exp->op.exp2, expString);
13348 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13351 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13355 FreeType(exp->expType);
13356 exp->expType = MkClassType("bool");
13357 exp->expType->truth = 0x1;
13359 if(exp->op.op != SIZEOF)
13360 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13361 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13363 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13365 yylloc = oldyylloc;
13372 struct Expression * e;
13374 exp->isConstant = 0x1;
13375 for(e = (*exp->list).first; e; e = e->next)
13377 unsigned int inced = 0x0;
13381 FreeType(e->destType);
13382 e->destType = exp->destType;
13385 exp->destType->refCount++;
13386 e->destType->count++;
13390 ProcessExpressionType(e);
13392 exp->destType->count--;
13393 if(!exp->expType && !e->next)
13395 exp->expType = e->expType;
13397 e->expType->refCount++;
13400 exp->isConstant = 0x0;
13402 e = (*exp->list).first;
13403 if(!e->next && e->type == 8)
13405 struct Expression * next = exp->next, * prev = exp->prev;
13407 FreeType(exp->expType);
13408 FreeType(exp->destType);
13409 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13413 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13414 ProcessExpressionType(exp);
13420 struct Expression * e;
13422 exp->isConstant = 0x1;
13423 ProcessExpressionType(exp->index.exp);
13424 if(!exp->index.exp->isConstant)
13425 exp->isConstant = 0x0;
13426 if(exp->index.exp->expType)
13428 struct Type * source = exp->index.exp->expType;
13430 if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass) && source->_class->registered->templateArgs)
13432 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13434 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13435 if(exp->index.index && (*exp->index.index).last)
13437 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13441 for(e = (*exp->index.index).first; e; e = e->next)
13443 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13446 FreeType(e->destType);
13447 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13449 ProcessExpressionType(e);
13454 exp->isConstant = 0x0;
13457 exp->expType = Dereference(exp->index.exp->expType);
13459 DeclareType(exp->expType, 0x0, 0x0);
13464 struct Expression * e;
13465 struct Type * functionType;
13466 struct Type * methodType = (((void *)0));
13472 PrintExpression(exp->call.exp, name);
13473 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13475 PrintExpression(exp->call.exp, name);
13478 if(exp->call.exp->type == 0)
13480 struct Expression * idExp = exp->call.exp;
13481 struct Identifier * id = idExp->identifier;
13483 if(!strcmp(id->string, "__builtin_frame_address"))
13485 exp->expType = ProcessTypeString("void *", 0x1);
13486 if(exp->call.arguments && (*exp->call.arguments).first)
13487 ProcessExpressionType((*exp->call.arguments).first);
13490 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13492 exp->expType = ProcessTypeString("int", 0x1);
13493 if(exp->call.arguments && (*exp->call.arguments).first)
13494 ProcessExpressionType((*exp->call.arguments).first);
13497 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13499 struct Expression * a = (((void *)0));
13500 struct Expression * b = (((void *)0));
13501 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13503 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13505 a = (*exp->call.arguments).first;
13506 b = (*exp->call.arguments).last;
13510 else if((*exp->call.arguments).count == 1)
13512 a = (*exp->call.arguments).first;
13517 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13518 idExp->identifier = (((void *)0));
13519 FreeExpContents(exp);
13520 ProcessExpressionType(a);
13522 ProcessExpressionType(b);
13524 exp->list = MkList();
13525 if(a->expType && (!b || b->expType))
13527 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13531 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13532 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13533 struct Declaration * decl;
13534 char temp1[1024], temp2[1024];
13536 GetTypeSpecs(a->expType, specs);
13537 if(a && !a->isConstant && a->type != 0)
13539 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13540 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13541 tempExp1 = QMkExpId(temp1);
13542 tempExp1->expType = a->expType;
13544 a->expType->refCount++;
13545 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13547 if(b && !b->isConstant && b->type != 0)
13549 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13550 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13551 tempExp2 = QMkExpId(temp2);
13552 tempExp2->expType = b->expType;
13554 b->expType->refCount++;
13555 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13557 decl = MkDeclaration(specs, decls);
13558 if(!curCompound->compound.declarations)
13559 curCompound->compound.declarations = MkList();
13560 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13564 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13566 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13568 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13569 exp->expType = a->expType;
13571 a->expType->refCount++;
13573 else if(!strcmp(id->string, "Abs"))
13575 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13576 exp->expType = a->expType;
13578 a->expType->refCount++;
13580 else if(!strcmp(id->string, "Sgn"))
13582 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"))))));
13583 exp->expType = ProcessTypeString("int", 0x0);
13585 FreeExpression(tempExp1);
13587 FreeExpression(tempExp2);
13588 FreeIdentifier(id);
13594 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = 1, dummy->refCount = 1, dummy);
13596 if(!exp->call.exp->destType)
13598 exp->call.exp->destType = dummy;
13601 ProcessExpressionType(exp->call.exp);
13602 if(exp->call.exp->destType == dummy)
13605 exp->call.exp->destType = (((void *)0));
13609 functionType = exp->call.exp->expType;
13610 if(functionType && functionType->kind == 16)
13612 methodType = functionType;
13613 functionType = methodType->method->dataType;
13614 if(exp->call.exp->expType->usedClass)
13616 char typeString[1024];
13618 typeString[0] = '\0';
13620 struct Symbol * back = functionType->thisClass;
13622 functionType->thisClass = (((void *)0));
13623 PrintType(functionType, typeString, 0x1, 0x1);
13624 functionType->thisClass = back;
13626 if(strstr(typeString, "thisclass"))
13628 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13629 struct Declarator * decl;
13632 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13634 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13635 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13636 thisClassParams = 0x0;
13637 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13639 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13641 thisClass = exp->call.exp->expType->usedClass;
13642 ProcessDeclarator(decl);
13643 thisClass = backupThisClass;
13645 thisClassParams = 0x1;
13646 functionType = ProcessType(specs, decl);
13647 functionType->refCount = 0;
13648 FinishTemplatesContext(context);
13650 FreeList(specs, FreeSpecifier);
13651 FreeDeclarator(decl);
13655 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13657 struct Type * type = functionType->type;
13659 if(!functionType->refCount)
13661 functionType->type = (((void *)0));
13662 FreeType(functionType);
13664 functionType = type;
13666 if(functionType && functionType->kind != 11)
13668 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13670 else if(functionType)
13672 unsigned int emptyParams = 0x0, noParams = 0x0;
13673 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13674 struct Type * type = functionType->params.first;
13675 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13677 struct Location oldyylloc = yylloc;
13681 if(functionType->extraParam && e && functionType->thisClass)
13683 e->destType = MkClassType(functionType->thisClass->string);
13686 if(!functionType->staticMethod)
13688 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13690 type = MkClassType(memberExp->member.exp->expType->_class->string);
13693 e->destType = type;
13695 type = functionType->params.first;
13698 type->refCount = 0;
13700 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13702 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13705 e->destType = type;
13707 type = functionType->params.first;
13710 type->refCount = 0;
13713 if(type && type->kind == 0)
13716 if(!type->refCount)
13718 type = (((void *)0));
13720 for(; e; e = e->next)
13722 if(!type && !emptyParams)
13725 if(methodType && methodType->methodClass)
13726 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);
13728 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);
13731 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13733 struct Type * templatedType = (((void *)0));
13734 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13735 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13738 if(_class && _class->templateArgs)
13740 struct __ecereNameSpace__ecere__com__Class * sClass;
13742 for(sClass = _class; sClass; sClass = sClass->base)
13744 if(sClass->templateClass)
13745 sClass = sClass->templateClass;
13747 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13749 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13751 struct __ecereNameSpace__ecere__com__Class * nextClass;
13753 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13755 if(nextClass->templateClass)
13756 nextClass = nextClass->templateClass;
13757 id += nextClass->templateParams.count;
13767 if(curParam && _class->templateArgs[id].dataTypeString)
13769 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13772 struct Context * context = SetupTemplatesContext(_class);
13774 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13775 FinishTemplatesContext(context);
13777 e->destType = templatedType;
13780 templatedType->passAsTemplate = 0x1;
13785 e->destType = type;
13792 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13794 e->destType = type->prev;
13795 e->destType->refCount++;
13799 e->destType = type;
13804 if(type && type->kind != 14)
13806 struct Type * next = type->next;
13808 if(!type->refCount)
13813 if(type && type->kind != 14)
13815 if(methodType && methodType->methodClass)
13816 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);
13818 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);
13820 yylloc = oldyylloc;
13821 if(type && !type->refCount)
13826 functionType = __extension__ ({
13827 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13829 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
13831 if(exp->call.exp->type == 0)
13833 char * string = exp->call.exp->identifier->string;
13837 struct Symbol * symbol;
13838 struct Location oldyylloc = yylloc;
13840 yylloc = exp->call.exp->identifier->loc;
13841 if(strstr(string, "__builtin_") == string)
13845 functionType->returnType = exp->destType;
13846 exp->destType->refCount++;
13850 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13851 symbol = __extension__ ({
13852 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
13854 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
13856 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13857 if(strstr(symbol->string, "::"))
13858 globalContext->hasNameSpace = 0x1;
13859 yylloc = oldyylloc;
13862 else if(exp->call.exp->type == 8)
13866 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13867 if(!functionType->returnType)
13869 functionType->returnType = __extension__ ({
13870 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13872 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13876 if(functionType && functionType->kind == 11)
13878 exp->expType = functionType->returnType;
13879 if(functionType->returnType)
13880 functionType->returnType->refCount++;
13881 if(!functionType->refCount)
13882 FreeType(functionType);
13884 if(exp->call.arguments)
13886 for(e = (*exp->call.arguments).first; e; e = e->next)
13888 struct Type * destType = e->destType;
13890 ProcessExpressionType(e);
13897 struct Type * type;
13898 struct Location oldyylloc = yylloc;
13899 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13901 exp->thisPtr = thisPtr;
13902 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13904 exp->member.member->classSym = exp->member.member->_class->symbol;
13906 ProcessExpressionType(exp->member.exp);
13907 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)
13909 exp->isConstant = 0x0;
13912 exp->isConstant = exp->member.exp->isConstant;
13913 type = exp->member.exp->expType;
13915 if(type && (type->kind == 20))
13917 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13918 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13922 for(param = _class->templateParams.first; param; param = param->next)
13924 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13928 if(param && param->defaultArg.member)
13930 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13934 struct Expression * expMember = exp->member.exp;
13935 struct Declarator * decl;
13936 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13937 char thisClassTypeString[1024];
13939 FreeIdentifier(exp->member.member);
13940 ProcessExpressionType(argExp);
13942 char * colon = strstr(param->defaultArg.memberString, "::");
13946 char className[1024];
13947 struct __ecereNameSpace__ecere__com__Class * sClass;
13949 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13950 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13953 strcpy(thisClassTypeString, _class->fullName);
13955 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13956 exp->expType = ProcessType(specs, decl);
13957 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13959 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13960 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13962 int paramCount = 0;
13963 int lastParam = -1;
13964 char templateString[1024];
13965 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13967 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13968 for(cClass = expClass; cClass; cClass = cClass->base)
13972 for(param = cClass->templateParams.first; param; param = param->next)
13975 struct __ecereNameSpace__ecere__com__Class * sClass;
13976 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13978 for(sClass = cClass->base; sClass; sClass = sClass->base)
13979 id += sClass->templateParams.count;
13980 arg = expClass->templateArgs[id];
13981 for(sClass = _class; sClass; sClass = sClass->base)
13983 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13985 struct __ecereNameSpace__ecere__com__Class * nextClass;
13987 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13988 p += nextClass->templateParams.count;
13989 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13991 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13993 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13995 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13996 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
14003 char argument[256];
14005 argument[0] = '\0';
14006 switch(param->type)
14010 char expString[1024];
14011 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14012 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14013 struct Expression * exp;
14014 char * string = PrintHexUInt64(arg.expression.ui64);
14016 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14017 ProcessExpressionType(exp);
14018 ComputeExpression(exp);
14019 expString[0] = '\0';
14020 PrintExpression(exp, expString);
14021 strcat(argument, expString);
14022 FreeExpression(exp);
14027 strcat(argument, arg.member->name);
14032 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14034 if(!strcmp(arg.dataTypeString, "thisclass"))
14035 strcat(argument, thisClassTypeString);
14037 strcat(argument, arg.dataTypeString);
14045 strcat(templateString, ", ");
14046 if(lastParam != p - 1)
14048 strcat(templateString, param->name);
14049 strcat(templateString, " = ");
14051 strcat(templateString, argument);
14060 int len = strlen(templateString);
14062 if(templateString[len - 1] == '>')
14063 templateString[len++] = ' ';
14064 templateString[len++] = '>';
14065 templateString[len++] = '\0';
14068 struct Context * context = SetupTemplatesContext(_class);
14070 FreeType(exp->expType);
14071 exp->expType = ProcessTypeString(templateString, 0x0);
14072 FinishTemplatesContext(context);
14076 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")))))))));
14079 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
14081 type = ProcessTemplateParameterType(type->templateParameter);
14084 if(type && (type->kind == 20))
14086 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 == 22 || type->kind == 23 || type->kind == 6 || type->kind == 7 || (type->kind == 13 && type->type->kind == 1)))
14088 struct Identifier * id = exp->member.member;
14089 int typeKind = type->kind;
14090 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));
14092 if(typeKind == 19 && exp->member.exp->type == 26)
14094 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14099 if(typeKind == 3 || typeKind == 15)
14100 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
14103 if(type->kind == 8 && type->_class && type->_class->registered)
14105 _class = type->_class->registered;
14107 else if((type->kind == 12 || type->kind == 13) && type->type && type->type->kind == 1)
14109 _class = FindClass("char *")->registered;
14111 else if(type->kind == 13)
14113 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "uintptr");
14114 FreeType(exp->expType);
14115 exp->expType = ProcessTypeString("uintptr", 0x0);
14116 exp->byReference = 0x1;
14120 char string[1024] = "";
14121 struct Symbol * classSym;
14123 PrintTypeNoConst(type, string, 0x0, 0x1);
14124 classSym = FindClass(string);
14126 _class = classSym->registered;
14132 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14133 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
14134 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14135 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
14136 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
14138 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
14139 exp->member.memberType = 1;
14140 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
14141 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
14144 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
14146 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14147 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
14149 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14151 member = (((void *)0));
14153 if(!member && !prop)
14154 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14155 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
14156 exp->member.thisPtr = 0x1;
14162 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
14163 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14164 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
14166 if(!prop && !member)
14168 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
14171 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14172 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14173 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14178 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
14179 prop = (((void *)0));
14181 member = (((void *)0));
14185 if(!prop && !member && !method)
14186 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
14187 if(!prop && !member && !method)
14191 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14194 exp->member.memberType = 5;
14195 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14199 char structName[1024];
14200 struct Identifier * id = exp->member.member;
14201 struct Expression * classExp = exp->member.exp;
14204 FreeType(classExp->expType);
14205 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14206 strcpy(structName, "__ecereClassData_");
14207 FullClassNameCat(structName, type->_class->string, 0x0);
14209 exp->member.member = id;
14210 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"))))))));
14212 ProcessExpressionType(exp);
14218 struct Symbol * classSym = FindClass(id->string);
14222 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14225 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14231 exp->member.memberType = 1;
14232 if(!prop->dataType)
14233 ProcessPropertyType(prop);
14234 exp->expType = prop->dataType;
14236 prop->dataType->refCount++;
14240 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14242 FreeExpContents(exp);
14244 exp->identifier = MkIdentifier("class");
14245 ProcessExpressionType(exp);
14248 exp->member.memberType = 3;
14249 DeclareStruct(_class->fullName, 0x0);
14250 if(!member->dataType)
14252 struct Context * context = SetupTemplatesContext(_class);
14254 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14255 FinishTemplatesContext(context);
14257 exp->expType = member->dataType;
14258 if(member->dataType)
14259 member->dataType->refCount++;
14261 else if(revConvert)
14263 exp->member.memberType = 4;
14264 exp->expType = MkClassType(revConvert->_class->fullName);
14269 exp->member.memberType = 2;
14271 if(!method->dataType)
14272 ProcessMethodType(method);
14273 exp->expType = __extension__ ({
14274 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14276 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
14278 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14279 exp->expType->usedClass = _class;
14281 else if(!classProp)
14283 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14285 FreeExpContents(exp);
14287 exp->identifier = MkIdentifier("class");
14288 ProcessExpressionType(exp);
14291 yylloc = exp->member.member->loc;
14292 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14294 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14296 if(_class && exp->expType)
14298 struct __ecereNameSpace__ecere__com__Class * tClass;
14301 while(tClass && !tClass->templateClass)
14302 tClass = tClass->base;
14303 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14306 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14307 struct __ecereNameSpace__ecere__com__Class * sClass;
14309 for(sClass = tClass; sClass; sClass = sClass->base)
14312 if(sClass->templateClass)
14313 sClass = sClass->templateClass;
14314 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14316 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14318 for(sClass = sClass->base; sClass; sClass = sClass->base)
14319 id += sClass->templateParams.count;
14327 if(curParam && tClass->templateArgs[id].dataTypeString)
14329 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14330 struct Context * context = SetupTemplatesContext(tClass);
14332 FreeType(exp->expType);
14333 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14336 if(exp->expType->kind == 21)
14338 FreeType(exp->expType);
14339 exp->expType = ReplaceThisClassType(_class);
14341 if(tClass->templateClass)
14342 exp->expType->passAsTemplate = 0x1;
14345 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14346 if(exp->destType->kind == 21)
14348 FreeType(exp->destType);
14349 exp->destType = ReplaceThisClassType(_class);
14353 FinishTemplatesContext(context);
14356 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14359 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14360 struct __ecereNameSpace__ecere__com__Class * sClass;
14362 for(sClass = tClass; sClass; sClass = sClass->base)
14365 if(sClass->templateClass)
14366 sClass = sClass->templateClass;
14367 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14369 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14371 for(sClass = sClass->base; sClass; sClass = sClass->base)
14372 id += sClass->templateParams.count;
14382 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14383 struct Context * context = SetupTemplatesContext(tClass);
14384 struct Type * basicType;
14386 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14389 if(basicType->kind == 21)
14391 FreeType(basicType);
14392 basicType = ReplaceThisClassType(_class);
14394 FreeType(exp->expType);
14395 exp->expType = __extension__ ({
14396 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14398 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
14402 exp->destType = exp->expType;
14403 exp->destType->refCount++;
14406 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14407 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14408 struct Declarator * decl;
14410 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14413 exp->destType->refCount++;
14415 exp->expType->refCount++;
14417 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14418 exp->cast.exp = newExp;
14421 FinishTemplatesContext(context);
14424 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14426 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14430 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14433 int paramCount = 0;
14434 int lastParam = -1;
14435 char templateString[1024];
14436 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14438 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14439 while(cClass != expClass)
14441 struct __ecereNameSpace__ecere__com__Class * sClass;
14443 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14446 for(param = cClass->templateParams.first; param; param = param->next)
14448 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14451 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14452 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14454 while(cClassCur != tClass && !paramCur)
14456 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14458 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14460 cClassCur = sClassCur;
14461 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14463 if(!strcmp(paramCur->name, param->name))
14470 if(paramCur && paramCur->type == 0)
14471 arg = tClass->templateArgs[cp];
14473 arg = expClass->templateArgs[p];
14475 char argument[256];
14477 argument[0] = '\0';
14478 switch(param->type)
14482 char expString[1024];
14483 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14484 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14485 struct Expression * exp;
14486 char * string = PrintHexUInt64(arg.expression.ui64);
14488 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14489 ProcessExpressionType(exp);
14490 ComputeExpression(exp);
14491 expString[0] = '\0';
14492 PrintExpression(exp, expString);
14493 strcat(argument, expString);
14494 FreeExpression(exp);
14499 strcat(argument, arg.member->name);
14504 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14505 strcat(argument, arg.dataTypeString);
14512 strcat(templateString, ", ");
14513 if(lastParam != p - 1)
14515 strcat(templateString, param->name);
14516 strcat(templateString, " = ");
14518 strcat(templateString, argument);
14527 int len = strlen(templateString);
14529 if(templateString[len - 1] == '>')
14530 templateString[len++] = ' ';
14531 templateString[len++] = '>';
14532 templateString[len++] = '\0';
14534 FreeType(exp->expType);
14536 struct Context * context = SetupTemplatesContext(tClass);
14538 exp->expType = ProcessTypeString(templateString, 0x0);
14539 FinishTemplatesContext(context);
14546 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)");
14548 else if(type && (type->kind == 9 || type->kind == 10))
14550 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14554 exp->expType = memberType;
14556 memberType->refCount++;
14561 char expString[10240];
14563 expString[0] = '\0';
14566 PrintExpression(exp, expString);
14567 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14569 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14571 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14573 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14575 struct Identifier * id = exp->member.member;
14576 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));
14580 FreeType(exp->expType);
14581 exp->expType = ReplaceThisClassType(_class);
14585 yylloc = oldyylloc;
14590 struct Type * destType = exp->destType;
14592 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14594 exp->member.member->classSym = exp->member.member->_class->symbol;
14596 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14600 ProcessExpressionType(exp);
14607 struct Symbol * classSym = exp->_class->symbol;
14609 if(classSym && classSym->registered)
14611 if(classSym->registered->type == 5)
14616 DeclareStruct(classSym->string, 0x0);
14617 FreeSpecifier(exp->_class);
14619 FullClassNameCat(name, classSym->string, 0x0);
14620 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14624 if(classSym->registered->fixed)
14626 FreeSpecifier(exp->_class);
14627 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14632 char className[1024];
14634 strcpy(className, "__ecereClass_");
14635 FullClassNameCat(className, classSym->string, 0x1);
14636 MangleClassName(className);
14637 DeclareClass(classSym, className);
14638 FreeExpContents(exp);
14640 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14641 exp->member.member = MkIdentifier("structSize");
14645 exp->expType = __extension__ ({
14646 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14648 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14654 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14656 exp->expType = __extension__ ({
14657 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14659 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14661 exp->isConstant = 0x1;
14662 DeclareType(type, 0x0, 0x0);
14668 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14671 FreeType(exp->cast.exp->destType);
14672 exp->cast.exp->destType = type;
14674 ProcessExpressionType(exp->cast.exp);
14676 exp->expType = type;
14677 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14679 void * prev = exp->prev, * next = exp->next;
14680 struct Type * expType = exp->cast.exp->destType;
14681 struct Expression * castExp = exp->cast.exp;
14682 struct Type * destType = exp->destType;
14685 expType->refCount++;
14686 FreeType(exp->expType);
14687 FreeTypeName(exp->cast.typeName);
14689 FreeType(exp->expType);
14690 FreeType(exp->destType);
14691 exp->expType = expType;
14692 exp->destType = destType;
14693 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14699 exp->isConstant = exp->cast.exp->isConstant;
14705 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14707 exp->expType = type;
14712 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14714 ProcessExpressionType(exp->vaArg.exp);
14715 exp->expType = type;
14720 struct Expression * e;
14722 exp->isConstant = 0x1;
14723 FreeType(exp->cond.cond->destType);
14724 exp->cond.cond->destType = MkClassType("bool");
14725 exp->cond.cond->destType->truth = 0x1;
14726 ProcessExpressionType(exp->cond.cond);
14727 if(!exp->cond.cond->isConstant)
14728 exp->isConstant = 0x0;
14729 for(e = (*exp->cond.exp).first; e; e = e->next)
14733 FreeType(e->destType);
14734 e->destType = exp->destType;
14736 e->destType->refCount++;
14738 ProcessExpressionType(e);
14741 exp->expType = e->expType;
14743 e->expType->refCount++;
14746 exp->isConstant = 0x0;
14748 FreeType(exp->cond.elseExp->destType);
14749 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14750 if(exp->cond.elseExp->destType)
14751 exp->cond.elseExp->destType->refCount++;
14752 ProcessExpressionType(exp->cond.elseExp);
14753 if(!exp->cond.elseExp->isConstant)
14754 exp->isConstant = 0x0;
14759 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14761 struct Statement * last = (*exp->compound->compound.statements).last;
14763 if(last->type == 3 && last->expressions && (*last->expressions).last)
14765 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14767 exp->destType->refCount++;
14769 ProcessStatement(exp->compound);
14770 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
14772 exp->expType->refCount++;
14778 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14780 if(spec && spec->type == 1)
14782 exp->expType = MkClassType(spec->name);
14783 exp->expType->kind = 19;
14784 exp->byReference = 0x1;
14788 exp->expType = MkClassType("ecere::com::Class");
14789 exp->byReference = 0x1;
14795 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14799 struct Identifier * id = exp->classData.id;
14800 char structName[1024];
14801 struct Expression * classExp;
14803 strcpy(structName, "__ecereClassData_");
14804 FullClassNameCat(structName, _class->fullName, 0x0);
14806 exp->member.member = id;
14807 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14808 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14810 classExp = MkExpIdentifier(MkIdentifier("class"));
14811 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"))))))));
14812 ProcessExpressionType(exp);
14819 struct Type * type = (((void *)0));
14820 char * typeString = (((void *)0));
14821 char typeStringBuf[1024];
14823 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))
14825 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14827 typeString = templateClass->templateArgs[2].dataTypeString;
14831 struct Expression * e;
14833 for(e = (*exp->list).first; e; e = e->next)
14835 ProcessExpressionType(e);
14845 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14849 e->expType = (((void *)0));
14850 e = (*exp->list).first;
14851 ProcessExpressionType(e);
14854 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14856 FreeType(e->expType);
14857 e->expType = (((void *)0));
14859 type = (((void *)0));
14867 FreeType(e->expType);
14868 e->expType = (((void *)0));
14874 typeStringBuf[0] = '\0';
14875 PrintTypeNoConst(type, typeStringBuf, 0x0, 0x1);
14876 typeString = typeStringBuf;
14878 type = (((void *)0));
14883 char templateString[1024];
14884 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14885 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14886 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14887 struct Expression * expExt;
14888 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14890 sprintf(templateString, "Container<%s>", typeString);
14893 struct Expression * e;
14895 type = ProcessTypeString(typeString, 0x0);
14896 while(e = (*exp->list).first)
14898 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14899 e->destType = type;
14901 ProcessExpressionType(e);
14902 ListAdd(initializers, MkInitializerAssignment(e));
14905 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14907 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14908 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14909 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14910 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14911 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14912 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14913 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14914 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14915 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14916 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
14917 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14919 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
14921 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14922 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14923 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14924 exp->expType = ProcessTypeString(templateString, 0x0);
14926 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14927 ProcessExpressionType(expExt);
14931 exp->expType = ProcessTypeString("Container", 0x0);
14932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14937 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14939 FreeType(exp->expType);
14940 exp->expType = ReplaceThisClassType(thisClass);
14942 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14944 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14948 if(exp->expType->kind != 15)
14950 struct Type * member;
14951 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14953 FreeType(exp->expType);
14954 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14955 exp->expType->kind = symbol->type->kind;
14956 exp->expType->refCount++;
14957 exp->expType->enumName = enumName;
14958 exp->expType->members = symbol->type->members;
14959 for(member = symbol->type->members.first; member; member = member->next)
14960 member->refCount++;
14964 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14966 for(member = symbol->type->members.first; member; member = member->next)
14968 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14970 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14976 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14978 else if(exp->destType && !exp->destType->keepCast)
14980 if(!CheckExpressionType(exp, exp->destType, 0x0))
14982 if(!exp->destType->count || unresolved)
14987 if(exp->destType->kind != 14)
14994 char expString[10240];
14996 expString[0] = '\0';
14997 PrintType(exp->destType, type2, 0x0, 0x1);
15000 PrintExpression(exp, expString);
15001 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15004 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
15005 else if(exp->type != 16)
15006 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
15011 char expString[10240];
15013 expString[0] = '\0';
15016 PrintExpression(exp, expString);
15017 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15020 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
15021 else if(exp->type != 16)
15022 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15034 PrintType(exp->expType, type1, 0x0, 0x1);
15035 PrintType(exp->destType, type2, 0x0, 0x1);
15037 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)))
15041 char expString[10240];
15043 expString[0] = '\0';
15046 PrintExpression(exp, expString);
15047 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15049 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
15050 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
15051 FreeType(exp->expType);
15052 exp->destType->refCount++;
15053 exp->expType = exp->destType;
15058 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
15060 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
15061 char typeString[1024];
15062 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15063 struct Declarator * decl;
15065 typeString[0] = '\0';
15068 exp->expType->refCount++;
15070 exp->expType->refCount++;
15072 newExp->destType = exp->expType;
15073 PrintType(exp->expType, typeString, 0x0, 0x0);
15074 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
15075 exp->cast.typeName = MkTypeName(specs, decl);
15076 exp->cast.exp = newExp;
15079 else if(unresolved)
15081 if(exp->identifier->_class && exp->identifier->_class->name)
15082 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
15083 else if(exp->identifier->string && exp->identifier->string[0])
15084 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
15086 else if(!exp->expType && exp->type != 16)
15088 char expString[10240];
15090 expString[0] = '\0';
15093 PrintExpression(exp, expString);
15094 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
15096 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
15099 ApplyAnyObjectLogic(exp);
15100 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)))
15102 exp->byReference = 0x1;
15104 yylloc = oldyylloc;
15107 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)
15111 *curMember = (*curMember)->next;
15112 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
15114 *curMember = subMemberStack[--(*subMemberStackPos)];
15115 *curMember = (*curMember)->next;
15117 while((*curMember) && (*curMember)->isProperty)
15118 *curMember = (*curMember)->next;
15119 if(subMemberStackPos)
15121 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15123 subMemberStack[(*subMemberStackPos)++] = *curMember;
15124 *curMember = (*curMember)->members.first;
15125 while(*curMember && (*curMember)->isProperty)
15126 *curMember = (*curMember)->next;
15134 if(subMemberStackPos && *subMemberStackPos)
15136 *curMember = subMemberStack[--(*subMemberStackPos)];
15137 *curMember = (*curMember)->next;
15141 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
15143 if(*curClass == _class)
15145 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
15147 *curMember = (*curClass)->membersAndProperties.first;
15149 while((*curMember) && (*curMember)->isProperty)
15150 *curMember = (*curMember)->next;
15151 if(subMemberStackPos)
15153 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15155 subMemberStack[(*subMemberStackPos)++] = *curMember;
15156 *curMember = (*curMember)->members.first;
15157 while(*curMember && (*curMember)->isProperty)
15158 *curMember = (*curMember)->next;
15165 static void ProcessInitializer(struct Initializer * init, struct Type * type)
15170 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
15172 if(init->exp && !init->exp->destType)
15174 FreeType(init->exp->destType);
15175 init->exp->destType = type;
15181 ProcessExpressionType(init->exp);
15182 init->isConstant = init->exp->isConstant;
15188 struct Expression * exp = init->exp;
15189 struct Instantiation * inst = exp->instance;
15190 struct MembersInit * members;
15193 init->list = MkList();
15196 for(members = (*inst->members).first; members; members = members->next)
15198 if(members->type == 0)
15200 struct MemberInit * member;
15202 for(member = (*members->dataMembers).first; member; member = member->next)
15204 ListAdd(init->list, member->initializer);
15205 member->initializer = (((void *)0));
15210 FreeExpression(exp);
15214 struct Initializer * i;
15215 struct Type * initializerType = (((void *)0));
15216 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15217 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15218 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15219 int subMemberStackPos = 0;
15221 if(type && type->kind == 12)
15222 initializerType = Dereference(type);
15223 else if(type && (type->kind == 9 || type->kind == 10))
15224 initializerType = type->members.first;
15225 for(i = (*init->list).first; i; i = i->next)
15227 if(type && type->kind == 8 && type->_class && type->_class->registered)
15229 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15232 if(!curMember->dataType)
15233 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15234 initializerType = curMember->dataType;
15237 ProcessInitializer(i, initializerType);
15238 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15239 initializerType = initializerType->next;
15241 init->isConstant = 0x0;
15243 if(type && type->kind == 12)
15244 FreeType(initializerType);
15245 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15247 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15254 extern struct Symbol * FindType(struct Context * ctx, char * name);
15256 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15258 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15264 if(spec->specifier == THISCLASS)
15269 spec->name = ReplaceThisClass(thisClass);
15270 spec->symbol = FindClass(spec->name);
15271 ProcessSpecifier(spec, declareStruct);
15278 struct Symbol * symbol = FindType(curContext, spec->name);
15281 DeclareType(symbol->type, 0x1, 0x1);
15282 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15283 DeclareStruct(spec->name, 0x0);
15288 struct Enumerator * e;
15292 for(e = (*spec->list).first; e; e = e->next)
15295 ProcessExpressionType(e->exp);
15303 if(spec->definitions)
15305 struct ClassDef * def;
15306 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15308 ProcessClass(spec->definitions, symbol);
15315 static void ProcessDeclarator(struct Declarator * decl)
15320 if(decl->identifier->classSym)
15322 FreeSpecifier(decl->identifier->_class);
15323 decl->identifier->_class = (((void *)0));
15327 if(decl->array.exp)
15328 ProcessExpressionType(decl->array.exp);
15335 if(decl->declarator)
15336 ProcessDeclarator(decl->declarator);
15337 if(decl->type == 4)
15339 struct Identifier * id = GetDeclId(decl);
15341 if(id && id->_class)
15343 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15345 if(!decl->function.parameters)
15346 decl->function.parameters = MkList();
15347 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15348 id->_class = (((void *)0));
15350 if(decl->function.parameters)
15352 struct TypeName * param;
15354 for(param = (*decl->function.parameters).first; param; param = param->next)
15356 if(param->qualifiers && (*param->qualifiers).first)
15358 struct Specifier * spec = (*param->qualifiers).first;
15360 if(spec && spec->specifier == TYPED_OBJECT)
15362 struct Declarator * d = param->declarator;
15363 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);
15365 FreeList(param->qualifiers, FreeSpecifier);
15366 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15367 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15368 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15371 else if(spec && spec->specifier == ANY_OBJECT)
15373 struct Declarator * d = param->declarator;
15375 FreeList(param->qualifiers, FreeSpecifier);
15376 param->qualifiers = MkListOne(MkSpecifier(VOID));
15377 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15379 else if(spec->specifier == THISCLASS)
15384 spec->name = ReplaceThisClass(thisClass);
15385 spec->symbol = FindClass(spec->name);
15386 ProcessSpecifier(spec, 0x0);
15390 if(param->declarator)
15391 ProcessDeclarator(param->declarator);
15399 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15401 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15403 static void ProcessDeclaration(struct Declaration * decl)
15405 yylloc = decl->loc;
15410 unsigned int declareStruct = 0x0;
15412 if(decl->declarators)
15414 struct InitDeclarator * d;
15416 for(d = (*decl->declarators).first; d; d = d->next)
15418 struct Type * type, * subType;
15420 ProcessDeclarator(d->declarator);
15421 type = ProcessType(decl->specifiers, d->declarator);
15424 ProcessInitializer(d->initializer, type);
15425 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15427 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15429 struct Instantiation * inst = d->initializer->exp->instance;
15431 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15432 d->initializer->exp->instance = (((void *)0));
15433 if(decl->specifiers)
15434 FreeList(decl->specifiers, FreeSpecifier);
15435 FreeList(decl->declarators, FreeInitDeclarator);
15442 for(subType = type; subType; )
15444 if(subType->kind == 8)
15446 declareStruct = 0x1;
15449 else if(subType->kind == 13)
15451 else if(subType->kind == 12)
15452 subType = subType->arrayType;
15461 if(decl->specifiers)
15463 struct Specifier * s;
15465 for(s = (*decl->specifiers).first; s; s = s->next)
15467 ProcessSpecifier(s, declareStruct);
15474 ProcessInstantiationType(decl->inst);
15479 struct Specifier * spec;
15480 struct Declarator * d;
15481 unsigned int declareStruct = 0x0;
15483 if(decl->declarators)
15485 for(d = (*decl->declarators).first; d; d = d->next)
15487 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15488 struct Type * subType;
15490 ProcessDeclarator(d);
15491 for(subType = type; subType; )
15493 if(subType->kind == 8)
15495 declareStruct = 0x1;
15498 else if(subType->kind == 13)
15500 else if(subType->kind == 12)
15501 subType = subType->arrayType;
15508 if(decl->specifiers)
15510 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15511 ProcessSpecifier(spec, declareStruct);
15518 static struct FunctionDefinition * curFunction;
15520 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15522 char propName[1024], propNameM[1024];
15523 char getName[1024], setName[1024];
15524 struct __ecereNameSpace__ecere__sys__OldList * args;
15526 DeclareProperty(prop, setName, getName);
15527 strcpy(propName, "__ecereProp_");
15528 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15529 strcat(propName, "_");
15530 FullClassNameCat(propName, prop->name, 0x1);
15531 MangleClassName(propName);
15532 strcpy(propNameM, "__ecerePropM_");
15533 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15534 strcat(propNameM, "_");
15535 FullClassNameCat(propNameM, prop->name, 0x1);
15536 MangleClassName(propNameM);
15537 if(prop->isWatchable)
15540 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15541 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15542 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15544 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15545 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15546 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15550 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15551 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15552 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15554 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15555 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15556 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15558 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15559 curFunction->propSet->fireWatchersDone = 0x1;
15562 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15564 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15566 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15568 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15570 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15572 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15574 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15576 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15578 static void ProcessStatement(struct Statement * stmt)
15580 yylloc = stmt->loc;
15584 ProcessStatement(stmt->labeled.stmt);
15587 if(stmt->caseStmt.exp)
15589 FreeType(stmt->caseStmt.exp->destType);
15590 stmt->caseStmt.exp->destType = curSwitchType;
15592 curSwitchType->refCount++;
15593 ProcessExpressionType(stmt->caseStmt.exp);
15594 ComputeExpression(stmt->caseStmt.exp);
15596 if(stmt->caseStmt.stmt)
15597 ProcessStatement(stmt->caseStmt.stmt);
15601 if(stmt->compound.context)
15603 struct Declaration * decl;
15604 struct Statement * s;
15605 struct Statement * prevCompound = curCompound;
15606 struct Context * prevContext = curContext;
15608 if(!stmt->compound.isSwitch)
15610 curCompound = stmt;
15611 curContext = stmt->compound.context;
15613 if(stmt->compound.declarations)
15615 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15616 ProcessDeclaration(decl);
15618 if(stmt->compound.statements)
15620 for(s = (*stmt->compound.statements).first; s; s = s->next)
15621 ProcessStatement(s);
15623 curContext = prevContext;
15624 curCompound = prevCompound;
15630 struct Expression * exp;
15632 if(stmt->expressions)
15634 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15635 ProcessExpressionType(exp);
15641 struct Expression * exp;
15643 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15644 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15645 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15646 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15648 ProcessExpressionType(exp);
15650 if(stmt->ifStmt.stmt)
15651 ProcessStatement(stmt->ifStmt.stmt);
15652 if(stmt->ifStmt.elseStmt)
15653 ProcessStatement(stmt->ifStmt.elseStmt);
15658 struct Type * oldSwitchType = curSwitchType;
15660 if(stmt->switchStmt.exp)
15662 struct Expression * exp;
15664 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15668 ProcessExpressionType(exp);
15671 curSwitchType = exp->expType;
15674 ProcessStatement(stmt->switchStmt.stmt);
15675 curSwitchType = oldSwitchType;
15680 if(stmt->whileStmt.exp)
15682 struct Expression * exp;
15684 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15685 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15686 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15687 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15689 ProcessExpressionType(exp);
15692 if(stmt->whileStmt.stmt)
15693 ProcessStatement(stmt->whileStmt.stmt);
15698 if(stmt->doWhile.exp)
15700 struct Expression * exp;
15702 if((*stmt->doWhile.exp).last)
15704 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15705 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15706 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15708 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15710 ProcessExpressionType(exp);
15713 if(stmt->doWhile.stmt)
15714 ProcessStatement(stmt->doWhile.stmt);
15719 struct Expression * exp;
15721 if(stmt->forStmt.init)
15722 ProcessStatement(stmt->forStmt.init);
15723 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15725 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15726 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15727 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15729 if(stmt->forStmt.check)
15730 ProcessStatement(stmt->forStmt.check);
15731 if(stmt->forStmt.increment)
15733 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15734 ProcessExpressionType(exp);
15736 if(stmt->forStmt.stmt)
15737 ProcessStatement(stmt->forStmt.stmt);
15742 struct Identifier * id = stmt->forEachStmt.id;
15743 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15744 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15745 struct Statement * block = stmt->forEachStmt.stmt;
15746 char iteratorType[1024];
15747 struct Type * source;
15748 struct Expression * e;
15749 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));
15750 struct Expression * arrayExp;
15751 char * typeString = (((void *)0));
15752 int builtinCount = 0;
15754 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15758 FreeType(e->destType);
15759 e->destType = ProcessTypeString("Container", 0x0);
15761 if(!isBuiltin || e->next)
15762 ProcessExpressionType(e);
15764 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15765 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15767 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15768 struct Symbol * symbol;
15769 struct Expression * expIt = (((void *)0));
15770 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15771 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15772 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15773 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15776 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15777 stmt->compound.context->parent = curContext;
15778 curContext = stmt->compound.context;
15779 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15781 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15782 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15784 isCustomAVLTree = 0x1;
15785 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15787 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15790 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15792 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15794 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15797 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15801 struct Declarator * decl;
15802 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15804 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15805 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15806 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15810 struct Type * type = (((void *)0));
15811 char typeStringBuf[1024];
15813 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15814 if(((struct Expression *)(*exp).last)->type == 11)
15816 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15819 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15821 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)
15823 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15825 typeString = templateClass->templateArgs[2].dataTypeString;
15827 else if(arrayExp->list)
15829 struct Expression * e;
15831 for(e = (*arrayExp->list).first; e; e = e->next)
15833 ProcessExpressionType(e);
15843 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15847 e->expType = (((void *)0));
15848 e = (*arrayExp->list).first;
15849 ProcessExpressionType(e);
15852 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15854 FreeType(e->expType);
15855 e->expType = (((void *)0));
15857 type = (((void *)0));
15865 FreeType(e->expType);
15866 e->expType = (((void *)0));
15872 typeStringBuf[0] = '\0';
15873 PrintType(type, typeStringBuf, 0x0, 0x1);
15874 typeString = typeStringBuf;
15880 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15881 struct Declarator * decl;
15882 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15886 struct Expression * e;
15888 builtinCount = (*arrayExp->list).count;
15889 type = ProcessTypeString(typeString, 0x0);
15890 while(e = (*arrayExp->list).first)
15892 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15893 e->destType = type;
15895 ProcessExpressionType(e);
15896 ListAdd(initializers, MkInitializerAssignment(e));
15899 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15901 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15902 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15903 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(PlugDeclarator(decl, MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), (((void *)0)))), MkInitializerList(initializers)))));
15904 FreeList(exp, FreeExpression);
15908 arrayExp->expType = ProcessTypeString("Container", 0x0);
15909 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15912 else if(isLinkList && !isList)
15914 struct Declarator * decl;
15915 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15917 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15918 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15919 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15921 else if(_class->templateArgs)
15924 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15926 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15927 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15929 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15930 if(block && block->type == 2 && block->compound.context)
15932 block->compound.context->parent = stmt->compound.context;
15936 block = MkIfStmt(filter, block, (((void *)0)));
15940 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));
15941 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15942 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15943 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15949 sprintf(count, "%d", builtinCount);
15950 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));
15951 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15952 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15953 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15955 else if(isLinkList && !isList)
15957 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15958 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15960 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15962 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));
15966 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15967 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15969 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));
15971 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15972 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15973 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15977 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15979 ProcessExpressionType(expIt);
15980 if((*stmt->compound.declarations).first)
15981 ProcessDeclaration((*stmt->compound.declarations).first);
15983 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15984 ProcessStatement(stmt);
15985 curContext = stmt->compound.context->parent;
15990 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
16002 struct Expression * exp;
16004 if(stmt->expressions)
16006 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
16010 if(curFunction && !curFunction->type)
16011 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
16012 FreeType(exp->destType);
16013 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
16015 exp->destType->refCount++;
16017 ProcessExpressionType(exp);
16024 ProcessDeclaration(stmt->decl);
16029 struct AsmField * field;
16031 if(stmt->asmStmt.inputFields)
16033 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
16034 if(field->expression)
16035 ProcessExpressionType(field->expression);
16037 if(stmt->asmStmt.outputFields)
16039 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
16040 if(field->expression)
16041 ProcessExpressionType(field->expression);
16043 if(stmt->asmStmt.clobberedFields)
16045 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
16047 if(field->expression)
16048 ProcessExpressionType(field->expression);
16055 struct PropertyWatch * propWatch;
16056 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16057 struct Expression * object = stmt->_watch.object;
16058 struct Expression * watcher = stmt->_watch.watcher;
16061 ProcessExpressionType(watcher);
16063 ProcessExpressionType(object);
16066 if(watcher || thisClass)
16068 struct External * external = curExternal;
16069 struct Context * context = curContext;
16072 stmt->expressions = MkList();
16073 curExternal = external->prev;
16074 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16076 struct ClassFunction * func;
16077 char watcherName[1024];
16078 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
16079 struct External * createdExternal;
16080 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
16082 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
16083 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
16084 if(propWatch->deleteWatch)
16085 strcat(watcherName, "_delete");
16088 struct Identifier * propID;
16090 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16092 strcat(watcherName, "_");
16093 strcat(watcherName, propID->string);
16096 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
16098 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
16099 ProcessClassFunctionBody(func, propWatch->compound);
16100 propWatch->compound = (((void *)0));
16101 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
16102 createdExternal->symbol->idCode = external->symbol->idCode;
16103 curExternal = createdExternal;
16104 ProcessFunction(createdExternal->function);
16106 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
16108 externalDecl->declaration = decl;
16109 if(decl->symbol && !decl->symbol->pointerExternal)
16110 decl->symbol->pointerExternal = externalDecl;
16112 if(propWatch->deleteWatch)
16114 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16116 ListAdd(args, CopyExpression(object));
16117 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16118 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16119 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
16123 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
16124 struct Identifier * propID;
16126 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16128 char propName[1024];
16129 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16133 char getName[1024], setName[1024];
16134 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16136 DeclareProperty(prop, setName, getName);
16137 strcpy(propName, "__ecereProp_");
16138 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16139 strcat(propName, "_");
16140 FullClassNameCat(propName, prop->name, 0x1);
16141 ListAdd(args, CopyExpression(object));
16142 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16143 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16144 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16145 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
16148 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16153 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
16155 curExternal = external;
16156 curContext = context;
16158 FreeExpression(watcher);
16160 FreeExpression(object);
16161 FreeList(watches, FreePropertyWatch);
16164 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
16168 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16170 ProcessStatement(propWatch->compound);
16177 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16178 struct Expression * object = stmt->_watch.object;
16179 struct __ecereNameSpace__ecere__com__Class * _class;
16182 ProcessExpressionType(object);
16185 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
16188 struct Identifier * propID;
16191 stmt->expressions = MkList();
16192 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16194 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
16201 for(propID = (*watches).first; propID; propID = propID->next)
16203 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16207 CreateFireWatcher(prop, object, stmt);
16210 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16215 struct __ecereNameSpace__ecere__com__Property * prop;
16216 struct __ecereNameSpace__ecere__com__Class * base;
16218 for(base = _class; base; base = base->base)
16220 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16222 if(prop->isProperty && prop->isWatchable)
16224 CreateFireWatcher(prop, object, stmt);
16230 FreeExpression(object);
16231 FreeList(watches, FreeIdentifier);
16234 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16240 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16241 struct Expression * object = stmt->_watch.object;
16242 struct Expression * watcher = stmt->_watch.watcher;
16243 struct __ecereNameSpace__ecere__com__Class * _class;
16246 ProcessExpressionType(object);
16248 ProcessExpressionType(watcher);
16251 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16252 if(watcher || thisClass)
16256 struct Identifier * propID;
16259 stmt->expressions = MkList();
16262 struct __ecereNameSpace__ecere__sys__OldList * args;
16265 ListAdd(args, CopyExpression(object));
16266 ListAdd(args, MkExpConstant("0"));
16267 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16268 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16272 for(propID = (*watches).first; propID; propID = propID->next)
16274 char propName[1024];
16275 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16279 char getName[1024], setName[1024];
16280 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16282 DeclareProperty(prop, setName, getName);
16283 strcpy(propName, "__ecereProp_");
16284 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16285 strcat(propName, "_");
16286 FullClassNameCat(propName, prop->name, 0x1);
16287 MangleClassName(propName);
16288 ListAdd(args, CopyExpression(object));
16289 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16290 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16291 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16294 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16298 FreeExpression(object);
16300 FreeExpression(watcher);
16301 FreeList(watches, FreeIdentifier);
16304 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16307 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16314 extern struct Expression * QBrackets(struct Expression * exp);
16316 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16318 extern struct Declarator * QMkPtrDecl(char * id);
16320 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16322 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16324 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16326 static void ProcessFunction(struct FunctionDefinition * function)
16328 struct Identifier * id = GetDeclId(function->declarator);
16329 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16330 struct Type * type = symbol ? symbol->type : (((void *)0));
16331 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16332 struct Context * oldTopContext = topContext;
16334 yylloc = function->loc;
16335 if(type && type->thisClass)
16337 struct Symbol * classSym = type->thisClass;
16338 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16339 char className[1024];
16340 char structName[1024];
16341 struct Declarator * funcDecl;
16342 struct Symbol * thisSymbol;
16343 unsigned int typedObject = 0x0;
16345 if(_class && !_class->base)
16347 _class = currentClass;
16348 if(_class && !_class->symbol)
16349 _class->symbol = FindClass(_class->fullName);
16350 classSym = _class ? _class->symbol : (((void *)0));
16353 thisClass = _class;
16354 if(inCompiler && _class)
16356 if(type->kind == 11)
16358 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16360 struct Type * param = symbol->type->params.first;
16362 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16365 if(type->classObjectType != 1)
16367 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16368 symbol->type->staticMethod = 0x1;
16369 symbol->type->thisClass = (((void *)0));
16370 symbol->type->extraParam = 0x0;
16373 strcpy(className, "__ecereClass_");
16374 FullClassNameCat(className, _class->fullName, 0x1);
16375 MangleClassName(className);
16376 structName[0] = (char)0;
16377 FullClassNameCat(structName, _class->fullName, 0x0);
16378 funcDecl = GetFuncDecl(function->declarator);
16381 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16383 struct TypeName * param = (*funcDecl->function.parameters).first;
16385 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16387 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16388 FreeTypeName(param);
16391 if(!function->propertyNoThis)
16393 struct TypeName * thisParam;
16395 if(type->classObjectType != 1)
16397 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16398 if(!funcDecl->function.parameters)
16399 funcDecl->function.parameters = MkList();
16400 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16404 if(type->classObjectType != 1)
16406 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16407 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16409 thisParam = __extension__ ({
16410 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
16412 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
16414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16418 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16420 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16422 funcDecl = GetFuncDecl(initDecl->declarator);
16425 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16427 struct TypeName * param = (*funcDecl->function.parameters).first;
16429 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16431 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16432 FreeTypeName(param);
16435 if(type->classObjectType != 1)
16437 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16439 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16441 if(!funcDecl->function.parameters)
16442 funcDecl->function.parameters = MkList();
16443 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16451 if(type->classObjectType != 1)
16453 thisSymbol = __extension__ ({
16454 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16456 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
16458 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16459 if(typedObject && thisSymbol->type)
16461 thisSymbol->type->classObjectType = 2;
16462 thisSymbol->type->byReference = type->byReference;
16466 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16468 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16471 struct __ecereNameSpace__ecere__com__Class * base;
16473 for(base = _class; base && base->type != 1000; base = base->next)
16475 for(member = base->membersAndProperties.first; member; member = member->next)
16476 if(!member->isProperty)
16482 for(member = _class->membersAndProperties.first; member; member = member->next)
16483 if(!member->isProperty)
16487 char pointerName[1024];
16488 struct Declaration * decl;
16489 struct Initializer * initializer;
16490 struct Expression * exp, * bytePtr;
16492 strcpy(pointerName, "__ecerePointer_");
16493 FullClassNameCat(pointerName, _class->fullName, 0x0);
16495 char className[1024];
16497 strcpy(className, "__ecereClass_");
16498 FullClassNameCat(className, classSym->string, 0x1);
16499 MangleClassName(className);
16500 DeclareClass(classSym, className);
16502 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16507 sprintf(string, "%d", _class->offset);
16508 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16512 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16514 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16515 exp->expType = __extension__ ({
16516 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16518 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
16519 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16521 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
16522 }), __ecereInstance2;
16526 yylloc = function->body->loc;
16527 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16529 struct Context * prevContext = curContext;
16531 curContext = function->body->compound.context;
16532 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16533 curContext = prevContext;
16535 decl->symbol = (((void *)0));
16536 if(!function->body->compound.declarations)
16537 function->body->compound.declarations = MkList();
16538 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16544 thisClass = (((void *)0));
16547 FreeSpecifier(id->_class);
16548 id->_class = (((void *)0));
16549 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16551 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16553 id = GetDeclId(initDecl->declarator);
16554 FreeSpecifier(id->_class);
16555 id->_class = (((void *)0));
16559 topContext = function->body->compound.context;
16561 struct FunctionDefinition * oldFunction = curFunction;
16563 curFunction = function;
16565 ProcessStatement(function->body);
16566 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16568 struct Statement * prevCompound = curCompound;
16569 struct Context * prevContext = curContext;
16570 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16572 if(!function->body->compound.statements)
16573 function->body->compound.statements = MkList();
16574 ListAdd(function->body->compound.statements, fireWatchers);
16575 curCompound = function->body;
16576 curContext = function->body->compound.context;
16577 ProcessStatement(fireWatchers);
16578 curContext = prevContext;
16579 curCompound = prevCompound;
16581 curFunction = oldFunction;
16583 if(function->declarator)
16585 ProcessDeclarator(function->declarator);
16587 topContext = oldTopContext;
16588 thisClass = oldThisClass;
16591 extern void FreeSymbol(struct Symbol * symbol);
16593 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16595 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16597 struct ClassDef * def;
16598 struct External * external = curExternal;
16599 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16601 for(def = definitions->first; def; def = def->next)
16605 if(def->function->declarator)
16606 curExternal = def->function->declarator->symbol->pointerExternal;
16608 curExternal = external;
16609 ProcessFunction((struct FunctionDefinition *)def->function);
16611 else if(def->type == 2)
16613 if(def->decl->type == 2)
16615 thisClass = regClass;
16616 ProcessInstantiationType(def->decl->inst);
16617 thisClass = (((void *)0));
16621 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16624 thisClass = regClass;
16625 ProcessDeclaration(def->decl);
16626 thisClass = backThisClass;
16629 else if(def->type == 1 && def->defProperties)
16631 struct MemberInit * defProperty;
16632 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);
16634 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16635 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16637 thisClass = regClass;
16638 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16639 thisClass = (((void *)0));
16641 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16642 FreeSymbol(thisSymbol);
16644 else if(def->type == 3 && def->propertyDef)
16646 struct PropertyDef * prop = def->propertyDef;
16648 thisClass = regClass;
16653 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16655 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16657 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16658 ProcessStatement(prop->setStmt);
16664 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16666 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16668 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16669 ProcessStatement(prop->getStmt);
16671 if(prop->issetStmt)
16675 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16677 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16679 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16680 ProcessStatement(prop->issetStmt);
16682 thisClass = (((void *)0));
16684 else if(def->type == 4 && def->propertyWatch)
16686 struct PropertyWatch * propertyWatch = def->propertyWatch;
16688 thisClass = regClass;
16689 if(propertyWatch->compound)
16691 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);
16693 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16694 curExternal = (((void *)0));
16695 ProcessStatement(propertyWatch->compound);
16697 thisClass = (((void *)0));
16702 void DeclareFunctionUtil(char * s)
16704 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16711 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16712 strcpy(name, "__ecereFunction_");
16713 FullClassNameCat(name, s, 0x0);
16714 DeclareFunction(function, name);
16718 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16720 void ComputeDataTypes()
16722 struct External * external;
16723 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16724 struct External * after = (((void *)0));
16726 currentClass = (((void *)0));
16727 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16728 for(external = (*ast).first; external; external = external->next)
16730 if(external->type == 1)
16732 struct Declaration * decl = external->declaration;
16736 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16740 struct InitDeclarator * initDecl = (*decls).first;
16744 struct Declarator * declarator = initDecl->declarator;
16746 if(declarator && declarator->type == 1)
16748 struct Identifier * id = declarator->identifier;
16750 if(id && id->string)
16752 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16754 external->symbol->id = -1001, external->symbol->idCode = -1001;
16764 temp->symbol = __extension__ ({
16765 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16767 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
16769 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16770 curExternal = temp;
16771 DeclareFunctionUtil("eSystem_New");
16772 DeclareFunctionUtil("eSystem_New0");
16773 DeclareFunctionUtil("eSystem_Renew");
16774 DeclareFunctionUtil("eSystem_Renew0");
16775 DeclareFunctionUtil("eClass_GetProperty");
16776 DeclareStruct("ecere::com::Class", 0x0);
16777 DeclareStruct("ecere::com::Instance", 0x0);
16778 DeclareStruct("ecere::com::Property", 0x0);
16779 DeclareStruct("ecere::com::DataMember", 0x0);
16780 DeclareStruct("ecere::com::Method", 0x0);
16781 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16782 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16783 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16784 for(external = (*ast).first; external; external = external->next)
16786 afterExternal = curExternal = external;
16787 if(external->type == 0)
16789 currentClass = external->function->_class;
16790 ProcessFunction(external->function);
16792 else if(external->type == 1)
16794 currentClass = (((void *)0));
16795 ProcessDeclaration(external->declaration);
16797 else if(external->type == 2)
16799 struct ClassDefinition * _class = external->_class;
16801 currentClass = external->symbol->registered;
16802 if(_class->definitions)
16804 ProcessClass(_class->definitions, _class->symbol);
16808 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16809 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16812 else if(external->type == 4)
16814 thisNameSpace = external->id->string;
16817 currentClass = (((void *)0));
16818 thisNameSpace = (((void *)0));
16819 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16820 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16823 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);
16825 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);
16827 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16829 struct __ecereNameSpace__ecere__com__Class * class;
16831 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16832 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16833 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16834 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16835 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16836 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16837 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16838 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16839 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16840 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16841 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16842 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16843 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16844 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16845 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16846 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16847 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16848 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16849 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16850 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16851 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16852 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16853 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16854 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16855 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16856 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16857 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16858 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16859 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16860 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16861 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16862 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16863 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16864 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16865 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16866 __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);
16867 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16868 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16869 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16870 __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);
16871 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16872 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16873 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16874 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16875 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16876 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16877 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16878 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16879 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16880 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16881 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16882 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16883 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16884 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16885 __ecereClass_Conversion = class;
16886 __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);
16887 __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);
16888 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16889 __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);
16890 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16891 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16892 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16893 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16894 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16895 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16896 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16897 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16898 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16899 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16900 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintTypeNoConst", "void PrintTypeNoConst(Type type, char * string, bool printName, bool fullName)", PrintTypeNoConst, module, 1);
16901 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16902 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16903 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16904 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16905 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16906 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16907 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16910 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)