2 typedef long long int64;
3 typedef unsigned long long uint64;
7 #elif defined(__TINYC__)
9 #define __builtin_va_list va_list
10 #define __builtin_va_start va_start
11 #define __builtin_va_end va_end
13 #define strcasecmp stricmp
14 #define strncasecmp strnicmp
15 #define __declspec(x) __attribute__((x))
19 typedef long long int64;
20 typedef unsigned long long uint64;
22 typedef __int64 int64;
23 typedef unsigned __int64 uint64;
26 #define __ENDIAN_PAD(x) (8 - (x))
28 #define __ENDIAN_PAD(x) 0
31 #include <sys/types.h>
33 #if defined(_W64) || (defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
39 #define arch_PointerSize sizeof(void *)
40 #define structSize_Instance (_64BIT ? 24 : 12)
41 #define structSize_Module (_64BIT ? 560 : 300)
42 #define structSize_NamedLink (_64BIT ? 32 : 16)
44 extern void * __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
46 extern void * __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
48 extern void * __ecereNameSpace__ecere__com__eSystem_Renew(void * memory, unsigned int size);
50 extern void * __ecereNameSpace__ecere__com__eSystem_Renew0(void * memory, unsigned int size);
52 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
54 struct __ecereNameSpace__ecere__sys__BTNode;
56 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BinaryTree;
58 struct __ecereNameSpace__ecere__sys__BinaryTree
60 struct __ecereNameSpace__ecere__sys__BTNode * root;
62 int (* CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
63 void (* FreeKey)(void * key);
64 } __attribute__ ((gcc_struct));
66 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
68 struct __ecereNameSpace__ecere__sys__OldList
75 } __attribute__ ((gcc_struct));
77 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
79 struct __ecereNameSpace__ecere__com__Method
82 struct __ecereNameSpace__ecere__com__Method * parent;
83 struct __ecereNameSpace__ecere__com__Method * left;
84 struct __ecereNameSpace__ecere__com__Method * right;
89 struct __ecereNameSpace__ecere__com__Class * _class;
91 char * dataTypeString;
92 struct Type * dataType;
94 } __attribute__ ((gcc_struct));
96 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
98 struct __ecereNameSpace__ecere__com__Property
100 struct __ecereNameSpace__ecere__com__Property * prev;
101 struct __ecereNameSpace__ecere__com__Property * next;
103 unsigned int isProperty;
106 struct __ecereNameSpace__ecere__com__Class * _class;
107 char * dataTypeString;
108 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
109 struct Type * dataType;
110 void (* Set)(void * , int);
111 int (* Get)(void * );
112 unsigned int (* IsSet)(void * );
116 unsigned int conversion;
117 unsigned int watcherOffset;
119 unsigned int compiled;
120 unsigned int selfWatchable;
121 unsigned int isWatchable;
122 } __attribute__ ((gcc_struct));
124 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
131 unsigned int included;
132 } __attribute__ ((gcc_struct));
134 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
138 struct CodePosition start;
139 struct CodePosition end;
140 } __attribute__ ((gcc_struct));
142 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attrib;
146 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ExtDecl;
155 struct Attrib * attr;
156 } __attribute__ ((gcc_struct));
157 } __attribute__ ((gcc_struct));
159 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDefinition;
161 struct ClassDefinition
163 struct ClassDefinition * prev;
164 struct ClassDefinition * next;
166 struct Specifier * _class;
167 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
168 struct __ecereNameSpace__ecere__sys__OldList * definitions;
169 struct Symbol * symbol;
170 struct Location blockStart;
171 struct Location nameLoc;
174 unsigned int deleteWatchable;
175 } __attribute__ ((gcc_struct));
177 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Context;
181 struct Context * parent;
182 struct __ecereNameSpace__ecere__sys__BinaryTree types;
183 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
184 struct __ecereNameSpace__ecere__sys__BinaryTree symbols;
185 struct __ecereNameSpace__ecere__sys__BinaryTree structSymbols;
188 struct __ecereNameSpace__ecere__sys__BinaryTree templateTypes;
189 struct ClassDefinition * classDef;
190 unsigned int templateTypesOnly;
191 unsigned int hasNameSpace;
192 } __attribute__ ((gcc_struct));
194 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Instantiation;
198 struct Instantiation * prev;
199 struct Instantiation * next;
201 struct Specifier * _class;
202 struct Expression * exp;
203 struct __ecereNameSpace__ecere__sys__OldList * members;
204 struct Symbol * symbol;
205 unsigned int fullSet;
206 unsigned int isConstant;
207 unsigned char * data;
208 struct Location nameLoc;
209 struct Location insideLoc;
211 } __attribute__ ((gcc_struct));
213 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declaration;
217 struct Declaration * prev;
218 struct Declaration * next;
225 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
226 struct __ecereNameSpace__ecere__sys__OldList * declarators;
227 } __attribute__ ((gcc_struct));
228 struct Instantiation * inst;
231 struct Identifier * id;
232 struct Expression * exp;
233 } __attribute__ ((gcc_struct));
234 } __attribute__ ((gcc_struct));
235 struct Specifier * extStorage;
236 struct Symbol * symbol;
238 } __attribute__ ((gcc_struct));
240 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Statement;
244 struct Statement * prev;
245 struct Statement * next;
250 struct __ecereNameSpace__ecere__sys__OldList * expressions;
253 struct Identifier * id;
254 struct Statement * stmt;
255 } __attribute__ ((gcc_struct)) labeled;
258 struct Expression * exp;
259 struct Statement * stmt;
260 } __attribute__ ((gcc_struct)) caseStmt;
263 struct __ecereNameSpace__ecere__sys__OldList * declarations;
264 struct __ecereNameSpace__ecere__sys__OldList * statements;
265 struct Context * context;
266 unsigned int isSwitch;
267 } __attribute__ ((gcc_struct)) compound;
270 struct __ecereNameSpace__ecere__sys__OldList * exp;
271 struct Statement * stmt;
272 struct Statement * elseStmt;
273 } __attribute__ ((gcc_struct)) ifStmt;
276 struct __ecereNameSpace__ecere__sys__OldList * exp;
277 struct Statement * stmt;
278 } __attribute__ ((gcc_struct)) switchStmt;
281 struct __ecereNameSpace__ecere__sys__OldList * exp;
282 struct Statement * stmt;
283 } __attribute__ ((gcc_struct)) whileStmt;
286 struct __ecereNameSpace__ecere__sys__OldList * exp;
287 struct Statement * stmt;
288 } __attribute__ ((gcc_struct)) doWhile;
291 struct Statement * init;
292 struct Statement * check;
293 struct __ecereNameSpace__ecere__sys__OldList * increment;
294 struct Statement * stmt;
295 } __attribute__ ((gcc_struct)) forStmt;
298 struct Identifier * id;
299 } __attribute__ ((gcc_struct)) gotoStmt;
302 struct Specifier * spec;
304 struct __ecereNameSpace__ecere__sys__OldList * inputFields;
305 struct __ecereNameSpace__ecere__sys__OldList * outputFields;
306 struct __ecereNameSpace__ecere__sys__OldList * clobberedFields;
307 } __attribute__ ((gcc_struct)) asmStmt;
310 struct Expression * watcher;
311 struct Expression * object;
312 struct __ecereNameSpace__ecere__sys__OldList * watches;
313 } __attribute__ ((gcc_struct)) _watch;
316 struct Identifier * id;
317 struct __ecereNameSpace__ecere__sys__OldList * exp;
318 struct __ecereNameSpace__ecere__sys__OldList * filter;
319 struct Statement * stmt;
320 } __attribute__ ((gcc_struct)) forEachStmt;
321 struct Declaration * decl;
322 } __attribute__ ((gcc_struct));
323 } __attribute__ ((gcc_struct));
325 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TypeName;
329 struct TypeName * prev;
330 struct TypeName * next;
332 struct __ecereNameSpace__ecere__sys__OldList * qualifiers;
333 struct Declarator * declarator;
335 struct Expression * bitCount;
336 } __attribute__ ((gcc_struct));
338 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Initializer;
342 struct Initializer * prev;
343 struct Initializer * next;
348 struct Expression * exp;
349 struct __ecereNameSpace__ecere__sys__OldList * list;
350 } __attribute__ ((gcc_struct));
351 unsigned int isConstant;
352 } __attribute__ ((gcc_struct));
354 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
356 struct __ecereNameSpace__ecere__com__DataValue
371 } __attribute__ ((gcc_struct));
372 } __attribute__ ((gcc_struct));
374 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
378 struct Expression * prev;
379 struct Expression * next;
387 struct Identifier * identifier;
388 } __attribute__ ((gcc_struct));
389 struct Statement * compound;
390 struct Instantiation * instance;
392 struct __ecereNameSpace__ecere__sys__OldList * list;
395 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
396 struct Declarator * decl;
397 } __attribute__ ((gcc_struct)) _classExp;
400 struct Identifier * id;
401 } __attribute__ ((gcc_struct)) classData;
404 struct Expression * exp;
405 struct __ecereNameSpace__ecere__sys__OldList * arguments;
406 struct Location argLoc;
407 } __attribute__ ((gcc_struct)) call;
410 struct Expression * exp;
411 struct __ecereNameSpace__ecere__sys__OldList * index;
412 } __attribute__ ((gcc_struct)) index;
415 struct Expression * exp;
416 struct Identifier * member;
418 unsigned int thisPtr;
419 } __attribute__ ((gcc_struct)) member;
423 struct Expression * exp1;
424 struct Expression * exp2;
425 } __attribute__ ((gcc_struct)) op;
426 struct TypeName * typeName;
427 struct Specifier * _class;
430 struct TypeName * typeName;
431 struct Expression * exp;
432 } __attribute__ ((gcc_struct)) cast;
435 struct Expression * cond;
436 struct __ecereNameSpace__ecere__sys__OldList * exp;
437 struct Expression * elseExp;
438 } __attribute__ ((gcc_struct)) cond;
441 struct TypeName * typeName;
442 struct Expression * size;
443 } __attribute__ ((gcc_struct)) _new;
446 struct TypeName * typeName;
447 struct Expression * size;
448 struct Expression * exp;
449 } __attribute__ ((gcc_struct)) _renew;
453 struct Identifier * id;
454 } __attribute__ ((gcc_struct)) db;
457 struct Expression * ds;
458 struct Expression * name;
459 } __attribute__ ((gcc_struct)) dbopen;
462 struct TypeName * typeName;
463 struct Initializer * initializer;
464 } __attribute__ ((gcc_struct)) initializer;
467 struct Expression * exp;
468 struct TypeName * typeName;
469 } __attribute__ ((gcc_struct)) vaArg;
470 } __attribute__ ((gcc_struct));
471 unsigned int debugValue;
472 struct __ecereNameSpace__ecere__com__DataValue val;
474 unsigned int hasAddress;
475 struct Type * expType;
476 struct Type * destType;
479 unsigned int byReference;
480 unsigned int isConstant;
481 unsigned int addedThis;
482 unsigned int needCast;
483 unsigned int thisPtr;
484 } __attribute__ ((gcc_struct));
486 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateDatatype;
488 struct TemplateDatatype
490 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
491 struct Declarator * decl;
492 } __attribute__ ((gcc_struct));
494 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateArgument;
496 struct TemplateArgument;
498 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplateParameter;
500 struct TemplateParameter
502 struct TemplateParameter * prev;
503 struct TemplateParameter * next;
506 struct Identifier * identifier;
509 struct TemplateDatatype * dataType;
511 } __attribute__ ((gcc_struct));
512 struct TemplateArgument * defaultArgument;
513 char * dataTypeString;
514 struct Type * baseType;
515 } __attribute__ ((gcc_struct));
517 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Specifier;
521 struct Specifier * prev;
522 struct Specifier * next;
530 struct ExtDecl * extDecl;
532 struct Symbol * symbol;
533 struct __ecereNameSpace__ecere__sys__OldList * templateArgs;
534 } __attribute__ ((gcc_struct));
537 struct Identifier * id;
538 struct __ecereNameSpace__ecere__sys__OldList * list;
539 struct __ecereNameSpace__ecere__sys__OldList * baseSpecs;
540 struct __ecereNameSpace__ecere__sys__OldList * definitions;
541 unsigned int addNameSpace;
542 struct Context * ctx;
543 struct ExtDecl * extDeclStruct;
544 } __attribute__ ((gcc_struct));
545 struct Expression * expression;
546 struct Specifier * _class;
547 struct TemplateParameter * templateParameter;
548 } __attribute__ ((gcc_struct));
549 } __attribute__ ((gcc_struct));
551 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Identifier;
555 struct Identifier * prev;
556 struct Identifier * next;
558 struct Symbol * classSym;
559 struct Specifier * _class;
561 struct Identifier * badID;
562 } __attribute__ ((gcc_struct));
564 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Pointer;
568 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Declarator;
572 struct Declarator * prev;
573 struct Declarator * next;
576 struct Symbol * symbol;
577 struct Declarator * declarator;
580 struct Identifier * identifier;
583 struct Expression * exp;
584 struct Expression * posExp;
585 struct Attrib * attrib;
586 } __attribute__ ((gcc_struct)) structDecl;
589 struct Expression * exp;
590 struct Specifier * enumClass;
591 } __attribute__ ((gcc_struct)) array;
594 struct __ecereNameSpace__ecere__sys__OldList * parameters;
595 } __attribute__ ((gcc_struct)) function;
598 struct Pointer * pointer;
599 } __attribute__ ((gcc_struct)) pointer;
602 struct ExtDecl * extended;
603 } __attribute__ ((gcc_struct)) extended;
604 } __attribute__ ((gcc_struct));
605 } __attribute__ ((gcc_struct));
607 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionDefinition;
609 struct FunctionDefinition
611 struct FunctionDefinition * prev;
612 struct FunctionDefinition * next;
614 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
615 struct Declarator * declarator;
616 struct __ecereNameSpace__ecere__sys__OldList * declarations;
617 struct Statement * body;
618 struct __ecereNameSpace__ecere__com__Class * _class;
619 struct __ecereNameSpace__ecere__sys__OldList attached;
622 struct Symbol * propSet;
624 unsigned int propertyNoThis;
625 } __attribute__ ((gcc_struct));
627 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableDef;
631 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_External;
635 struct External * prev;
636 struct External * next;
639 struct Symbol * symbol;
642 struct FunctionDefinition * function;
643 struct ClassDefinition * _class;
644 struct Declaration * declaration;
646 struct Identifier * id;
647 struct DBTableDef * table;
648 } __attribute__ ((gcc_struct));
650 } __attribute__ ((gcc_struct));
652 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ModuleImport;
656 struct ModuleImport * prev;
657 struct ModuleImport * next;
659 struct __ecereNameSpace__ecere__sys__OldList classes;
660 struct __ecereNameSpace__ecere__sys__OldList functions;
663 } __attribute__ ((gcc_struct));
665 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassImport;
669 struct ClassImport * prev;
670 struct ClassImport * next;
672 struct __ecereNameSpace__ecere__sys__OldList methods;
673 struct __ecereNameSpace__ecere__sys__OldList properties;
675 unsigned int isRemote;
676 } __attribute__ ((gcc_struct));
678 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
683 struct Symbol * parent;
684 struct Symbol * left;
685 struct Symbol * right;
690 struct __ecereNameSpace__ecere__com__Method * method;
691 struct __ecereNameSpace__ecere__com__Property * _property;
692 struct __ecereNameSpace__ecere__com__Class * registered;
693 } __attribute__ ((gcc_struct));
700 struct External * pointerExternal;
701 struct External * structExternal;
702 } __attribute__ ((gcc_struct));
705 struct External * externalGet;
706 struct External * externalSet;
707 struct External * externalPtr;
708 struct External * externalIsSet;
709 } __attribute__ ((gcc_struct));
712 struct External * methodExternal;
713 struct External * methodCodeExternal;
714 } __attribute__ ((gcc_struct));
715 } __attribute__ ((gcc_struct));
716 unsigned int imported;
717 unsigned int declaredStructSym;
718 struct __ecereNameSpace__ecere__com__Class * _class;
719 unsigned int declaredStruct;
720 unsigned int needConstructor;
721 unsigned int needDestructor;
722 char * constructorName;
725 char * destructorName;
726 struct ModuleImport * module;
727 struct ClassImport * _import;
728 struct Location nameLoc;
729 unsigned int isParam;
730 unsigned int isRemote;
731 unsigned int isStruct;
732 unsigned int fireWatchersDone;
734 unsigned int classData;
735 unsigned int isStatic;
737 struct __ecereNameSpace__ecere__sys__OldList * templateParams;
738 struct __ecereNameSpace__ecere__sys__OldList templatedClasses;
739 struct Context * ctx;
741 struct Expression * propCategory;
742 } __attribute__ ((gcc_struct));
744 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
753 struct Symbol * _class;
756 struct __ecereNameSpace__ecere__sys__OldList members;
758 } __attribute__ ((gcc_struct));
761 struct Type * returnType;
762 struct __ecereNameSpace__ecere__sys__OldList params;
763 struct Symbol * thisClass;
764 unsigned int staticMethod;
765 struct TemplateParameter * thisClassTemplate;
766 } __attribute__ ((gcc_struct));
769 struct __ecereNameSpace__ecere__com__Method * method;
770 struct __ecereNameSpace__ecere__com__Class * methodClass;
771 struct __ecereNameSpace__ecere__com__Class * usedClass;
772 } __attribute__ ((gcc_struct));
775 struct Type * arrayType;
777 struct Expression * arraySizeExp;
778 unsigned int freeExp;
779 struct Symbol * enumClass;
780 } __attribute__ ((gcc_struct));
782 struct TemplateParameter * templateParameter;
783 } __attribute__ ((gcc_struct));
784 unsigned int isSigned;
786 unsigned int constant;
793 unsigned int byReference;
794 unsigned int extraParam;
796 unsigned int directClassAccess;
797 unsigned int computing;
798 unsigned int dllExport;
800 unsigned int keepCast;
801 unsigned int passAsTemplate;
803 } __attribute__ ((gcc_struct));
805 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
807 struct __ecereNameSpace__ecere__com__Class
809 struct __ecereNameSpace__ecere__com__Class * prev;
810 struct __ecereNameSpace__ecere__com__Class * next;
816 int (* Constructor)(struct __ecereNameSpace__ecere__com__Instance *);
817 void (* Destructor)(struct __ecereNameSpace__ecere__com__Instance *);
820 struct __ecereNameSpace__ecere__com__Class * base;
821 struct __ecereNameSpace__ecere__sys__BinaryTree methods;
822 struct __ecereNameSpace__ecere__sys__BinaryTree members;
823 struct __ecereNameSpace__ecere__sys__BinaryTree prop;
824 struct __ecereNameSpace__ecere__sys__OldList membersAndProperties;
825 struct __ecereNameSpace__ecere__sys__BinaryTree classProperties;
826 struct __ecereNameSpace__ecere__sys__OldList derivatives;
830 struct __ecereNameSpace__ecere__com__Instance * module;
831 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
832 char * dataTypeString;
833 struct Type * dataType;
835 int defaultAlignment;
836 void (* Initialize)();
838 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
839 char * designerClass;
840 unsigned int noExpansion;
841 char * defaultProperty;
842 unsigned int comRedefinition;
844 unsigned int isRemote;
845 unsigned int internalDecl;
847 unsigned int computeSize;
849 int destructionWatchOffset;
851 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
852 int inheritanceAccess;
855 struct __ecereNameSpace__ecere__sys__OldList conversions;
856 struct __ecereNameSpace__ecere__sys__OldList templateParams;
857 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
858 struct __ecereNameSpace__ecere__com__Class * templateClass;
859 struct __ecereNameSpace__ecere__sys__OldList templatized;
861 } __attribute__ ((gcc_struct));
863 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
865 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
867 struct __ecereNameSpace__ecere__com__Instance
870 struct __ecereNameSpace__ecere__com__Class * _class;
872 } __attribute__ ((gcc_struct));
874 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
876 struct __ecereNameSpace__ecere__com__DataMember
878 struct __ecereNameSpace__ecere__com__DataMember * prev;
879 struct __ecereNameSpace__ecere__com__DataMember * next;
881 unsigned int isProperty;
884 struct __ecereNameSpace__ecere__com__Class * _class;
885 char * dataTypeString;
886 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
887 struct Type * dataType;
891 struct __ecereNameSpace__ecere__sys__OldList members;
892 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
895 } __attribute__ ((gcc_struct));
897 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SerialBuffer;
899 struct __ecereNameSpace__ecere__com__SerialBuffer
901 unsigned char * _buffer;
905 } __attribute__ ((gcc_struct));
907 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
909 struct __ecereNameSpace__ecere__com__ClassTemplateArgument
915 char * dataTypeString;
916 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
917 } __attribute__ ((gcc_struct));
918 struct __ecereNameSpace__ecere__com__DataValue expression;
924 struct __ecereNameSpace__ecere__com__DataMember * member;
925 struct __ecereNameSpace__ecere__com__Property * prop;
926 struct __ecereNameSpace__ecere__com__Method * method;
927 } __attribute__ ((gcc_struct));
928 } __attribute__ ((gcc_struct));
929 } __attribute__ ((gcc_struct));
930 } __attribute__ ((gcc_struct));
932 void exit(int status);
934 void * calloc(size_t nmemb, size_t size);
936 void free(void * ptr);
938 void * malloc(size_t size);
940 void * realloc(void * ptr, size_t size);
942 long int strtol(const char * nptr, char ** endptr, int base);
944 long long int strtoll(const char * nptr, char ** endptr, int base);
946 unsigned long long int strtoull(const char * nptr, char ** endptr, int base);
950 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
953 typedef union YYSTYPE
958 struct Identifier * id;
959 struct Expression * exp;
960 struct Specifier * specifier;
961 struct __ecereNameSpace__ecere__sys__OldList * list;
962 struct Enumerator * enumerator;
963 struct Declarator * declarator;
964 struct Pointer * pointer;
965 struct Initializer * initializer;
966 struct InitDeclarator * initDeclarator;
967 struct TypeName * typeName;
968 struct Declaration * declaration;
969 struct Statement * stmt;
970 struct FunctionDefinition * function;
971 struct External * external;
972 struct Context * context;
973 struct AsmField * asmField;
974 struct Attrib * attrib;
975 struct ExtDecl * extDecl;
976 struct Attribute * attribute;
977 struct Instantiation * instance;
978 struct MembersInit * membersInit;
979 struct MemberInit * memberInit;
980 struct ClassFunction * classFunction;
981 struct ClassDefinition * _class;
982 struct ClassDef * classDef;
983 struct PropertyDef * prop;
985 struct Symbol * symbol;
986 struct PropertyWatch * propertyWatch;
987 struct TemplateParameter * templateParameter;
988 struct TemplateArgument * templateArgument;
989 struct TemplateDatatype * templateDatatype;
990 struct DBTableEntry * dbtableEntry;
991 struct DBIndexItem * dbindexItem;
992 struct DBTableDef * dbtableDef;
993 } __attribute__ ((gcc_struct)) YYSTYPE;
995 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Enumerator;
999 struct Enumerator * prev;
1000 struct Enumerator * next;
1001 struct Location loc;
1002 struct Identifier * id;
1003 struct Expression * exp;
1004 } __attribute__ ((gcc_struct));
1006 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_InitDeclarator;
1008 struct InitDeclarator
1010 struct InitDeclarator * prev;
1011 struct InitDeclarator * next;
1012 struct Location loc;
1013 struct Declarator * declarator;
1014 struct Initializer * initializer;
1015 } __attribute__ ((gcc_struct));
1017 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_AsmField;
1021 struct AsmField * prev;
1022 struct AsmField * next;
1023 struct Location loc;
1025 struct Expression * expression;
1026 } __attribute__ ((gcc_struct));
1028 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Attribute;
1032 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassFunction;
1034 struct ClassFunction
1036 struct ClassFunction * prev;
1037 struct ClassFunction * next;
1038 struct Location loc;
1039 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1040 struct Declarator * declarator;
1041 struct __ecereNameSpace__ecere__sys__OldList * declarations;
1042 struct Statement * body;
1043 struct __ecereNameSpace__ecere__com__Class * _class;
1044 struct __ecereNameSpace__ecere__sys__OldList attached;
1047 struct Symbol * propSet;
1048 unsigned int isVirtual;
1049 unsigned int isConstructor;
1050 unsigned int isDestructor;
1051 unsigned int dontMangle;
1054 } __attribute__ ((gcc_struct));
1056 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MembersInit;
1060 struct MembersInit * prev;
1061 struct MembersInit * next;
1062 struct Location loc;
1066 struct __ecereNameSpace__ecere__sys__OldList * dataMembers;
1067 struct ClassFunction * function;
1068 } __attribute__ ((gcc_struct));
1069 } __attribute__ ((gcc_struct));
1071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MemberInit;
1075 struct MemberInit * prev;
1076 struct MemberInit * next;
1077 struct Location loc;
1078 struct Location realLoc;
1079 struct __ecereNameSpace__ecere__sys__OldList * identifiers;
1080 struct Initializer * initializer;
1082 unsigned int variable;
1083 unsigned int takeOutExp;
1084 } __attribute__ ((gcc_struct));
1086 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyDef;
1090 struct PropertyDef * prev;
1091 struct PropertyDef * next;
1092 struct Location loc;
1093 struct __ecereNameSpace__ecere__sys__OldList * specifiers;
1094 struct Declarator * declarator;
1095 struct Identifier * id;
1096 struct Statement * getStmt;
1097 struct Statement * setStmt;
1098 struct Statement * issetStmt;
1099 struct Symbol * symbol;
1100 unsigned int conversion;
1101 unsigned int isWatchable;
1102 struct Expression * category;
1103 } __attribute__ ((gcc_struct));
1105 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyWatch;
1107 struct PropertyWatch
1109 struct PropertyWatch * prev;
1110 struct PropertyWatch * next;
1111 struct Location loc;
1112 struct Statement * compound;
1113 struct __ecereNameSpace__ecere__sys__OldList * properties;
1114 unsigned int deleteWatch;
1115 } __attribute__ ((gcc_struct));
1117 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ClassDef;
1121 struct ClassDef * prev;
1122 struct ClassDef * next;
1123 struct Location loc;
1127 struct Declaration * decl;
1128 struct ClassFunction * function;
1129 struct __ecereNameSpace__ecere__sys__OldList * defProperties;
1130 struct PropertyDef * propertyDef;
1131 struct PropertyWatch * propertyWatch;
1133 struct Identifier * defaultProperty;
1136 struct Identifier * id;
1137 struct Initializer * initializer;
1138 } __attribute__ ((gcc_struct));
1139 } __attribute__ ((gcc_struct));
1142 } __attribute__ ((gcc_struct));
1144 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBTableEntry;
1146 struct DBTableEntry;
1148 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_DBIndexItem;
1152 extern YYSTYPE yylval;
1154 extern struct Location yylloc;
1156 extern struct __ecereNameSpace__ecere__sys__OldList * ast;
1158 extern int returnCode;
1160 extern struct Expression * parsedExpression;
1162 extern unsigned int yydebug;
1164 void SetYydebug(unsigned int b)
1169 extern unsigned int echoOn;
1171 void resetScanner();
1175 int expression_yyparse();
1177 static struct Statement * curCompound;
1179 struct External * curExternal, * afterExternal;
1181 static struct Type * curSwitchType;
1183 static struct __ecereNameSpace__ecere__com__Class * currentClass;
1185 struct __ecereNameSpace__ecere__com__Class * thisClass;
1187 void SetThisClass(struct __ecereNameSpace__ecere__com__Class * c)
1192 struct __ecereNameSpace__ecere__com__Class * GetThisClass()
1197 static char * thisNameSpace;
1199 struct __ecereNameSpace__ecere__com__Class * containerClass;
1201 unsigned int thisClassParams = 0x1;
1203 unsigned int internalValueCounter;
1205 extern void OutputExpression(struct Expression * exp, struct __ecereNameSpace__ecere__com__Instance * f);
1207 extern size_t strlen(const char * );
1209 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__TempFile;
1211 extern void * __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
1213 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek;
1215 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
1217 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
1219 void PrintExpression(struct Expression * exp, char * string)
1222 struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
1226 OutputExpression(exp, f);
1227 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))f->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(f, 0, 0);
1228 count = strlen(string);
1229 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);
1230 string[count] = '\0';
1231 (__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
1235 extern struct Type * ProcessTypeString(char * string, unsigned int staticMethod);
1237 extern struct Type * ProcessType(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * decl);
1239 struct Type * ProcessTemplateParameterType(struct TemplateParameter * param)
1241 if(param && param->type == 0 && (param->dataType || param->dataTypeString))
1243 if(!param->baseType)
1245 if(param->dataTypeString)
1246 param->baseType = ProcessTypeString(param->dataTypeString, 0x0);
1248 param->baseType = ProcessType(param->dataType->specifiers, param->dataType->decl);
1250 return param->baseType;
1252 return (((void *)0));
1255 unsigned int NeedCast(struct Type * type1, struct Type * type2)
1257 if(!type1 || !type2 || type1->keepCast || type2->keepCast)
1259 if(type1->kind == 20 && type2->kind == 4 && type2->passAsTemplate == 0x0)
1263 if(type1->kind == type2->kind)
1273 if(type1->passAsTemplate && !type2->passAsTemplate)
1275 return type1->isSigned != type2->isSigned;
1277 return type1->_class != type2->_class;
1279 return NeedCast(type1->type, type2->type);
1287 extern int strcmp(const char * , const char * );
1289 extern struct Context * curContext;
1291 extern struct Context * topContext;
1293 extern unsigned int __ecereNameSpace__ecere__com__eClass_IsDerived(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from);
1295 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);
1297 extern struct __ecereNameSpace__ecere__com__Instance * privateModule;
1299 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);
1301 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);
1303 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
1305 struct __ecereNameSpace__ecere__com__ClassProperty
1308 struct __ecereNameSpace__ecere__com__ClassProperty * parent;
1309 struct __ecereNameSpace__ecere__com__ClassProperty * left;
1310 struct __ecereNameSpace__ecere__com__ClassProperty * right;
1312 void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
1313 long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
1314 char * dataTypeString;
1315 struct Type * dataType;
1316 unsigned int constant;
1317 } __attribute__ ((gcc_struct));
1319 extern struct __ecereNameSpace__ecere__com__ClassProperty * __ecereNameSpace__ecere__com__eClass_FindClassProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name);
1321 extern struct Expression * QMkExpId(char * id);
1323 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
1325 struct __ecereNameSpace__ecere__com__ClassTemplateParameter
1327 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * prev;
1328 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * next;
1333 char * dataTypeString;
1335 } __attribute__ ((gcc_struct));
1336 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
1338 } __attribute__ ((gcc_struct));
1340 extern struct Expression * GetTemplateArgExpByName(char * paramName, struct __ecereNameSpace__ecere__com__Class * curClass, int tplType);
1342 extern struct __ecereNameSpace__ecere__sys__OldList * MkList(void);
1344 extern void FreeIdentifier(struct Identifier * id);
1346 void ProcessExpressionType(struct Expression * exp);
1348 extern struct Declarator * SpecDeclFromString(char * string, struct __ecereNameSpace__ecere__sys__OldList * specs, struct Declarator * baseDecl);
1350 extern struct __ecereNameSpace__ecere__sys__OldList * MkListOne(void * item);
1352 extern struct Expression * MkExpOp(struct Expression * exp1, int op, struct Expression * exp2);
1354 extern struct Expression * MkExpCast(struct TypeName * typeName, struct Expression * expression);
1356 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
1358 extern struct Declarator * MkDeclaratorPointer(struct Pointer * pointer, struct Declarator * declarator);
1360 extern struct Pointer * MkPointer(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Pointer * pointer);
1362 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
1364 static void ReplaceClassMembers(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class)
1366 if(exp->type == 0 && exp->identifier)
1368 struct Identifier * id = exp->identifier;
1369 struct Context * ctx;
1370 struct Symbol * symbol = (((void *)0));
1372 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
1374 for(ctx = curContext; ctx != topContext->parent && !symbol; ctx = ctx->parent)
1376 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&ctx->symbols, id->string);
1381 if(!symbol && ((!id->_class || (id->_class->name && !strcmp(id->_class->name, "property"))) || (id->classSym && __ecereNameSpace__ecere__com__eClass_IsDerived(_class, id->classSym->registered))))
1383 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
1384 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
1385 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
1386 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
1390 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
1392 if(!prop && !method)
1393 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
1394 if(!prop && !method && !member)
1396 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string);
1398 if(prop || method || member || classProp)
1401 exp->member.member = id;
1402 exp->member.memberType = 0;
1403 exp->member.exp = QMkExpId("this");
1404 exp->addedThis = 0x1;
1406 else if(_class && _class->templateParams.first)
1408 struct __ecereNameSpace__ecere__com__Class * sClass;
1410 for(sClass = _class; sClass; sClass = sClass->base)
1412 if(sClass->templateParams.first)
1414 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
1416 for(param = sClass->templateParams.first; param; param = param->next)
1418 if(param->type == 2 && !strcmp(param->name, id->string))
1420 struct Expression * argExp = GetTemplateArgExpByName(param->name, _class, 2);
1424 struct Declarator * decl;
1425 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
1427 FreeIdentifier(exp->member.member);
1428 ProcessExpressionType(argExp);
1429 decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
1430 exp->expType = ProcessType(specs, decl);
1432 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), MkExpOp((((void *)0)), '&', argExp))));
1443 extern int sprintf(char * , char * , ...);
1445 extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
1447 extern char * __ecereNameSpace__ecere__sys__CopyString(char * string);
1449 char * PrintInt(long long result)
1453 if(result > (((long long)0x7fffffffffffffffLL)))
1454 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1456 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1457 return __ecereNameSpace__ecere__sys__CopyString(temp);
1460 char * PrintUInt(uint64 result)
1464 if(result > (0xffffffff))
1465 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1466 else if(result > (((int)0x7fffffff)))
1467 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1469 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64d" : "%lld"), result);
1470 return __ecereNameSpace__ecere__sys__CopyString(temp);
1473 char * PrintInt64(long long result)
1477 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1478 return __ecereNameSpace__ecere__sys__CopyString(temp);
1481 char * PrintUInt64(uint64 result)
1485 if(result > (((long long)0x7fffffffffffffffLL)))
1486 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1488 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "%I64dLL" : "%lldLL"), result);
1489 return __ecereNameSpace__ecere__sys__CopyString(temp);
1492 char * PrintHexUInt(uint64 result)
1496 if(result > (0xffffffff))
1497 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1499 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1500 return __ecereNameSpace__ecere__sys__CopyString(temp);
1503 char * PrintHexUInt64(uint64 result)
1507 if(result > (0xffffffff))
1508 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64XLL" : "0x%llXLL"), result);
1510 sprintf(temp, ((__ecereNameSpace__ecere__com__GetRuntimePlatform() == 1) ? "0x%I64X" : "0x%llX"), result);
1511 return __ecereNameSpace__ecere__sys__CopyString(temp);
1514 char * PrintShort(short result)
1518 sprintf(temp, "%d", (unsigned short)result);
1519 return __ecereNameSpace__ecere__sys__CopyString(temp);
1522 char * PrintUShort(unsigned short result)
1526 if(result > (unsigned short)32767)
1527 sprintf(temp, "0x%X", (int)result);
1529 sprintf(temp, "%d", result);
1530 return __ecereNameSpace__ecere__sys__CopyString(temp);
1533 extern int isprint(int c);
1535 char * PrintChar(char result)
1539 if(result > (char)0 && isprint(result))
1540 sprintf(temp, "'%c'", result);
1541 else if(result < (char)0)
1542 sprintf(temp, "%d", result);
1544 sprintf(temp, "0x%X", (unsigned char)result);
1545 return __ecereNameSpace__ecere__sys__CopyString(temp);
1548 char * PrintUChar(unsigned char result)
1552 sprintf(temp, "0x%X", result);
1553 return __ecereNameSpace__ecere__sys__CopyString(temp);
1556 char * PrintFloat(float result)
1560 sprintf(temp, "%.16ff", result);
1561 return __ecereNameSpace__ecere__sys__CopyString(temp);
1564 char * PrintDouble(double result)
1568 sprintf(temp, "%.16f", result);
1569 return __ecereNameSpace__ecere__sys__CopyString(temp);
1572 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_OpTable;
1576 unsigned int (* Add)(struct Expression *, struct Operand *, struct Operand *);
1577 unsigned int (* Sub)(struct Expression *, struct Operand *, struct Operand *);
1578 unsigned int (* Mul)(struct Expression *, struct Operand *, struct Operand *);
1579 unsigned int (* Div)(struct Expression *, struct Operand *, struct Operand *);
1580 unsigned int (* Mod)(struct Expression *, struct Operand *, struct Operand *);
1581 unsigned int (* Neg)(struct Expression *, struct Operand *);
1582 unsigned int (* Inc)(struct Expression *, struct Operand *);
1583 unsigned int (* Dec)(struct Expression *, struct Operand *);
1584 unsigned int (* Asign)(struct Expression *, struct Operand *, struct Operand *);
1585 unsigned int (* AddAsign)(struct Expression *, struct Operand *, struct Operand *);
1586 unsigned int (* SubAsign)(struct Expression *, struct Operand *, struct Operand *);
1587 unsigned int (* MulAsign)(struct Expression *, struct Operand *, struct Operand *);
1588 unsigned int (* DivAsign)(struct Expression *, struct Operand *, struct Operand *);
1589 unsigned int (* ModAsign)(struct Expression *, struct Operand *, struct Operand *);
1590 unsigned int (* BitAnd)(struct Expression *, struct Operand *, struct Operand *);
1591 unsigned int (* BitOr)(struct Expression *, struct Operand *, struct Operand *);
1592 unsigned int (* BitXor)(struct Expression *, struct Operand *, struct Operand *);
1593 unsigned int (* LShift)(struct Expression *, struct Operand *, struct Operand *);
1594 unsigned int (* RShift)(struct Expression *, struct Operand *, struct Operand *);
1595 unsigned int (* BitNot)(struct Expression *, struct Operand *);
1596 unsigned int (* AndAsign)(struct Expression *, struct Operand *, struct Operand *);
1597 unsigned int (* OrAsign)(struct Expression *, struct Operand *, struct Operand *);
1598 unsigned int (* XorAsign)(struct Expression *, struct Operand *, struct Operand *);
1599 unsigned int (* LShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1600 unsigned int (* RShiftAsign)(struct Expression *, struct Operand *, struct Operand *);
1601 unsigned int (* Not)(struct Expression *, struct Operand *);
1602 unsigned int (* Equ)(struct Expression *, struct Operand *, struct Operand *);
1603 unsigned int (* Nqu)(struct Expression *, struct Operand *, struct Operand *);
1604 unsigned int (* And)(struct Expression *, struct Operand *, struct Operand *);
1605 unsigned int (* Or)(struct Expression *, struct Operand *, struct Operand *);
1606 unsigned int (* Grt)(struct Expression *, struct Operand *, struct Operand *);
1607 unsigned int (* Sma)(struct Expression *, struct Operand *, struct Operand *);
1608 unsigned int (* GrtEqu)(struct Expression *, struct Operand *, struct Operand *);
1609 unsigned int (* SmaEqu)(struct Expression *, struct Operand *, struct Operand *);
1610 unsigned int (* Cond)(struct Expression *, struct Operand *, struct Operand *, struct Operand *);
1611 } __attribute__ ((gcc_struct));
1613 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Operand;
1619 unsigned int ptrSize;
1632 } __attribute__ ((gcc_struct));
1634 } __attribute__ ((gcc_struct));
1636 struct Operand GetOperand(struct Expression * exp);
1638 unsigned int GetInt(struct Expression * exp, int * value2)
1640 struct Operand op2 = GetOperand(exp);
1642 if(op2.kind == 3 && op2.type->isSigned)
1644 else if(op2.kind == 3)
1645 *value2 = (int)op2.ui;
1646 else if(op2.kind == 4 && op2.type->isSigned)
1647 *value2 = (int)op2.i64;
1648 else if(op2.kind == 4)
1649 *value2 = (int)op2.ui64;
1650 else if(op2.kind == 23 && op2.type->isSigned)
1651 *value2 = (int)op2.i64;
1652 else if(op2.kind == 23)
1653 *value2 = (int)op2.ui64;
1654 else if(op2.kind == 22 && op2.type->isSigned)
1655 *value2 = (int)op2.i64;
1656 else if(op2.kind == 22)
1657 *value2 = (int)op2.ui64;
1658 else if(op2.kind == 2 && op2.type->isSigned)
1659 *value2 = (int)op2.s;
1660 else if(op2.kind == 2)
1661 *value2 = (int)op2.us;
1662 else if(op2.kind == 1 && op2.type->isSigned)
1663 *value2 = (int)op2.c;
1664 else if(op2.kind == 1)
1665 *value2 = (int)op2.uc;
1666 else if(op2.kind == 6)
1667 *value2 = (int)op2.f;
1668 else if(op2.kind == 7)
1669 *value2 = (int)op2.d;
1670 else if(op2.kind == 13)
1671 *value2 = (int)op2.ui64;
1677 unsigned int GetUInt(struct Expression * exp, unsigned int * value2)
1679 struct Operand op2 = GetOperand(exp);
1681 if(op2.kind == 3 && op2.type->isSigned)
1682 *value2 = (unsigned int)op2.i;
1683 else if(op2.kind == 3)
1685 else if(op2.kind == 4 && op2.type->isSigned)
1686 *value2 = (unsigned int)op2.i64;
1687 else if(op2.kind == 4)
1688 *value2 = (unsigned int)op2.ui64;
1689 else if(op2.kind == 23 && op2.type->isSigned)
1690 *value2 = (unsigned int)op2.i64;
1691 else if(op2.kind == 23)
1692 *value2 = (unsigned int)op2.ui64;
1693 else if(op2.kind == 22 && op2.type->isSigned)
1694 *value2 = (unsigned int)op2.i64;
1695 else if(op2.kind == 22)
1696 *value2 = (unsigned int)op2.ui64;
1697 else if(op2.kind == 2 && op2.type->isSigned)
1698 *value2 = (unsigned int)op2.s;
1699 else if(op2.kind == 2)
1700 *value2 = (unsigned int)op2.us;
1701 else if(op2.kind == 1 && op2.type->isSigned)
1702 *value2 = (unsigned int)op2.c;
1703 else if(op2.kind == 1)
1704 *value2 = (unsigned int)op2.uc;
1705 else if(op2.kind == 6)
1706 *value2 = (unsigned int)op2.f;
1707 else if(op2.kind == 7)
1708 *value2 = (unsigned int)op2.d;
1709 else if(op2.kind == 13)
1710 *value2 = (unsigned int)op2.ui64;
1716 unsigned int GetInt64(struct Expression * exp, long long * value2)
1718 struct Operand op2 = GetOperand(exp);
1720 if(op2.kind == 3 && op2.type->isSigned)
1721 *value2 = (long long)op2.i;
1722 else if(op2.kind == 3)
1723 *value2 = (long long)op2.ui;
1724 else if(op2.kind == 4 && op2.type->isSigned)
1726 else if(op2.kind == 4)
1727 *value2 = (long long)op2.ui64;
1728 else if(op2.kind == 23 && op2.type->isSigned)
1730 else if(op2.kind == 23)
1731 *value2 = (long long)op2.ui64;
1732 else if(op2.kind == 22 && op2.type->isSigned)
1734 else if(op2.kind == 22)
1735 *value2 = (long long)op2.ui64;
1736 else if(op2.kind == 2 && op2.type->isSigned)
1737 *value2 = (long long)op2.s;
1738 else if(op2.kind == 2)
1739 *value2 = (long long)op2.us;
1740 else if(op2.kind == 1 && op2.type->isSigned)
1741 *value2 = (long long)op2.c;
1742 else if(op2.kind == 1)
1743 *value2 = (long long)op2.uc;
1744 else if(op2.kind == 6)
1745 *value2 = (long long)op2.f;
1746 else if(op2.kind == 7)
1747 *value2 = (long long)op2.d;
1748 else if(op2.kind == 13)
1749 *value2 = (long long)op2.ui64;
1755 unsigned int GetUInt64(struct Expression * exp, uint64 * value2)
1757 struct Operand op2 = GetOperand(exp);
1759 if(op2.kind == 3 && op2.type->isSigned)
1760 *value2 = (uint64)op2.i;
1761 else if(op2.kind == 3)
1762 *value2 = (uint64)op2.ui;
1763 else if(op2.kind == 4 && op2.type->isSigned)
1764 *value2 = (uint64)op2.i64;
1765 else if(op2.kind == 4)
1767 else if(op2.kind == 23 && op2.type->isSigned)
1768 *value2 = (uint64)op2.i64;
1769 else if(op2.kind == 23)
1771 else if(op2.kind == 22 && op2.type->isSigned)
1772 *value2 = (uint64)op2.i64;
1773 else if(op2.kind == 22)
1775 else if(op2.kind == 2 && op2.type->isSigned)
1776 *value2 = (uint64)op2.s;
1777 else if(op2.kind == 2)
1778 *value2 = (uint64)op2.us;
1779 else if(op2.kind == 1 && op2.type->isSigned)
1780 *value2 = (uint64)op2.c;
1781 else if(op2.kind == 1)
1782 *value2 = (uint64)op2.uc;
1783 else if(op2.kind == 6)
1784 *value2 = (uint64)op2.f;
1785 else if(op2.kind == 7)
1786 *value2 = (uint64)op2.d;
1787 else if(op2.kind == 13)
1794 unsigned int GetIntPtr(struct Expression * exp, intptr_t * value2)
1796 struct Operand op2 = GetOperand(exp);
1798 if(op2.kind == 3 && op2.type->isSigned)
1799 *value2 = (intptr_t)op2.i;
1800 else if(op2.kind == 3)
1801 *value2 = (intptr_t)op2.ui;
1802 else if(op2.kind == 4 && op2.type->isSigned)
1803 *value2 = (intptr_t)op2.i64;
1804 else if(op2.kind == 4)
1805 *value2 = (intptr_t)op2.ui64;
1806 else if(op2.kind == 23 && op2.type->isSigned)
1807 *value2 = (intptr_t)op2.i64;
1808 else if(op2.kind == 23)
1809 *value2 = (intptr_t)op2.ui64;
1810 else if(op2.kind == 22 && op2.type->isSigned)
1811 *value2 = (intptr_t)op2.i64;
1812 else if(op2.kind == 22)
1813 *value2 = (intptr_t)op2.ui64;
1814 else if(op2.kind == 2 && op2.type->isSigned)
1815 *value2 = (intptr_t)op2.s;
1816 else if(op2.kind == 2)
1817 *value2 = (intptr_t)op2.us;
1818 else if(op2.kind == 1 && op2.type->isSigned)
1819 *value2 = (intptr_t)op2.c;
1820 else if(op2.kind == 1)
1821 *value2 = (intptr_t)op2.uc;
1822 else if(op2.kind == 6)
1823 *value2 = (intptr_t)op2.f;
1824 else if(op2.kind == 7)
1825 *value2 = (intptr_t)op2.d;
1826 else if(op2.kind == 13)
1827 *value2 = (intptr_t)op2.ui64;
1833 unsigned int GetUIntPtr(struct Expression * exp, uintptr_t * value2)
1835 struct Operand op2 = GetOperand(exp);
1837 if(op2.kind == 3 && op2.type->isSigned)
1838 *value2 = (uintptr_t)op2.i;
1839 else if(op2.kind == 3)
1840 *value2 = (uintptr_t)op2.ui;
1841 else if(op2.kind == 4 && op2.type->isSigned)
1842 *value2 = (uintptr_t)op2.i64;
1843 else if(op2.kind == 4)
1844 *value2 = (uintptr_t)op2.ui64;
1845 else if(op2.kind == 23 && op2.type->isSigned)
1846 *value2 = (uintptr_t)op2.i64;
1847 else if(op2.kind == 23)
1848 *value2 = (uintptr_t)op2.ui64;
1849 else if(op2.kind == 22 && op2.type->isSigned)
1850 *value2 = (uintptr_t)op2.i64;
1851 else if(op2.kind == 22)
1852 *value2 = (uintptr_t)op2.ui64;
1853 else if(op2.kind == 2 && op2.type->isSigned)
1854 *value2 = (uintptr_t)op2.s;
1855 else if(op2.kind == 2)
1856 *value2 = (uintptr_t)op2.us;
1857 else if(op2.kind == 1 && op2.type->isSigned)
1858 *value2 = (uintptr_t)op2.c;
1859 else if(op2.kind == 1)
1860 *value2 = (uintptr_t)op2.uc;
1861 else if(op2.kind == 6)
1862 *value2 = (uintptr_t)op2.f;
1863 else if(op2.kind == 7)
1864 *value2 = (uintptr_t)op2.d;
1865 else if(op2.kind == 13)
1866 *value2 = (uintptr_t)op2.ui64;
1872 unsigned int GetIntSize(struct Expression * exp, ssize_t * value2)
1874 struct Operand op2 = GetOperand(exp);
1876 if(op2.kind == 3 && op2.type->isSigned)
1877 *value2 = (ssize_t)op2.i;
1878 else if(op2.kind == 3)
1879 *value2 = (ssize_t)op2.ui;
1880 else if(op2.kind == 4 && op2.type->isSigned)
1881 *value2 = (ssize_t)op2.i64;
1882 else if(op2.kind == 4)
1883 *value2 = (ssize_t)op2.ui64;
1884 else if(op2.kind == 23 && op2.type->isSigned)
1885 *value2 = (ssize_t)op2.i64;
1886 else if(op2.kind == 23)
1887 *value2 = (ssize_t)op2.ui64;
1888 else if(op2.kind == 22 && op2.type->isSigned)
1889 *value2 = (ssize_t)op2.i64;
1890 else if(op2.kind == 22)
1891 *value2 = (ssize_t)op2.ui64;
1892 else if(op2.kind == 2 && op2.type->isSigned)
1893 *value2 = (ssize_t)op2.s;
1894 else if(op2.kind == 2)
1895 *value2 = (ssize_t)op2.us;
1896 else if(op2.kind == 1 && op2.type->isSigned)
1897 *value2 = (ssize_t)op2.c;
1898 else if(op2.kind == 1)
1899 *value2 = (ssize_t)op2.uc;
1900 else if(op2.kind == 6)
1901 *value2 = (ssize_t)op2.f;
1902 else if(op2.kind == 7)
1903 *value2 = (ssize_t)op2.d;
1904 else if(op2.kind == 13)
1905 *value2 = (ssize_t)op2.ui64;
1911 unsigned int GetUIntSize(struct Expression * exp, size_t * value2)
1913 struct Operand op2 = GetOperand(exp);
1915 if(op2.kind == 3 && op2.type->isSigned)
1916 *value2 = (size_t)op2.i;
1917 else if(op2.kind == 3)
1918 *value2 = (size_t)op2.ui;
1919 else if(op2.kind == 4 && op2.type->isSigned)
1920 *value2 = (size_t)op2.i64;
1921 else if(op2.kind == 4)
1922 *value2 = (size_t)op2.ui64;
1923 else if(op2.kind == 23 && op2.type->isSigned)
1924 *value2 = (size_t)op2.i64;
1925 else if(op2.kind == 23)
1926 *value2 = (size_t)op2.ui64;
1927 else if(op2.kind == 22 && op2.type->isSigned)
1928 *value2 = (size_t)op2.i64;
1929 else if(op2.kind == 22)
1930 *value2 = (size_t)op2.ui64;
1931 else if(op2.kind == 2 && op2.type->isSigned)
1932 *value2 = (size_t)op2.s;
1933 else if(op2.kind == 2)
1934 *value2 = (size_t)op2.us;
1935 else if(op2.kind == 1 && op2.type->isSigned)
1936 *value2 = (size_t)op2.c;
1937 else if(op2.kind == 1)
1938 *value2 = (size_t)op2.uc;
1939 else if(op2.kind == 6)
1940 *value2 = (size_t)op2.f;
1941 else if(op2.kind == 7)
1942 *value2 = (size_t)op2.d;
1943 else if(op2.kind == 13)
1944 *value2 = (size_t)op2.ui64;
1950 unsigned int GetShort(struct Expression * exp, short * value2)
1952 struct Operand op2 = GetOperand(exp);
1954 if(op2.kind == 3 && op2.type->isSigned)
1955 *value2 = (short)op2.i;
1956 else if(op2.kind == 3)
1957 *value2 = (short)op2.ui;
1958 else if(op2.kind == 4 && op2.type->isSigned)
1959 *value2 = (short)op2.i64;
1960 else if(op2.kind == 4)
1961 *value2 = (short)op2.ui64;
1962 else if(op2.kind == 23 && op2.type->isSigned)
1963 *value2 = (short)op2.i64;
1964 else if(op2.kind == 23)
1965 *value2 = (short)op2.ui64;
1966 else if(op2.kind == 22 && op2.type->isSigned)
1967 *value2 = (short)op2.i64;
1968 else if(op2.kind == 22)
1969 *value2 = (short)op2.ui64;
1970 else if(op2.kind == 2 && op2.type->isSigned)
1972 else if(op2.kind == 2)
1973 *value2 = (short)op2.us;
1974 else if(op2.kind == 1 && op2.type->isSigned)
1975 *value2 = (short)op2.c;
1976 else if(op2.kind == 1)
1977 *value2 = (short)op2.uc;
1978 else if(op2.kind == 6)
1979 *value2 = (short)op2.f;
1980 else if(op2.kind == 7)
1981 *value2 = (short)op2.d;
1982 else if(op2.kind == 13)
1983 *value2 = (short)op2.ui64;
1989 unsigned int GetUShort(struct Expression * exp, unsigned short * value2)
1991 struct Operand op2 = GetOperand(exp);
1993 if(op2.kind == 3 && op2.type->isSigned)
1994 *value2 = (unsigned short)op2.i;
1995 else if(op2.kind == 3)
1996 *value2 = (unsigned short)op2.ui;
1997 else if(op2.kind == 4 && op2.type->isSigned)
1998 *value2 = (unsigned short)op2.i64;
1999 else if(op2.kind == 4)
2000 *value2 = (unsigned short)op2.ui64;
2001 else if(op2.kind == 23 && op2.type->isSigned)
2002 *value2 = (unsigned short)op2.i64;
2003 else if(op2.kind == 23)
2004 *value2 = (unsigned short)op2.ui64;
2005 else if(op2.kind == 22 && op2.type->isSigned)
2006 *value2 = (unsigned short)op2.i64;
2007 else if(op2.kind == 22)
2008 *value2 = (unsigned short)op2.ui64;
2009 else if(op2.kind == 2 && op2.type->isSigned)
2010 *value2 = (unsigned short)op2.s;
2011 else if(op2.kind == 2)
2013 else if(op2.kind == 1 && op2.type->isSigned)
2014 *value2 = (unsigned short)op2.c;
2015 else if(op2.kind == 1)
2016 *value2 = (unsigned short)op2.uc;
2017 else if(op2.kind == 6)
2018 *value2 = (unsigned short)op2.f;
2019 else if(op2.kind == 7)
2020 *value2 = (unsigned short)op2.d;
2021 else if(op2.kind == 13)
2022 *value2 = (unsigned short)op2.ui64;
2028 unsigned int GetChar(struct Expression * exp, char * value2)
2030 struct Operand op2 = GetOperand(exp);
2032 if(op2.kind == 3 && op2.type->isSigned)
2033 *value2 = (char)op2.i;
2034 else if(op2.kind == 3)
2035 *value2 = (char)op2.ui;
2036 else if(op2.kind == 4 && op2.type->isSigned)
2037 *value2 = (char)op2.i64;
2038 else if(op2.kind == 4)
2039 *value2 = (char)op2.ui64;
2040 else if(op2.kind == 23 && op2.type->isSigned)
2041 *value2 = (char)op2.i64;
2042 else if(op2.kind == 23)
2043 *value2 = (char)op2.ui64;
2044 else if(op2.kind == 22 && op2.type->isSigned)
2045 *value2 = (char)op2.i64;
2046 else if(op2.kind == 22)
2047 *value2 = (char)op2.ui64;
2048 else if(op2.kind == 2 && op2.type->isSigned)
2049 *value2 = (char)op2.s;
2050 else if(op2.kind == 2)
2051 *value2 = (char)op2.us;
2052 else if(op2.kind == 1 && op2.type->isSigned)
2054 else if(op2.kind == 1)
2055 *value2 = (char)op2.uc;
2056 else if(op2.kind == 6)
2057 *value2 = (char)op2.f;
2058 else if(op2.kind == 7)
2059 *value2 = (char)op2.d;
2060 else if(op2.kind == 13)
2061 *value2 = (char)op2.ui64;
2067 unsigned int GetUChar(struct Expression * exp, unsigned char * value2)
2069 struct Operand op2 = GetOperand(exp);
2071 if(op2.kind == 3 && op2.type->isSigned)
2072 *value2 = (unsigned char)op2.i;
2073 else if(op2.kind == 3)
2074 *value2 = (unsigned char)op2.ui;
2075 else if(op2.kind == 4 && op2.type->isSigned)
2076 *value2 = (unsigned char)op2.i64;
2077 else if(op2.kind == 4)
2078 *value2 = (unsigned char)op2.ui64;
2079 else if(op2.kind == 23 && op2.type->isSigned)
2080 *value2 = (unsigned char)op2.i64;
2081 else if(op2.kind == 23)
2082 *value2 = (unsigned char)op2.ui64;
2083 else if(op2.kind == 22 && op2.type->isSigned)
2084 *value2 = (unsigned char)op2.i64;
2085 else if(op2.kind == 22)
2086 *value2 = (unsigned char)op2.ui64;
2087 else if(op2.kind == 2 && op2.type->isSigned)
2088 *value2 = (unsigned char)op2.s;
2089 else if(op2.kind == 2)
2090 *value2 = (unsigned char)op2.us;
2091 else if(op2.kind == 1 && op2.type->isSigned)
2092 *value2 = (unsigned char)op2.c;
2093 else if(op2.kind == 1)
2095 else if(op2.kind == 6)
2096 *value2 = (unsigned char)op2.f;
2097 else if(op2.kind == 7)
2098 *value2 = (unsigned char)op2.d;
2099 else if(op2.kind == 13)
2100 *value2 = (unsigned char)op2.ui64;
2106 unsigned int GetFloat(struct Expression * exp, float * value2)
2108 struct Operand op2 = GetOperand(exp);
2110 if(op2.kind == 3 && op2.type->isSigned)
2111 *value2 = (float)(float)op2.i;
2112 else if(op2.kind == 3)
2113 *value2 = (float)(float)op2.ui;
2114 else if(op2.kind == 4 && op2.type->isSigned)
2115 *value2 = (float)(float)op2.i64;
2116 else if(op2.kind == 4)
2117 *value2 = (float)(float)op2.ui64;
2118 else if(op2.kind == 23 && op2.type->isSigned)
2119 *value2 = (float)(float)op2.i64;
2120 else if(op2.kind == 23)
2121 *value2 = (float)(float)op2.ui64;
2122 else if(op2.kind == 22 && op2.type->isSigned)
2123 *value2 = (float)(float)op2.i64;
2124 else if(op2.kind == 22)
2125 *value2 = (float)(float)op2.ui64;
2126 else if(op2.kind == 2 && op2.type->isSigned)
2127 *value2 = (float)(float)op2.s;
2128 else if(op2.kind == 2)
2129 *value2 = (float)(float)op2.us;
2130 else if(op2.kind == 1 && op2.type->isSigned)
2131 *value2 = (float)(float)op2.c;
2132 else if(op2.kind == 1)
2133 *value2 = (float)(float)op2.uc;
2134 else if(op2.kind == 6)
2135 *value2 = (float)op2.f;
2136 else if(op2.kind == 7)
2137 *value2 = (float)op2.d;
2138 else if(op2.kind == 13)
2139 *value2 = (float)(float)op2.ui64;
2145 unsigned int GetDouble(struct Expression * exp, double * value2)
2147 struct Operand op2 = GetOperand(exp);
2149 if(op2.kind == 3 && op2.type->isSigned)
2150 *value2 = (double)(double)op2.i;
2151 else if(op2.kind == 3)
2152 *value2 = (double)(double)op2.ui;
2153 else if(op2.kind == 4 && op2.type->isSigned)
2154 *value2 = (double)(double)op2.i64;
2155 else if(op2.kind == 4)
2156 *value2 = (double)(double)op2.ui64;
2157 else if(op2.kind == 23 && op2.type->isSigned)
2158 *value2 = (double)(double)op2.i64;
2159 else if(op2.kind == 23)
2160 *value2 = (double)(double)op2.ui64;
2161 else if(op2.kind == 22 && op2.type->isSigned)
2162 *value2 = (double)(double)op2.i64;
2163 else if(op2.kind == 22)
2164 *value2 = (double)(double)op2.ui64;
2165 else if(op2.kind == 2 && op2.type->isSigned)
2166 *value2 = (double)(double)op2.s;
2167 else if(op2.kind == 2)
2168 *value2 = (double)(double)op2.us;
2169 else if(op2.kind == 1 && op2.type->isSigned)
2170 *value2 = (double)(double)op2.c;
2171 else if(op2.kind == 1)
2172 *value2 = (double)(double)op2.uc;
2173 else if(op2.kind == 6)
2174 *value2 = (double)op2.f;
2175 else if(op2.kind == 7)
2176 *value2 = (double)op2.d;
2177 else if(op2.kind == 13)
2178 *value2 = (double)(double)op2.ui64;
2184 void ComputeExpression(struct Expression * exp);
2186 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class);
2188 extern int targetBits;
2190 int ComputeTypeSize(struct Type * type);
2192 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
2194 struct __ecereNameSpace__ecere__com__BitMember
2196 struct __ecereNameSpace__ecere__com__BitMember * prev;
2197 struct __ecereNameSpace__ecere__com__BitMember * next;
2199 unsigned int isProperty;
2202 struct __ecereNameSpace__ecere__com__Class * _class;
2203 char * dataTypeString;
2204 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
2205 struct Type * dataType;
2210 } __attribute__ ((gcc_struct));
2212 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldLink;
2214 struct __ecereNameSpace__ecere__sys__OldLink
2216 struct __ecereNameSpace__ecere__sys__OldLink * prev;
2217 struct __ecereNameSpace__ecere__sys__OldLink * next;
2219 } __attribute__ ((gcc_struct));
2221 void FinishTemplatesContext(struct Context * context);
2223 void ComputeClassMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2225 struct __ecereNameSpace__ecere__com__DataMember * member = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2226 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2228 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))
2231 int unionMemberOffset = 0;
2236 member->memberOffset = 0;
2237 if(targetBits < sizeof(void *) * 8)
2238 member->structAlignment = 0;
2240 else if(targetBits < sizeof(void *) * 8)
2241 _class->structAlignment = 0;
2242 if(!member && ((_class->type == 0 || _class->type == 5) || (_class->type == 1 && _class->memberOffset && _class->memberOffset > _class->base->structSize)))
2243 _class->memberOffset = (_class->base && _class->type == 1) ? _class->base->structSize : 0;
2244 if(!member && _class->destructionWatchOffset)
2245 _class->memberOffset += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2247 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2249 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2251 if(!dataMember->isProperty)
2253 if(dataMember->type == 0 && dataMember->dataTypeString && !dataMember->dataType)
2255 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
2261 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
2263 for(dataMember = member ? member->members.first : _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
2265 if(!dataMember->isProperty && (dataMember->type != 0 || dataMember->dataTypeString))
2267 if(!isMember && _class->type == 2 && dataMember->dataType)
2269 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
2273 ComputeTypeSize(dataMember->dataType);
2274 if(bitMember->pos == -1)
2275 bitMember->pos = _class->memberOffset;
2276 if(!bitMember->size)
2277 bitMember->size = dataMember->dataType->size * 8;
2278 _class->memberOffset = bitMember->pos + bitMember->size;
2279 for(d = 0; d < bitMember->size; d++)
2285 bitMember->mask = mask << bitMember->pos;
2287 else if(dataMember->type == 0 && dataMember->dataType)
2292 if(dataMember->dataType->kind != 8 || ((!dataMember->dataType->_class || !dataMember->dataType->_class->registered || dataMember->dataType->_class->registered != _class || _class->type != 1)))
2293 ComputeTypeSize(dataMember->dataType);
2294 if(dataMember->dataType->bitFieldCount)
2296 bitFields += dataMember->dataType->bitFieldCount;
2303 int size = (bitFields + 7) / 8;
2307 int __simpleStruct0;
2311 int __simpleStruct0;
2313 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2314 if(member->memberOffset % alignment)
2315 member->memberOffset += alignment - (member->memberOffset % alignment);
2317 dataMember->offset = member->memberOffset;
2318 if(member->type == 1)
2319 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2322 member->memberOffset += size;
2329 int __simpleStruct0;
2331 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2332 if(_class->memberOffset % alignment)
2333 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2335 dataMember->offset = _class->memberOffset;
2336 _class->memberOffset += size;
2340 size = dataMember->dataType->size;
2341 alignment = dataMember->dataType->alignment;
2345 int __simpleStruct0;
2349 int __simpleStruct0;
2351 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2352 if(member->memberOffset % alignment)
2353 member->memberOffset += alignment - (member->memberOffset % alignment);
2355 dataMember->offset = member->memberOffset;
2356 if(member->type == 1)
2357 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2360 member->memberOffset += size;
2367 int __simpleStruct0;
2369 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2370 if(_class->memberOffset % alignment)
2371 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2373 dataMember->offset = _class->memberOffset;
2374 _class->memberOffset += size;
2381 ComputeClassMembers((struct __ecereNameSpace__ecere__com__Class *)dataMember, 0x1);
2382 alignment = dataMember->structAlignment;
2385 int __simpleStruct0;
2389 int __simpleStruct0;
2391 if(member->memberOffset % alignment)
2392 member->memberOffset += alignment - (member->memberOffset % alignment);
2393 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2395 dataMember->offset = member->memberOffset;
2396 if(member->type == 1)
2397 unionMemberOffset = (__simpleStruct0 = dataMember->memberOffset, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2399 member->memberOffset += dataMember->memberOffset;
2405 int __simpleStruct0;
2407 if(_class->memberOffset % alignment)
2408 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2409 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2411 dataMember->offset = _class->memberOffset;
2412 _class->memberOffset += dataMember->memberOffset;
2420 int size = (bitFields + 7) / 8;
2424 int __simpleStruct0;
2428 int __simpleStruct0;
2430 member->structAlignment = (__simpleStruct0 = member->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2431 if(member->memberOffset % alignment)
2432 member->memberOffset += alignment - (member->memberOffset % alignment);
2434 if(member->type == 1)
2435 unionMemberOffset = (__simpleStruct0 = dataMember->dataType->size, (unionMemberOffset > __simpleStruct0) ? unionMemberOffset : __simpleStruct0);
2438 member->memberOffset += size;
2445 int __simpleStruct0;
2447 _class->structAlignment = (__simpleStruct0 = _class->structAlignment, (__simpleStruct0 > alignment) ? __simpleStruct0 : alignment);
2448 if(_class->memberOffset % alignment)
2449 _class->memberOffset += alignment - (_class->memberOffset % alignment);
2451 _class->memberOffset += size;
2456 if(member && member->type == 1)
2458 member->memberOffset = unionMemberOffset;
2462 if(_class->type != 2)
2466 if(_class->structAlignment)
2468 if(_class->memberOffset % _class->structAlignment)
2469 extra += _class->structAlignment - (_class->memberOffset % _class->structAlignment);
2471 _class->structSize = (_class->base ? (_class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize) : 0) + _class->memberOffset + extra;
2474 struct __ecereNameSpace__ecere__com__Property * prop;
2476 for(prop = _class->membersAndProperties.first; prop; prop = prop->next)
2478 if(prop->isProperty && prop->isWatchable)
2480 prop->watcherOffset = _class->structSize;
2481 _class->structSize += sizeof(struct __ecereNameSpace__ecere__sys__OldList);
2486 struct __ecereNameSpace__ecere__sys__OldLink * derivative;
2488 for(derivative = _class->derivatives.first; derivative; derivative = derivative->next)
2490 struct __ecereNameSpace__ecere__com__Class * deriv = derivative->data;
2492 if(deriv->computeSize)
2494 deriv->offset = _class->structSize;
2495 deriv->memberOffset = 0;
2496 deriv->structSize = deriv->offset;
2497 ComputeClassMembers(deriv, 0x0);
2505 FinishTemplatesContext(context);
2508 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
2510 struct __ecereNameSpace__ecere__com__NameSpace
2513 struct __ecereNameSpace__ecere__com__NameSpace * btParent;
2514 struct __ecereNameSpace__ecere__com__NameSpace * left;
2515 struct __ecereNameSpace__ecere__com__NameSpace * right;
2517 struct __ecereNameSpace__ecere__com__NameSpace * parent;
2518 struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
2519 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
2520 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
2521 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
2522 } __attribute__ ((gcc_struct));
2524 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
2526 struct __ecereNameSpace__ecere__com__Module
2528 struct __ecereNameSpace__ecere__com__Instance * application;
2529 struct __ecereNameSpace__ecere__sys__OldList classes;
2530 struct __ecereNameSpace__ecere__sys__OldList defines;
2531 struct __ecereNameSpace__ecere__sys__OldList functions;
2532 struct __ecereNameSpace__ecere__sys__OldList modules;
2533 struct __ecereNameSpace__ecere__com__Instance * prev;
2534 struct __ecereNameSpace__ecere__com__Instance * next;
2540 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
2541 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
2542 } __attribute__ ((gcc_struct));
2544 void ComputeModuleClasses(struct __ecereNameSpace__ecere__com__Instance * module)
2546 struct __ecereNameSpace__ecere__com__Class * _class;
2547 struct __ecereNameSpace__ecere__sys__OldLink * subModule;
2549 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
2550 ComputeModuleClasses(subModule->data);
2551 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->classes.first; _class; _class = _class->next)
2552 ComputeClassMembers(_class, 0x0);
2555 extern unsigned int inCompiler;
2557 extern void Compiler_Error(char * format, ...);
2559 extern char * __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char * string, char * stringAndContext);
2561 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
2563 int ComputeTypeSize(struct Type * type)
2565 unsigned int size = type ? type->size : 0;
2567 if(!size && type && !type->computing)
2569 type->computing = 0x1;
2573 type->alignment = size = sizeof(char);
2576 type->alignment = size = sizeof(int);
2579 type->alignment = size = sizeof(long long);
2582 type->alignment = size = targetBits / 8;
2585 type->alignment = size = targetBits / 8;
2588 type->alignment = size = sizeof(long);
2591 type->alignment = size = sizeof(short);
2594 type->alignment = size = sizeof(float);
2597 type->alignment = size = sizeof(double);
2601 struct __ecereNameSpace__ecere__com__Class * _class = type->_class ? type->_class->registered : (((void *)0));
2603 if(_class && _class->type == 1)
2605 ComputeClassMembers(_class, 0x0);
2606 type->alignment = _class->structAlignment;
2607 size = _class->structSize;
2608 if(type->alignment && size % type->alignment)
2609 size += type->alignment - (size % type->alignment);
2611 else if(_class && (_class->type == 3 || _class->type == 4 || _class->type == 2))
2613 if(!_class->dataType)
2614 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
2615 size = type->alignment = ComputeTypeSize(_class->dataType);
2618 size = type->alignment = targetBits / 8;
2623 size = type->alignment = targetBits / 8;
2626 if(type->arraySizeExp)
2628 ProcessExpressionType(type->arraySizeExp);
2629 ComputeExpression(type->arraySizeExp);
2630 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)))
2632 struct Location oldLoc = yylloc;
2633 char expression[10240];
2635 expression[0] = '\0';
2636 type->arraySizeExp->expType = (((void *)0));
2637 yylloc = type->arraySizeExp->loc;
2639 PrintExpression(type->arraySizeExp, expression);
2640 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Array size not constant int (%s)\n", (((void *)0))), expression);
2643 GetInt(type->arraySizeExp, &type->arraySize);
2645 else if(type->enumClass)
2647 if(type->enumClass && type->enumClass->registered && type->enumClass->registered->type == 4)
2649 type->arraySize = (int)__ecereNameSpace__ecere__com__eClass_GetProperty(type->enumClass->registered, "enumSize");
2652 type->arraySize = 0;
2656 type->arraySize = 0;
2658 size = ComputeTypeSize(type->type) * type->arraySize;
2659 type->alignment = type->type->alignment;
2663 struct Type * member;
2665 for(member = type->members.first; member; member = member->next)
2667 int __simpleStruct0, __simpleStruct1;
2668 unsigned int addSize = ComputeTypeSize(member);
2670 member->offset = size;
2671 if(member->alignment && size % member->alignment)
2672 member->offset += member->alignment - (size % member->alignment);
2673 size = member->offset;
2674 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2677 if(type->alignment && size % type->alignment)
2678 size += type->alignment - (size % type->alignment);
2683 struct Type * member;
2685 for(member = type->members.first; member; member = member->next)
2687 int __simpleStruct0, __simpleStruct1;
2688 unsigned int addSize = ComputeTypeSize(member);
2690 member->offset = size;
2691 if(member->alignment && size % member->alignment)
2692 member->offset += member->alignment - (size % member->alignment);
2693 size = member->offset;
2694 type->alignment = (__simpleStruct0 = type->alignment, __simpleStruct1 = member->alignment, (__simpleStruct0 > __simpleStruct1) ? __simpleStruct0 : __simpleStruct1);
2695 size = ((size > addSize) ? size : addSize);
2697 if(type->alignment && size % type->alignment)
2698 size += type->alignment - (size % type->alignment);
2703 struct TemplateParameter * param = type->templateParameter;
2704 struct Type * baseType = ProcessTemplateParameterType(param);
2708 size = ComputeTypeSize(baseType);
2709 type->alignment = baseType->alignment;
2712 type->alignment = size = sizeof(uint64);
2717 type->alignment = size = sizeof(enum
2725 type->alignment = size = targetBits / 8;
2730 type->computing = 0x0;
2735 extern struct Declarator * MkDeclaratorIdentifier(struct Identifier * id);
2737 extern struct Identifier * MkIdentifier(char * string);
2739 extern void ListAdd(struct __ecereNameSpace__ecere__sys__OldList * list, void * item);
2741 extern struct Declarator * MkStructDeclarator(struct Declarator * declarator, struct Expression * exp);
2743 extern struct ClassDef * MkClassDefDeclaration(struct Declaration * decl);
2745 extern struct Declaration * MkStructDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * declarators, struct Specifier * extStorage);
2747 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class);
2749 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams);
2751 extern void FreeType(struct Type * type);
2753 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
2755 extern struct Specifier * MkSpecifier(int specifier);
2757 extern struct Declarator * MkDeclaratorArray(struct Declarator * declarator, struct Expression * exp);
2759 extern struct Expression * MkExpConstant(char * string);
2761 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)
2763 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2764 unsigned int totalSize = 0;
2765 unsigned int maxSize = 0;
2766 int alignment, size;
2767 struct __ecereNameSpace__ecere__com__DataMember * member;
2768 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2771 *addedPadding = 0x0;
2772 if(!isMember && _class->base)
2774 maxSize = _class->structSize;
2776 if(_class->type == 1 || _class->type == 5)
2777 AddMembers(declarations, _class->base, 0x0, &totalSize, topClass, (((void *)0)));
2779 maxSize -= _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2782 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2784 if(!member->isProperty)
2786 switch(member->type)
2790 if(member->dataTypeString)
2792 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2793 struct Declarator * decl;
2795 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2796 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2797 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2798 if(!member->dataType)
2799 member->dataType = ProcessType(specs, decl);
2800 ReplaceThisClassSpecifiers(specs, topClass);
2802 struct Type * type = ProcessType(specs, decl);
2804 DeclareType(member->dataType, 0x0, 0x0);
2807 ComputeTypeSize(member->dataType);
2808 size = member->dataType->size;
2809 alignment = member->dataType->alignment;
2812 if(totalSize % alignment)
2813 totalSize += alignment - (totalSize % alignment);
2822 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2825 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2826 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2827 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2828 alignment = member->structAlignment;
2831 if(totalSize % alignment)
2832 totalSize += alignment - (totalSize % alignment);
2842 unsigned int __simpleStruct0;
2844 if(topMember && topMember->type == 1)
2845 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2847 *retSize += totalSize;
2849 else if(totalSize < maxSize && _class->type != 1000)
2851 int autoPadding = 0;
2853 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2854 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2855 if(totalSize + autoPadding < maxSize)
2857 char sizeString[50];
2859 sprintf(sizeString, "%d", maxSize - totalSize);
2860 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2862 *addedPadding = 0x1;
2866 FinishTemplatesContext(context);
2867 return topMember ? topMember->memberID : _class->memberID;
2870 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2872 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2873 unsigned int totalSize = 0;
2874 struct __ecereNameSpace__ecere__com__DataMember * member;
2875 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2877 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2878 DeclareMembers(_class->base, 0x0);
2879 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2881 if(!member->isProperty)
2883 switch(member->type)
2887 if(!member->dataType && member->dataTypeString)
2888 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2889 if(member->dataType)
2890 DeclareType(member->dataType, 0x0, 0x0);
2896 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2903 FinishTemplatesContext(context);
2904 return topMember ? topMember->memberID : _class->memberID;
2907 extern struct Symbol * FindClass(char * name);
2909 extern char * strchr(const char * , int);
2911 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2913 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2915 extern void FreeClassDef(struct ClassDef * def);
2917 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2919 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2921 extern char * strcpy(char * , const char * );
2923 extern void MangleClassName(char * className);
2925 extern void DeclareClass(struct Symbol * classSym, char * className);
2927 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2929 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2931 void DeclareStruct(char * name, unsigned int skipNoHead)
2933 struct External * external = (((void *)0));
2934 struct Symbol * classSym = FindClass(name);
2936 if(!inCompiler || !classSym)
2938 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2940 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2942 struct Declaration * decl;
2943 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2944 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2945 char structName[1024];
2947 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2948 classSym->declaring++;
2949 if(strchr(classSym->string, '<'))
2951 if(classSym->registered->templateClass)
2953 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2954 classSym->declaring--;
2958 DeclareMembers(classSym->registered, 0x0);
2959 structName[0] = (char)0;
2960 FullClassNameCat(structName, name, 0x0);
2963 unsigned int addedPadding = 0x0;
2965 classSym->declaredStructSym = 0x1;
2966 declarations = MkList();
2967 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2968 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2970 FreeList(declarations, FreeClassDef);
2971 declarations = (((void *)0));
2974 if(skipNoHead || declarations)
2976 if(external && external->declaration)
2978 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2979 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2981 if(classSym->structExternal)
2982 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2983 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2984 classSym->id = curExternal->symbol->idCode;
2985 classSym->idCode = curExternal->symbol->idCode;
2991 external = MkExternalDeclaration((((void *)0)));
2992 specifiers = MkList();
2993 declarators = MkList();
2994 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
2995 external->declaration = decl = MkDeclaration(specifiers, declarators);
2996 if(decl->symbol && !decl->symbol->pointerExternal)
2997 decl->symbol->pointerExternal = external;
2998 if(classSym->registered && classSym->registered->type == 1)
3000 char className[1024];
3002 strcpy(className, "__ecereClass_");
3003 FullClassNameCat(className, classSym->string, 0x1);
3004 MangleClassName(className);
3005 DeclareClass(classSym, className);
3006 external->symbol = classSym;
3007 classSym->pointerExternal = external;
3008 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3009 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3013 char className[1024];
3015 strcpy(className, "__ecereClass_");
3016 FullClassNameCat(className, classSym->string, 0x1);
3017 MangleClassName(className);
3018 classSym->structExternal = external;
3019 DeclareClass(classSym, className);
3020 external->symbol = classSym;
3022 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3025 classSym->declaring--;
3027 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3029 classSym->declaring++;
3031 if(classSym->registered)
3032 DeclareMembers(classSym->registered, 0x0);
3034 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3036 if(classSym->structExternal)
3037 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3038 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3039 classSym->id = curExternal->symbol->idCode;
3040 classSym->idCode = curExternal->symbol->idCode;
3042 classSym->declaring--;
3046 extern char * strcat(char * , const char * );
3048 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3050 extern struct ModuleImport * mainModule;
3052 extern struct Specifier * MkSpecifierName(char * name);
3054 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3056 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3058 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3060 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3062 extern void FreeDeclarator(struct Declarator * decl);
3064 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3066 struct PropertyImport
3068 struct PropertyImport * prev;
3069 struct PropertyImport * next;
3071 unsigned int isVirtual;
3072 unsigned int hasSet;
3073 unsigned int hasGet;
3074 } __attribute__ ((gcc_struct));
3076 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3078 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3080 void * __ecereTemp1;
3081 struct Symbol * symbol = prop->symbol;
3082 char propName[1024];
3084 strcpy(setName, "__ecereProp_");
3085 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3086 strcat(setName, "_Set_");
3087 FullClassNameCat(setName, prop->name, 0x1);
3088 strcpy(getName, "__ecereProp_");
3089 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3090 strcat(getName, "_Get_");
3091 FullClassNameCat(getName, prop->name, 0x1);
3092 strcpy(propName, "__ecereProp_");
3093 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3094 strcat(propName, "_");
3095 FullClassNameCat(propName, prop->name, 0x1);
3096 MangleClassName(getName);
3097 MangleClassName(setName);
3098 MangleClassName(propName);
3099 if(prop->_class->type == 1)
3100 DeclareStruct(prop->_class->fullName, 0x0);
3101 if(!symbol || curExternal->symbol->idCode < symbol->id)
3103 unsigned int imported = 0x0;
3104 unsigned int dllImport = 0x0;
3106 if(!symbol || symbol->_import)
3110 struct Symbol * classSym;
3112 if(!prop->_class->symbol)
3113 prop->_class->symbol = FindClass(prop->_class->fullName);
3114 classSym = prop->_class->symbol;
3115 if(classSym && !classSym->_import)
3117 struct ModuleImport * module;
3119 if(prop->_class->module)
3120 module = FindModule(prop->_class->module);
3122 module = mainModule;
3123 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = prop->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
3124 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3126 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3127 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport), ((struct PropertyImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), ((struct PropertyImport *)__ecereTemp1)->isVirtual = 0x0, ((struct PropertyImport *)__ecereTemp1)->hasSet = prop->Set ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1)->hasGet = prop->Get ? 0x1 : 0x0, ((struct PropertyImport *)__ecereTemp1));
3129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3132 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3137 struct Context * context = SetupTemplatesContext(prop->_class);
3139 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3140 FinishTemplatesContext(context);
3144 if(!symbol->externalGet || symbol->externalGet->type == 0)
3146 struct Declaration * decl;
3147 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3148 struct Declarator * d;
3149 struct __ecereNameSpace__ecere__sys__OldList * params;
3150 struct Specifier * spec;
3151 struct External * external;
3152 struct Declarator * typeDecl;
3153 unsigned int simple = 0x0;
3155 specifiers = MkList();
3156 declarators = MkList();
3158 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3159 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3161 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3163 struct Context * context = SetupTemplatesContext(prop->_class);
3165 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3166 FinishTemplatesContext(context);
3168 for(spec = (*specifiers).first; spec; spec = spec->next)
3172 if((!typeDecl || typeDecl->type == 1))
3174 struct Symbol * classSym = spec->symbol;
3176 symbol->_class = classSym->registered;
3177 if(classSym->registered && classSym->registered->type == 1)
3179 DeclareStruct(spec->name, 0x0);
3186 d = PlugDeclarator(typeDecl, d);
3189 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3190 specifiers = MkList();
3192 d = MkDeclaratorFunction(d, params);
3194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3195 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3198 ListAdd(specifiers, MkSpecifier(VOID));
3199 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3200 decl = MkDeclaration(specifiers, declarators);
3201 external = MkExternalDeclaration(decl);
3202 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3203 external->symbol = symbol;
3204 symbol->externalGet = external;
3205 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3207 FreeDeclarator(typeDecl);
3211 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3216 if(!symbol->externalSet || symbol->externalSet->type == 0)
3218 struct Declaration * decl;
3219 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3220 struct Declarator * d;
3221 struct __ecereNameSpace__ecere__sys__OldList * params;
3222 struct Specifier * spec;
3223 struct External * external;
3224 struct Declarator * typeDecl;
3226 declarators = MkList();
3228 if(!prop->conversion || prop->_class->type == 1)
3230 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3232 specifiers = MkList();
3234 struct Context * context = SetupTemplatesContext(prop->_class);
3236 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3237 FinishTemplatesContext(context);
3239 ListAdd(params, MkTypeName(specifiers, d));
3240 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3242 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3243 d = MkDeclaratorFunction(d, params);
3244 for(spec = (*specifiers).first; spec; spec = spec->next)
3248 if((!typeDecl || typeDecl->type == 1))
3250 struct Symbol * classSym = spec->symbol;
3252 symbol->_class = classSym->registered;
3253 if(classSym->registered && classSym->registered->type == 1)
3254 DeclareStruct(spec->name, 0x0);
3258 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3259 specifiers = MkList();
3261 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3262 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3263 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3264 if(!prop->conversion || prop->_class->type == 1)
3265 ListAdd(specifiers, MkSpecifier(VOID));
3267 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3268 decl = MkDeclaration(specifiers, declarators);
3269 external = MkExternalDeclaration(decl);
3270 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3271 external->symbol = symbol;
3272 symbol->externalSet = external;
3273 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3280 if(!symbol->externalPtr)
3282 struct Declaration * decl;
3283 struct External * external;
3284 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3287 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3289 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3290 ListAdd(specifiers, MkSpecifierName("Property"));
3292 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3294 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3297 strcpy(propName, "__ecerePropM_");
3298 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3299 strcat(propName, "_");
3300 FullClassNameCat(propName, prop->name, 0x1);
3301 MangleClassName(propName);
3302 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3304 decl = MkDeclaration(specifiers, list);
3306 external = MkExternalDeclaration(decl);
3307 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3308 external->symbol = symbol;
3309 symbol->externalPtr = external;
3313 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3315 symbol->id = curExternal->symbol->idCode;
3319 struct Type * Dereference(struct Type * source)
3321 void * __ecereTemp1;
3322 struct Type * type = (((void *)0));
3326 if(source->kind == 13 || source->kind == 12)
3328 type = source->type;
3329 source->type->refCount++;
3331 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3333 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3335 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3341 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3346 static struct Type * Reference(struct Type * source)
3348 void * __ecereTemp1;
3349 struct Type * type = (((void *)0));
3353 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = source, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3359 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);
3361 extern void * memcpy(void * , const void * , size_t size);
3363 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3365 extern void FreeExpression(struct Expression * exp);
3367 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3369 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);
3371 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3373 extern struct Type * MkClassType(char * name);
3375 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);
3377 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)
3379 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3380 unsigned int found = 0x0;
3381 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3382 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3383 unsigned int freeType = 0x0;
3385 yylloc = member->loc;
3390 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3394 dataMember = *curMember;
3400 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3401 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3402 int _subMemberStackPos = 0;
3405 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3408 dataMember = thisMember;
3409 if(curMember && thisMember->memberAccess == 1)
3411 *curMember = thisMember;
3412 *curClass = thisMember->_class;
3413 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3414 *subMemberStackPos = _subMemberStackPos;
3420 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3421 if(method && method->type == 1)
3424 method = (((void *)0));
3429 struct Type * type = (((void *)0));
3433 if(!dataMember->dataType && dataMember->dataTypeString)
3435 struct Context * context = SetupTemplatesContext(_class);
3437 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3438 FinishTemplatesContext(context);
3440 type = dataMember->dataType;
3444 if(!method->dataType)
3445 ProcessMethodType(method);
3446 type = method->dataType;
3448 if(ident && ident->next)
3450 for(ident = ident->next; ident && type; ident = ident->next)
3454 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3456 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3458 type = dataMember->dataType;
3460 else if(type->kind == 9 || type->kind == 10)
3462 struct Type * memberType;
3464 for(memberType = type->members.first; memberType; memberType = memberType->next)
3466 if(!strcmp(memberType->name, ident->string))
3475 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3478 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3479 struct __ecereNameSpace__ecere__com__Class * sClass;
3481 for(sClass = _class; sClass; sClass = sClass->base)
3484 if(sClass->templateClass)
3485 sClass = sClass->templateClass;
3486 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3488 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3490 for(sClass = sClass->base; sClass; sClass = sClass->base)
3492 if(sClass->templateClass)
3493 sClass = sClass->templateClass;
3494 id += sClass->templateParams.count;
3505 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3507 if(arg.dataTypeString)
3509 type = ProcessTypeString(arg.dataTypeString, 0x0);
3511 if(type && _class->templateClass)
3512 type->passAsTemplate = 0x1;
3519 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3521 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3522 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3526 char templateString[1024];
3527 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3529 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3530 for(cClass = expClass; cClass; cClass = cClass->base)
3534 if(cClass->templateClass)
3535 cClass = cClass->templateClass;
3536 for(param = cClass->templateParams.first; param; param = param->next)
3539 struct __ecereNameSpace__ecere__com__Class * sClass;
3540 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3542 for(sClass = cClass->base; sClass; sClass = sClass->base)
3544 if(sClass->templateClass)
3545 sClass = sClass->templateClass;
3546 id += sClass->templateParams.count;
3548 arg = expClass->templateArgs[id];
3549 for(sClass = _class; sClass; sClass = sClass->base)
3551 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3553 struct __ecereNameSpace__ecere__com__Class * nextClass;
3555 if(sClass->templateClass)
3556 sClass = sClass->templateClass;
3557 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3559 if(nextClass->templateClass)
3560 nextClass = nextClass->templateClass;
3561 p += nextClass->templateParams.count;
3563 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3565 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3567 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3569 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3570 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3584 char expString[1024];
3585 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3586 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3587 struct Expression * exp;
3588 char * string = PrintHexUInt64(arg.expression.ui64);
3590 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3591 ProcessExpressionType(exp);
3592 ComputeExpression(exp);
3593 expString[0] = '\0';
3594 PrintExpression(exp, expString);
3595 strcat(argument, expString);
3596 FreeExpression(exp);
3601 strcat(argument, arg.member->name);
3606 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3607 strcat(argument, arg.dataTypeString);
3614 strcat(templateString, ", ");
3615 if(lastParam != p - 1)
3617 strcat(templateString, param->name);
3618 strcat(templateString, " = ");
3620 strcat(templateString, argument);
3629 int len = strlen(templateString);
3631 if(templateString[len - 1] == '<')
3635 if(templateString[len - 1] == '>')
3636 templateString[len++] = ' ';
3637 templateString[len++] = '>';
3639 templateString[len++] = '\0';
3642 struct Context * context = SetupTemplatesContext(_class);
3646 type = ProcessTypeString(templateString, 0x0);
3648 FinishTemplatesContext(context);
3651 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3653 ProcessExpressionType(member->initializer->exp);
3654 if(!member->initializer->exp->expType)
3658 char expString[10240];
3660 expString[0] = '\0';
3661 PrintExpression(member->initializer->exp, expString);
3662 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3663 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3666 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3668 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3671 else if(member->initializer)
3673 ProcessInitializer(member->initializer, type);
3680 if(_class && _class->type == 3)
3682 if(member->initializer)
3684 struct Type * type = MkClassType(_class->fullName);
3686 ProcessInitializer(member->initializer, type);
3692 if(member->initializer)
3694 ProcessInitializer(member->initializer, (((void *)0)));
3700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3704 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3706 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3710 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3715 extern struct Identifier * GetDeclId(struct Declarator * decl);
3717 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);
3719 extern void FreeSpecifier(struct Specifier * spec);
3721 static void ProcessFunction(struct FunctionDefinition * function);
3723 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3725 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3727 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3729 extern void FreeClassFunction(struct ClassFunction * func);
3731 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3733 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3735 void ProcessInstantiationType(struct Instantiation * inst)
3740 struct MembersInit * members;
3741 struct Symbol * classSym;
3742 struct __ecereNameSpace__ecere__com__Class * _class;
3744 classSym = inst->_class->symbol;
3745 _class = classSym ? classSym->registered : (((void *)0));
3746 if(!_class || _class->type != 5)
3747 DeclareStruct(inst->_class->name, 0x0);
3748 afterExternal = afterExternal ? afterExternal : curExternal;
3750 ProcessExpressionType(inst->exp);
3751 inst->isConstant = 0x1;
3754 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3755 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3756 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3757 int subMemberStackPos = 0;
3759 for(members = (*inst->members).first; members; members = members->next)
3761 switch(members->type)
3766 static unsigned int instMethodID = 0;
3767 struct External * external = curExternal;
3768 struct Context * context = curContext;
3769 struct Declarator * declarator = members->function->declarator;
3770 struct Identifier * nameID = GetDeclId(declarator);
3771 char * unmangled = nameID ? nameID->string : (((void *)0));
3772 struct Expression * exp;
3773 struct External * createdExternal = (((void *)0));
3779 strcpy(name, "__ecereInstMeth_");
3780 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3782 strcat(name, nameID->string);
3784 sprintf(number, "_%08d", instMethodID++);
3785 strcat(name, number);
3786 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3790 struct Symbol * symbol = declarator->symbol;
3791 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3793 if(method && method->type == 1)
3795 symbol->method = method;
3796 ProcessMethodType(method);
3797 if(!symbol->type->thisClass)
3799 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3801 if(!currentClass->symbol)
3802 currentClass->symbol = FindClass(currentClass->fullName);
3803 symbol->type->thisClass = currentClass->symbol;
3808 _class->symbol = FindClass(_class->fullName);
3809 symbol->type->thisClass = _class->symbol;
3812 DeclareType(symbol->type, 0x1, 0x1);
3816 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3819 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3822 FreeSpecifier(nameID->_class);
3823 nameID->_class = (((void *)0));
3827 struct Type * type = declarator->symbol->type;
3828 struct External * oldExternal = curExternal;
3830 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3832 struct External * externalDecl;
3834 externalDecl = MkExternalDeclaration((((void *)0)));
3835 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3836 if(createdExternal->function)
3838 ProcessFunction(createdExternal->function);
3840 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3842 externalDecl->declaration = decl;
3843 if(decl->symbol && !decl->symbol->pointerExternal)
3844 decl->symbol->pointerExternal = externalDecl;
3845 declarator->symbol->pointerExternal = externalDecl;
3852 curExternal = declarator->symbol->pointerExternal;
3853 ProcessFunction((struct FunctionDefinition *)members->function);
3855 curExternal = external;
3856 curContext = context;
3859 FreeClassFunction(members->function);
3860 exp = QMkExpId(name);
3862 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3863 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3869 if(members->dataMembers && classSym)
3871 struct MemberInit * member;
3872 struct Location oldyyloc = yylloc;
3874 for(member = (*members->dataMembers).first; member; member = member->next)
3876 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3877 if(member->initializer && !member->initializer->isConstant)
3878 inst->isConstant = 0x0;
3890 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3894 if(type->kind == 11)
3896 struct Type * param;
3900 for(param = type->params.first; param; param = param->next)
3901 DeclareType(param, declarePointers, 0x1);
3903 DeclareType(type->returnType, declarePointers, 0x1);
3905 else if(type->kind == 13 && declarePointers)
3906 DeclareType(type->type, declarePointers, 0x0);
3907 else if(type->kind == 8)
3909 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3910 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3912 else if(type->kind == 9 || type->kind == 10)
3914 struct Type * member;
3916 for(member = type->members.first; member; member = member->next)
3917 DeclareType(member, 0x0, 0x0);
3919 else if(type->kind == 12)
3920 DeclareType(type->arrayType, declarePointers, 0x0);
3924 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3926 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3928 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3930 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3931 struct __ecereNameSpace__ecere__com__Class * sClass;
3933 for(sClass = _class; sClass; sClass = sClass->base)
3936 if(sClass->templateClass)
3937 sClass = sClass->templateClass;
3938 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3940 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3942 for(sClass = sClass->base; sClass; sClass = sClass->base)
3944 if(sClass->templateClass)
3945 sClass = sClass->templateClass;
3946 id += sClass->templateParams.count;
3957 arg = &_class->templateArgs[id];
3958 if(arg && param->type == 0)
3959 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3964 extern struct Context * PushContext(void);
3966 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3968 struct TemplatedType
3971 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3972 struct __ecereNameSpace__ecere__sys__BTNode * left;
3973 struct __ecereNameSpace__ecere__sys__BTNode * right;
3975 struct TemplateParameter * param;
3976 } __attribute__ ((gcc_struct));
3978 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3980 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3982 void * __ecereTemp1;
3983 struct Context * context = PushContext();
3985 context->templateTypesOnly = 0x1;
3986 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3988 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3990 for(; param; param = param->next)
3992 if(param->type == 0 && param->identifier)
3994 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
3996 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4002 struct __ecereNameSpace__ecere__com__Class * sClass;
4004 for(sClass = _class; sClass; sClass = sClass->base)
4006 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4008 for(p = sClass->templateParams.first; p; p = p->next)
4012 struct TemplateParameter * param = p->param;
4013 struct TemplatedType * type;
4017 p->param = param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter), ((struct TemplateParameter *)__ecereTemp1)->identifier = MkIdentifier(p->name), ((struct TemplateParameter *)__ecereTemp1)->type = p->type, ((struct TemplateParameter *)__ecereTemp1)->dataTypeString = p->dataTypeString, ((struct TemplateParameter *)__ecereTemp1));
4019 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), ((struct TemplatedType *)__ecereTemp1)->key = (uintptr_t)p->name, ((struct TemplatedType *)__ecereTemp1)->param = param, ((struct TemplatedType *)__ecereTemp1));
4020 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4028 extern void PopContext(struct Context * ctx);
4030 extern void FreeContext(struct Context * context);
4032 void FinishTemplatesContext(struct Context * context)
4034 PopContext(context);
4035 FreeContext(context);
4036 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4039 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4041 if(!method->dataType)
4043 struct Context * context = SetupTemplatesContext(method->_class);
4045 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4046 FinishTemplatesContext(context);
4047 if(method->type != 1 && method->dataType)
4049 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4051 if(!method->_class->symbol)
4052 method->_class->symbol = FindClass(method->_class->fullName);
4053 method->dataType->thisClass = method->_class->symbol;
4059 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4063 struct Context * context = SetupTemplatesContext(prop->_class);
4065 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4066 FinishTemplatesContext(context);
4070 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4072 extern void FreeTypeName(struct TypeName * typeName);
4074 static void ProcessDeclarator(struct Declarator * decl);
4076 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4078 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4082 struct MethodImport * prev;
4083 struct MethodImport * next;
4085 unsigned int isVirtual;
4086 } __attribute__ ((gcc_struct));
4088 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4090 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4092 void * __ecereTemp1;
4093 struct Symbol * symbol = method->symbol;
4095 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4097 unsigned int imported = 0x0;
4098 unsigned int dllImport = 0x0;
4100 if(!method->dataType)
4101 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4102 if(!symbol || symbol->_import || method->type == 1)
4104 if(!symbol || method->type == 1)
4106 struct Symbol * classSym;
4108 if(!method->_class->symbol)
4109 method->_class->symbol = FindClass(method->_class->fullName);
4110 classSym = method->_class->symbol;
4111 if(!classSym->_import)
4113 struct ModuleImport * module;
4115 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4116 module = FindModule(method->_class->module);
4118 module = mainModule;
4119 classSym->_import = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport), ((struct ClassImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), ((struct ClassImport *)__ecereTemp1)->isRemote = method->_class->isRemote, ((struct ClassImport *)__ecereTemp1));
4120 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4124 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4126 if(!symbol->_import)
4128 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport), ((struct MethodImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(method->name), ((struct MethodImport *)__ecereTemp1)->isVirtual = method->type == 1, ((struct MethodImport *)__ecereTemp1));
4129 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4133 symbol->type = method->dataType;
4135 symbol->type->refCount++;
4138 if(!method->dataType->dllExport)
4141 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4145 if(method->type != 1 && method->dataType)
4146 DeclareType(method->dataType, 0x1, 0x1);
4147 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4149 struct Declaration * decl;
4150 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4151 struct Declarator * d;
4152 struct Declarator * funcDecl;
4153 struct External * external;
4155 specifiers = MkList();
4156 declarators = MkList();
4158 ListAdd(specifiers, MkSpecifier(EXTERN));
4159 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4160 ListAdd(specifiers, MkSpecifier(STATIC));
4161 if(method->type == 1)
4163 ListAdd(specifiers, MkSpecifier(INT));
4164 d = MkDeclaratorIdentifier(MkIdentifier(name));
4168 d = MkDeclaratorIdentifier(MkIdentifier(name));
4170 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4172 struct Context * context = SetupTemplatesContext(method->_class);
4174 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4175 FinishTemplatesContext(context);
4177 funcDecl = GetFuncDecl(d);
4180 struct Specifier * spec, * next;
4182 for(spec = (*specifiers).first; spec; spec = next)
4187 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4188 FreeSpecifier(spec);
4192 if(method->dataType && !method->dataType->staticMethod)
4194 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4196 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4197 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")));
4198 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4199 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4201 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4203 struct TypeName * param = (*funcDecl->function.parameters).first;
4205 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4206 FreeTypeName(param);
4208 if(!funcDecl->function.parameters)
4209 funcDecl->function.parameters = MkList();
4210 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4214 ProcessDeclarator(d);
4215 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4216 decl = MkDeclaration(specifiers, declarators);
4217 ReplaceThisClassSpecifiers(specifiers, method->_class);
4218 if(symbol->pointerExternal)
4220 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4223 *functionSymbol = *symbol;
4224 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4225 if(functionSymbol->type)
4226 functionSymbol->type->refCount++;
4228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4229 symbol->pointerExternal->symbol = functionSymbol;
4231 external = MkExternalDeclaration(decl);
4233 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4234 external->symbol = symbol;
4235 symbol->pointerExternal = external;
4239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4241 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4245 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4247 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4249 unsigned int first = 0x1;
4251 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4253 char className[1024];
4255 strcpy(className, _class->fullName);
4256 for(param = _class->templateParams.first; param; param = param->next)
4260 strcat(className, "<");
4262 strcat(className, ", ");
4263 if(lastParam + 1 != p)
4265 strcat(className, param->name);
4266 strcat(className, " = ");
4268 strcat(className, param->name);
4276 int len = strlen(className);
4278 if(className[len - 1] == '>')
4279 className[len++] = ' ';
4280 className[len++] = '>';
4281 className[len++] = '\0';
4283 return __ecereNameSpace__ecere__sys__CopyString(className);
4286 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4289 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4291 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4293 unsigned int first = 0x1;
4295 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4297 char className[1024];
4299 strcpy(className, _class->fullName);
4300 for(param = _class->templateParams.first; param; param = param->next)
4304 strcat(className, "<");
4306 strcat(className, ", ");
4307 if(lastParam + 1 != p)
4309 strcat(className, param->name);
4310 strcat(className, " = ");
4312 strcat(className, param->name);
4320 int len = strlen(className);
4322 if(className[len - 1] == '>')
4323 className[len++] = ' ';
4324 className[len++] = '>';
4325 className[len++] = '\0';
4327 return MkClassType(className);
4331 return MkClassType(_class->fullName);
4335 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4337 if(specs != (((void *)0)) && _class)
4339 struct Specifier * spec;
4341 for(spec = specs->first; spec; spec = spec->next)
4343 if(spec->type == 0 && spec->specifier == THISCLASS)
4346 spec->name = ReplaceThisClass(_class);
4347 spec->symbol = FindClass(spec->name);
4353 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4355 struct __ecereNameSpace__ecere__com__GlobalFunction
4357 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4358 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4361 struct __ecereNameSpace__ecere__com__Instance * module;
4362 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4363 char * dataTypeString;
4364 struct Type * dataType;
4366 } __attribute__ ((gcc_struct));
4368 extern struct Context * globalContext;
4370 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4372 struct FunctionImport
4374 struct FunctionImport * prev;
4375 struct FunctionImport * next;
4377 } __attribute__ ((gcc_struct));
4379 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4381 void * __ecereTemp1;
4382 struct Symbol * symbol = function->symbol;
4384 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4386 unsigned int imported = 0x0;
4387 unsigned int dllImport = 0x0;
4389 if(!function->dataType)
4391 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4392 if(!function->dataType->thisClass)
4393 function->dataType->staticMethod = 0x1;
4399 struct ModuleImport * module = FindModule(function->module);
4401 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4404 if(!function->dataType->dllExport)
4406 symbol->_import = (struct ClassImport *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport), ((struct FunctionImport *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(function->name), ((struct FunctionImport *)__ecereTemp1));
4407 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4411 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4412 if(!symbol->type->thisClass)
4413 symbol->type->staticMethod = 0x1;
4416 imported = symbol->_import ? 0x1 : 0x0;
4417 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4420 DeclareType(function->dataType, 0x1, 0x1);
4423 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4425 struct Declaration * decl;
4426 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4427 struct Declarator * d;
4428 struct Declarator * funcDecl;
4429 struct External * external;
4431 specifiers = MkList();
4432 declarators = MkList();
4433 ListAdd(specifiers, MkSpecifier(EXTERN));
4434 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4436 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4437 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4438 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4440 struct Specifier * spec;
4442 for(spec = (*specifiers).first; spec; spec = spec->next)
4443 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4445 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4446 FreeSpecifier(spec);
4450 funcDecl = GetFuncDecl(d);
4451 if(funcDecl && !funcDecl->function.parameters)
4453 funcDecl->function.parameters = MkList();
4454 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4456 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4458 struct Context * oldCtx = curContext;
4460 curContext = globalContext;
4461 decl = MkDeclaration(specifiers, declarators);
4462 curContext = oldCtx;
4464 if(symbol->pointerExternal)
4466 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4469 *functionSymbol = *symbol;
4470 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4471 if(functionSymbol->type)
4472 functionSymbol->type->refCount++;
4474 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4475 symbol->pointerExternal->symbol = functionSymbol;
4477 external = MkExternalDeclaration(decl);
4479 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4480 external->symbol = symbol;
4481 symbol->pointerExternal = external;
4485 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4488 symbol->id = curExternal->symbol->idCode;
4491 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4494 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4499 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4500 struct __ecereNameSpace__ecere__sys__BTNode * left;
4501 struct __ecereNameSpace__ecere__sys__BTNode * right;
4503 struct __ecereNameSpace__ecere__com__Instance * module;
4504 char * dataTypeString;
4505 struct Type * dataType;
4508 } __attribute__ ((gcc_struct));
4510 void DeclareGlobalData(struct GlobalData * data)
4512 struct Symbol * symbol = data->symbol;
4514 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4519 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4522 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4523 DeclareType(data->dataType, 0x1, 0x1);
4526 if(!symbol->pointerExternal)
4528 struct Declaration * decl;
4529 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4530 struct Declarator * d;
4531 struct External * external;
4533 specifiers = MkList();
4534 declarators = MkList();
4535 ListAdd(specifiers, MkSpecifier(EXTERN));
4536 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4537 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4538 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4539 decl = MkDeclaration(specifiers, declarators);
4540 external = MkExternalDeclaration(decl);
4542 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4543 external->symbol = symbol;
4544 symbol->pointerExternal = external;
4548 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4551 symbol->id = curExternal->symbol->idCode;
4558 struct Conversion * prev, * next;
4559 struct __ecereNameSpace__ecere__com__Property * convert;
4561 struct Type * resultType;
4562 } __attribute__ ((gcc_struct));
4564 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4566 extern void Compiler_Warning(char * format, ...);
4568 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4570 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)
4574 if(source->kind == 20 && dest->kind != 20)
4576 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4581 if(dest->kind == 20 && source->kind != 20)
4583 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4588 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4592 if(source->classObjectType == 3 && dest->classObjectType != 2)
4596 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4598 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4601 if(dest->kind == 14 && source->kind != 0)
4603 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))
4605 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))
4607 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4609 if(source->_class->registered && source->_class->registered->type == 3)
4611 if(conversions != (((void *)0)))
4613 if(source->_class->registered == dest->_class->registered)
4618 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4620 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4622 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4624 if(sourceBase == destBase)
4628 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))
4632 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4634 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4641 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4645 if(source->kind == 8)
4647 struct __ecereNameSpace__ecere__com__Class * _class;
4649 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4651 struct __ecereNameSpace__ecere__com__Property * convert;
4653 for(convert = _class->conversions.first; convert; convert = convert->next)
4655 if(convert->memberAccess == 1 || _class->module == privateModule)
4657 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4659 if(!convert->dataType)
4660 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4661 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4663 if(!conversions && !convert->Get)
4665 else if(conversions != (((void *)0)))
4667 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))
4671 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4673 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4684 struct __ecereNameSpace__ecere__com__Class * _class;
4686 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4688 struct __ecereNameSpace__ecere__com__Property * convert;
4690 for(convert = _class->conversions.first; convert; convert = convert->next)
4692 if(convert->memberAccess == 1 || _class->module == privateModule)
4694 if(!convert->dataType)
4695 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4696 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4698 if(!conversions && !convert->Set)
4700 else if(conversions != (((void *)0)))
4702 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))
4706 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4708 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4716 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4718 if(!dest->_class->registered->dataType)
4719 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4720 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4722 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4729 if(source->kind == 8)
4731 struct __ecereNameSpace__ecere__com__Class * _class;
4733 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4735 struct __ecereNameSpace__ecere__com__Property * convert;
4737 for(convert = _class->conversions.first; convert; convert = convert->next)
4739 if(convert->memberAccess == 1 || _class->module == privateModule)
4741 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4743 if(!convert->dataType)
4744 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4745 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4747 if(!conversions && !convert->Get)
4749 else if(conversions != (((void *)0)))
4751 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))
4755 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4757 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4765 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4767 if(!source->_class->registered->dataType)
4768 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4769 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4776 if(source->kind == 8 || source->kind == 19)
4778 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4780 else if(dest->kind == 7 && source->kind == 6)
4782 else if(dest->kind == 2 && source->kind == 1)
4784 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4786 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4788 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4790 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4792 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))
4794 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))
4796 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)))
4798 struct Type * paramSource, * paramDest;
4800 if(dest->kind == 16)
4801 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4802 if(source->kind == 16)
4803 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4804 if(dest->kind == 13 && dest->type->kind == 11)
4806 if(source->kind == 13 && source->type->kind == 11)
4807 source = source->type;
4808 if(dest->kind == 16)
4809 dest = dest->method->dataType;
4810 if(source->kind == 16)
4811 source = source->method->dataType;
4812 paramSource = source->params.first;
4813 if(paramSource && paramSource->kind == 0)
4814 paramSource = (((void *)0));
4815 paramDest = dest->params.first;
4816 if(paramDest && paramDest->kind == 0)
4817 paramDest = (((void *)0));
4818 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4820 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))))
4822 if(paramDest && paramDest->kind == 8)
4823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4825 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4828 paramDest = paramDest->next;
4830 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4832 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4836 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4838 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4844 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4847 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4849 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4853 paramSource = paramSource->next;
4859 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4861 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4867 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4875 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4877 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4880 for(; paramDest; paramDest = paramDest->next)
4884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4888 struct Type * paramDestType = paramDest;
4889 struct Type * paramSourceType = paramSource;
4890 struct Type * type = paramDestType;
4892 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4895 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4896 struct __ecereNameSpace__ecere__com__Class * sClass;
4898 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4901 if(sClass->templateClass)
4902 sClass = sClass->templateClass;
4903 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4905 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4907 for(sClass = sClass->base; sClass; sClass = sClass->base)
4909 if(sClass->templateClass)
4910 sClass = sClass->templateClass;
4911 id += sClass->templateParams.count;
4922 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4924 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4927 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)))
4932 PrintType(paramDest, type, 0x0, 0x1);
4933 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4934 if(paramDestType != paramDest)
4935 FreeType(paramDestType);
4938 if(paramDestType != paramDest)
4939 FreeType(paramDestType);
4941 paramSource = paramSource->next;
4945 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4950 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4954 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4956 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4963 static void FreeConvert(struct Conversion * convert)
4965 if(convert->resultType)
4966 FreeType(convert->resultType);
4969 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4971 struct __ecereNameSpace__ecere__com__BTNamedLink
4974 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4975 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4976 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4979 } __attribute__ ((gcc_struct));
4981 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4983 struct __ecereNameSpace__ecere__com__EnumClassData
4985 struct __ecereNameSpace__ecere__sys__OldList values;
4987 } __attribute__ ((gcc_struct));
4989 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4991 struct __ecereNameSpace__ecere__sys__NamedLink
4993 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
4994 struct __ecereNameSpace__ecere__sys__NamedLink * next;
4997 } __attribute__ ((gcc_struct));
4999 extern void FreeExpContents(struct Expression * exp);
5001 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5003 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5005 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5007 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5009 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5011 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5013 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5015 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)))
5017 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5019 if(_class->type == 4)
5021 struct __ecereNameSpace__ecere__sys__OldList converts =
5025 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5029 _class->symbol = FindClass(_class->fullName);
5030 type->_class = _class->symbol;
5031 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5033 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5034 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5038 struct __ecereNameSpace__ecere__com__Class * baseClass;
5040 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5042 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5044 for(value = e->values.first; value; value = value->next)
5046 if(!strcmp(value->name, string))
5051 FreeExpContents(sourceExp);
5052 FreeType(sourceExp->expType);
5053 sourceExp->isConstant = 0x1;
5054 sourceExp->expType = MkClassType(baseClass->fullName);
5058 sourceExp->type = 2;
5059 if(!strcmp(baseClass->dataTypeString, "int"))
5060 sprintf(constant, "%d", value->data);
5062 sprintf(constant, "0x%X", value->data);
5063 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5065 while(converts.first)
5067 struct Conversion * convert = converts.first;
5069 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5070 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5072 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5079 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5080 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5083 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)))
5084 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5089 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5091 struct __ecereNameSpace__ecere__com__SubModule
5093 struct __ecereNameSpace__ecere__com__SubModule * prev;
5094 struct __ecereNameSpace__ecere__com__SubModule * next;
5095 struct __ecereNameSpace__ecere__com__Instance * module;
5097 } __attribute__ ((gcc_struct));
5099 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5101 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5103 if(searchFor == searchIn)
5105 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5107 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5109 if(ModuleVisibility(subModule->module, searchFor))
5116 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5118 struct __ecereNameSpace__ecere__com__Application
5123 unsigned int isGUIApp;
5124 struct __ecereNameSpace__ecere__sys__OldList allModules;
5125 char * parsedCommand;
5126 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5127 } __attribute__ ((gcc_struct));
5129 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5131 struct __ecereNameSpace__ecere__com__Instance * module;
5133 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))
5135 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))
5137 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))
5139 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)
5141 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5147 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5149 void ReadString(char * output, char * string);
5151 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5153 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5155 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5157 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5159 void * __ecereTemp1;
5160 struct Type * source = sourceExp->expType;
5161 struct Type * realDest = dest;
5163 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5165 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5167 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5169 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5171 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5173 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5175 if(sourceBase == destBase)
5181 struct __ecereNameSpace__ecere__sys__OldList * specs;
5182 unsigned int flag = 0x0;
5183 long long value = (((int)0x7fffffff));
5187 if(sourceExp->type == 2)
5189 if(source->isSigned)
5190 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5192 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5194 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5196 if(source->isSigned)
5197 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5199 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5201 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5204 source = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->isSigned = 0x0, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
5208 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5210 if(_class && _class->type == 3)
5212 if(source->kind != 8)
5214 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5215 struct Type * tempDest, * tempSource;
5217 for(; _class->base->type != 1000; _class = _class->base)
5220 tempDest = tempType;
5223 _class->symbol = FindClass(_class->fullName);
5224 tempType->_class = _class->symbol;
5225 tempType->truth = dest->truth;
5226 if(tempType->_class)
5227 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5228 FreeType(sourceExp->expType);
5229 sourceExp->expType = dest;
5232 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5235 if(_class && _class->type == 2 && source->kind != 8)
5237 if(!dest->_class->registered->dataType)
5238 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5239 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5242 FreeType(sourceExp->expType);
5243 source = sourceExp->expType = MkClassType(dest->_class->string);
5247 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5249 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5250 struct Declarator * decl;
5253 ReadString(string, sourceExp->string);
5254 decl = SpecDeclFromString(string, specs, (((void *)0)));
5255 FreeExpContents(sourceExp);
5256 FreeType(sourceExp->expType);
5257 sourceExp->type = 26;
5258 sourceExp->_classExp.specifiers = specs;
5259 sourceExp->_classExp.decl = decl;
5260 sourceExp->expType = dest;
5267 else if(source->kind == 8)
5269 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5271 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5275 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5276 struct Type * tempDest, * tempSource;
5278 if(!source->_class->registered->dataType)
5279 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5280 for(; _class->base->type != 1000; _class = _class->base)
5283 tempSource = tempType;
5285 tempType->_class = FindClass(_class->fullName);
5286 tempType->truth = source->truth;
5287 tempType->classObjectType = source->classObjectType;
5288 if(tempType->_class)
5289 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5290 if(conversions->last)
5292 ((struct Conversion *)conversions->last)->resultType = dest;
5295 FreeType(sourceExp->expType);
5296 sourceExp->expType = MkClassType(_class->fullName);
5297 sourceExp->expType->truth = source->truth;
5298 sourceExp->expType->classObjectType = source->classObjectType;
5299 if(!sourceExp->destType)
5301 FreeType(sourceExp->destType);
5302 sourceExp->destType = sourceExp->expType;
5303 if(sourceExp->expType)
5304 sourceExp->expType->refCount++;
5306 if(!_class->dataType)
5307 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5309 dest = MkClassType(source->_class->string);
5310 dest->truth = source->truth;
5311 dest->classObjectType = source->classObjectType;
5313 source = _class->dataType;
5315 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5321 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5330 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5332 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5334 if(_class->type == 0 || _class->type == 5)
5336 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5338 *newExp = *sourceExp;
5339 if(sourceExp->destType)
5340 sourceExp->destType->refCount++;
5341 if(sourceExp->expType)
5342 sourceExp->expType->refCount++;
5343 sourceExp->type = 11;
5344 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5345 sourceExp->cast.exp = newExp;
5346 FreeType(sourceExp->expType);
5347 sourceExp->expType = (((void *)0));
5348 ProcessExpressionType(sourceExp);
5351 FreeType(sourceExp->expType);
5352 sourceExp->expType = dest;
5359 if(!_class->dataType)
5360 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5362 dest = _class->dataType;
5365 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5367 specs = MkListOne(MkSpecifier(DOUBLE));
5369 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5371 specs = MkListOne(MkSpecifier(FLOAT));
5373 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5377 ListAdd(specs, MkSpecifier(UNSIGNED));
5378 ListAdd(specs, MkSpecifier(INT64));
5380 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5384 ListAdd(specs, MkSpecifier(UNSIGNED));
5385 ListAdd(specs, MkSpecifier(INT));
5387 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5391 ListAdd(specs, MkSpecifier(UNSIGNED));
5392 ListAdd(specs, MkSpecifier(SHORT));
5394 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5398 ListAdd(specs, MkSpecifier(UNSIGNED));
5399 ListAdd(specs, MkSpecifier(CHAR));
5408 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))
5410 specs = MkListOne(MkSpecifier(DOUBLE));
5412 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5414 specs = MkListOne(MkSpecifier(FLOAT));
5416 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)))
5420 ListAdd(specs, MkSpecifier(UNSIGNED));
5421 ListAdd(specs, MkSpecifier(CHAR));
5423 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)))))
5427 ListAdd(specs, MkSpecifier(UNSIGNED));
5428 ListAdd(specs, MkSpecifier(SHORT));
5430 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5434 ListAdd(specs, MkSpecifier(UNSIGNED));
5435 ListAdd(specs, MkSpecifier(INT));
5437 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5441 ListAdd(specs, MkSpecifier(UNSIGNED));
5442 ListAdd(specs, MkSpecifier(INT64));
5444 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5446 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5456 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5458 *newExp = *sourceExp;
5459 newExp->prev = (((void *)0));
5460 newExp->next = (((void *)0));
5461 if(sourceExp->destType)
5462 sourceExp->destType->refCount++;
5463 if(sourceExp->expType)
5464 sourceExp->expType->refCount++;
5465 sourceExp->type = 11;
5466 if(realDest->kind == 8)
5468 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5469 FreeList(specs, FreeSpecifier);
5472 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5473 if(newExp->type == 4)
5475 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5478 sourceExp->cast.exp = newExp;
5479 FreeType(sourceExp->expType);
5480 sourceExp->expType = (((void *)0));
5481 ProcessExpressionType(sourceExp);
5484 FreeList(specs, FreeSpecifier);
5491 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5492 sourceExp = (*sourceExp->list).last;
5493 if(sourceExp->type == 0)
5495 struct Identifier * id = sourceExp->identifier;
5499 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5501 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5502 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5506 for(; _class && _class->type == 4; _class = _class->base)
5508 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5509 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5511 for(value = e->values.first; value; value = value->next)
5513 if(!strcmp(value->name, id->string))
5518 FreeExpContents(sourceExp);
5519 FreeType(sourceExp->expType);
5520 sourceExp->isConstant = 0x1;
5521 sourceExp->expType = MkClassType(_class->fullName);
5525 sourceExp->type = 2;
5526 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5527 sprintf(constant, "%d", value->data);
5529 sprintf(constant, "0x%X", value->data);
5530 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5538 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5545 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5547 int value2 = op2->i;
5550 exp->string = PrintInt(op1->i + value2);
5553 exp->expType = op1->type;
5555 op1->type->refCount++;
5560 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5562 unsigned int value2 = op2->ui;
5565 exp->string = PrintUInt(op1->ui + value2);
5568 exp->expType = op1->type;
5570 op1->type->refCount++;
5575 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5577 short value2 = op2->s;
5580 exp->string = PrintShort(op1->s + value2);
5583 exp->expType = op1->type;
5585 op1->type->refCount++;
5590 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5592 unsigned short value2 = op2->us;
5595 exp->string = PrintUShort(op1->us + value2);
5598 exp->expType = op1->type;
5600 op1->type->refCount++;
5605 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5607 char value2 = op2->c;
5610 exp->string = PrintChar(op1->c + value2);
5613 exp->expType = op1->type;
5615 op1->type->refCount++;
5620 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5622 unsigned char value2 = op2->uc;
5625 exp->string = PrintUChar(op1->uc + value2);
5628 exp->expType = op1->type;
5630 op1->type->refCount++;
5635 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5637 float value2 = op2->f;
5640 exp->string = PrintFloat(op1->f + value2);
5643 exp->expType = op1->type;
5645 op1->type->refCount++;
5650 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5652 double value2 = op2->d;
5655 exp->string = PrintDouble(op1->d + value2);
5658 exp->expType = op1->type;
5660 op1->type->refCount++;
5665 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5667 int value2 = op2->i;
5670 exp->string = PrintInt(op1->i - value2);
5673 exp->expType = op1->type;
5675 op1->type->refCount++;
5680 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5682 unsigned int value2 = op2->ui;
5685 exp->string = PrintUInt(op1->ui - value2);
5688 exp->expType = op1->type;
5690 op1->type->refCount++;
5695 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5697 short value2 = op2->s;
5700 exp->string = PrintShort(op1->s - value2);
5703 exp->expType = op1->type;
5705 op1->type->refCount++;
5710 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5712 unsigned short value2 = op2->us;
5715 exp->string = PrintUShort(op1->us - value2);
5718 exp->expType = op1->type;
5720 op1->type->refCount++;
5725 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5727 char value2 = op2->c;
5730 exp->string = PrintChar(op1->c - value2);
5733 exp->expType = op1->type;
5735 op1->type->refCount++;
5740 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5742 unsigned char value2 = op2->uc;
5745 exp->string = PrintUChar(op1->uc - value2);
5748 exp->expType = op1->type;
5750 op1->type->refCount++;
5755 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5757 float value2 = op2->f;
5760 exp->string = PrintFloat(op1->f - value2);
5763 exp->expType = op1->type;
5765 op1->type->refCount++;
5770 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5772 double value2 = op2->d;
5775 exp->string = PrintDouble(op1->d - value2);
5778 exp->expType = op1->type;
5780 op1->type->refCount++;
5785 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5787 int value2 = op2->i;
5790 exp->string = PrintInt(op1->i * value2);
5793 exp->expType = op1->type;
5795 op1->type->refCount++;
5800 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5802 unsigned int value2 = op2->ui;
5805 exp->string = PrintUInt(op1->ui * value2);
5808 exp->expType = op1->type;
5810 op1->type->refCount++;
5815 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5817 short value2 = op2->s;
5820 exp->string = PrintShort(op1->s * value2);
5823 exp->expType = op1->type;
5825 op1->type->refCount++;
5830 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5832 unsigned short value2 = op2->us;
5835 exp->string = PrintUShort(op1->us * value2);
5838 exp->expType = op1->type;
5840 op1->type->refCount++;
5845 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5847 char value2 = op2->c;
5850 exp->string = PrintChar(op1->c * value2);
5853 exp->expType = op1->type;
5855 op1->type->refCount++;
5860 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5862 unsigned char value2 = op2->uc;
5865 exp->string = PrintUChar(op1->uc * value2);
5868 exp->expType = op1->type;
5870 op1->type->refCount++;
5875 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5877 float value2 = op2->f;
5880 exp->string = PrintFloat(op1->f * value2);
5883 exp->expType = op1->type;
5885 op1->type->refCount++;
5890 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5892 double value2 = op2->d;
5895 exp->string = PrintDouble(op1->d * value2);
5898 exp->expType = op1->type;
5900 op1->type->refCount++;
5905 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5907 int value2 = op2->i;
5910 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5913 exp->expType = op1->type;
5915 op1->type->refCount++;
5920 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5922 unsigned int value2 = op2->ui;
5925 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5928 exp->expType = op1->type;
5930 op1->type->refCount++;
5935 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5937 short value2 = op2->s;
5940 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5943 exp->expType = op1->type;
5945 op1->type->refCount++;
5950 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5952 unsigned short value2 = op2->us;
5955 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5958 exp->expType = op1->type;
5960 op1->type->refCount++;
5965 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5967 char value2 = op2->c;
5970 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5973 exp->expType = op1->type;
5975 op1->type->refCount++;
5980 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5982 unsigned char value2 = op2->uc;
5985 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
5988 exp->expType = op1->type;
5990 op1->type->refCount++;
5995 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5997 float value2 = op2->f;
6000 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
6003 exp->expType = op1->type;
6005 op1->type->refCount++;
6010 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6012 double value2 = op2->d;
6015 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
6018 exp->expType = op1->type;
6020 op1->type->refCount++;
6025 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6027 int value2 = op2->i;
6030 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6033 exp->expType = op1->type;
6035 op1->type->refCount++;
6040 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6042 unsigned int value2 = op2->ui;
6045 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6048 exp->expType = op1->type;
6050 op1->type->refCount++;
6055 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6057 short value2 = op2->s;
6060 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6063 exp->expType = op1->type;
6065 op1->type->refCount++;
6070 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6072 unsigned short value2 = op2->us;
6075 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6078 exp->expType = op1->type;
6080 op1->type->refCount++;
6085 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6087 char value2 = op2->c;
6090 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6093 exp->expType = op1->type;
6095 op1->type->refCount++;
6100 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6102 unsigned char value2 = op2->uc;
6105 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6108 exp->expType = op1->type;
6110 op1->type->refCount++;
6115 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6118 exp->string = PrintInt(-op1->i);
6121 exp->expType = op1->type;
6123 op1->type->refCount++;
6128 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6131 exp->string = PrintUInt(-op1->ui);
6134 exp->expType = op1->type;
6136 op1->type->refCount++;
6141 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6144 exp->string = PrintShort(-op1->s);
6147 exp->expType = op1->type;
6149 op1->type->refCount++;
6154 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6157 exp->string = PrintUShort(-op1->us);
6160 exp->expType = op1->type;
6162 op1->type->refCount++;
6167 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6170 exp->string = PrintChar(-op1->c);
6173 exp->expType = op1->type;
6175 op1->type->refCount++;
6180 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6183 exp->string = PrintUChar(-op1->uc);
6186 exp->expType = op1->type;
6188 op1->type->refCount++;
6193 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6196 exp->string = PrintFloat(-op1->f);
6199 exp->expType = op1->type;
6201 op1->type->refCount++;
6206 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6209 exp->string = PrintDouble(-op1->d);
6212 exp->expType = op1->type;
6214 op1->type->refCount++;
6219 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6222 exp->string = PrintInt(++op1->i);
6225 exp->expType = op1->type;
6227 op1->type->refCount++;
6232 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6235 exp->string = PrintUInt(++op1->ui);
6238 exp->expType = op1->type;
6240 op1->type->refCount++;
6245 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6248 exp->string = PrintShort(++op1->s);
6251 exp->expType = op1->type;
6253 op1->type->refCount++;
6258 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6261 exp->string = PrintUShort(++op1->us);
6264 exp->expType = op1->type;
6266 op1->type->refCount++;
6271 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6274 exp->string = PrintChar(++op1->c);
6277 exp->expType = op1->type;
6279 op1->type->refCount++;
6284 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6287 exp->string = PrintUChar(++op1->uc);
6290 exp->expType = op1->type;
6292 op1->type->refCount++;
6297 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6300 exp->string = PrintFloat(++op1->f);
6303 exp->expType = op1->type;
6305 op1->type->refCount++;
6310 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6313 exp->string = PrintDouble(++op1->d);
6316 exp->expType = op1->type;
6318 op1->type->refCount++;
6323 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6326 exp->string = PrintInt(--op1->i);
6329 exp->expType = op1->type;
6331 op1->type->refCount++;
6336 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6339 exp->string = PrintUInt(--op1->ui);
6342 exp->expType = op1->type;
6344 op1->type->refCount++;
6349 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6352 exp->string = PrintShort(--op1->s);
6355 exp->expType = op1->type;
6357 op1->type->refCount++;
6362 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6365 exp->string = PrintUShort(--op1->us);
6368 exp->expType = op1->type;
6370 op1->type->refCount++;
6375 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6378 exp->string = PrintChar(--op1->c);
6381 exp->expType = op1->type;
6383 op1->type->refCount++;
6388 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6391 exp->string = PrintUChar(--op1->uc);
6394 exp->expType = op1->type;
6396 op1->type->refCount++;
6401 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6404 exp->string = PrintFloat(--op1->f);
6407 exp->expType = op1->type;
6409 op1->type->refCount++;
6414 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6417 exp->string = PrintDouble(--op1->d);
6420 exp->expType = op1->type;
6422 op1->type->refCount++;
6427 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6429 int value2 = op2->i;
6432 exp->string = PrintInt(op1->i = value2);
6435 exp->expType = op1->type;
6437 op1->type->refCount++;
6442 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6444 unsigned int value2 = op2->ui;
6447 exp->string = PrintUInt(op1->ui = value2);
6450 exp->expType = op1->type;
6452 op1->type->refCount++;
6457 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6459 short value2 = op2->s;
6462 exp->string = PrintShort(op1->s = value2);
6465 exp->expType = op1->type;
6467 op1->type->refCount++;
6472 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6474 unsigned short value2 = op2->us;
6477 exp->string = PrintUShort(op1->us = value2);
6480 exp->expType = op1->type;
6482 op1->type->refCount++;
6487 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6489 char value2 = op2->c;
6492 exp->string = PrintChar(op1->c = value2);
6495 exp->expType = op1->type;
6497 op1->type->refCount++;
6502 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6504 unsigned char value2 = op2->uc;
6507 exp->string = PrintUChar(op1->uc = value2);
6510 exp->expType = op1->type;
6512 op1->type->refCount++;
6517 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6519 float value2 = op2->f;
6522 exp->string = PrintFloat(op1->f = value2);
6525 exp->expType = op1->type;
6527 op1->type->refCount++;
6532 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6534 double value2 = op2->d;
6537 exp->string = PrintDouble(op1->d = value2);
6540 exp->expType = op1->type;
6542 op1->type->refCount++;
6547 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6549 int value2 = op2->i;
6552 exp->string = PrintInt(op1->i += value2);
6555 exp->expType = op1->type;
6557 op1->type->refCount++;
6562 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6564 unsigned int value2 = op2->ui;
6567 exp->string = PrintUInt(op1->ui += value2);
6570 exp->expType = op1->type;
6572 op1->type->refCount++;
6577 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6579 short value2 = op2->s;
6582 exp->string = PrintShort(op1->s += value2);
6585 exp->expType = op1->type;
6587 op1->type->refCount++;
6592 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6594 unsigned short value2 = op2->us;
6597 exp->string = PrintUShort(op1->us += value2);
6600 exp->expType = op1->type;
6602 op1->type->refCount++;
6607 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6609 char value2 = op2->c;
6612 exp->string = PrintChar(op1->c += value2);
6615 exp->expType = op1->type;
6617 op1->type->refCount++;
6622 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6624 unsigned char value2 = op2->uc;
6627 exp->string = PrintUChar(op1->uc += value2);
6630 exp->expType = op1->type;
6632 op1->type->refCount++;
6637 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6639 float value2 = op2->f;
6642 exp->string = PrintFloat(op1->f += value2);
6645 exp->expType = op1->type;
6647 op1->type->refCount++;
6652 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6654 double value2 = op2->d;
6657 exp->string = PrintDouble(op1->d += value2);
6660 exp->expType = op1->type;
6662 op1->type->refCount++;
6667 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6669 int value2 = op2->i;
6672 exp->string = PrintInt(op1->i -= value2);
6675 exp->expType = op1->type;
6677 op1->type->refCount++;
6682 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6684 unsigned int value2 = op2->ui;
6687 exp->string = PrintUInt(op1->ui -= value2);
6690 exp->expType = op1->type;
6692 op1->type->refCount++;
6697 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6699 short value2 = op2->s;
6702 exp->string = PrintShort(op1->s -= value2);
6705 exp->expType = op1->type;
6707 op1->type->refCount++;
6712 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6714 unsigned short value2 = op2->us;
6717 exp->string = PrintUShort(op1->us -= value2);
6720 exp->expType = op1->type;
6722 op1->type->refCount++;
6727 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6729 char value2 = op2->c;
6732 exp->string = PrintChar(op1->c -= value2);
6735 exp->expType = op1->type;
6737 op1->type->refCount++;
6742 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6744 unsigned char value2 = op2->uc;
6747 exp->string = PrintUChar(op1->uc -= value2);
6750 exp->expType = op1->type;
6752 op1->type->refCount++;
6757 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6759 float value2 = op2->f;
6762 exp->string = PrintFloat(op1->f -= value2);
6765 exp->expType = op1->type;
6767 op1->type->refCount++;
6772 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6774 double value2 = op2->d;
6777 exp->string = PrintDouble(op1->d -= value2);
6780 exp->expType = op1->type;
6782 op1->type->refCount++;
6787 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6789 int value2 = op2->i;
6792 exp->string = PrintInt(op1->i *= value2);
6795 exp->expType = op1->type;
6797 op1->type->refCount++;
6802 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6804 unsigned int value2 = op2->ui;
6807 exp->string = PrintUInt(op1->ui *= value2);
6810 exp->expType = op1->type;
6812 op1->type->refCount++;
6817 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6819 short value2 = op2->s;
6822 exp->string = PrintShort(op1->s *= value2);
6825 exp->expType = op1->type;
6827 op1->type->refCount++;
6832 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6834 unsigned short value2 = op2->us;
6837 exp->string = PrintUShort(op1->us *= value2);
6840 exp->expType = op1->type;
6842 op1->type->refCount++;
6847 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6849 char value2 = op2->c;
6852 exp->string = PrintChar(op1->c *= value2);
6855 exp->expType = op1->type;
6857 op1->type->refCount++;
6862 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6864 unsigned char value2 = op2->uc;
6867 exp->string = PrintUChar(op1->uc *= value2);
6870 exp->expType = op1->type;
6872 op1->type->refCount++;
6877 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6879 float value2 = op2->f;
6882 exp->string = PrintFloat(op1->f *= value2);
6885 exp->expType = op1->type;
6887 op1->type->refCount++;
6892 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6894 double value2 = op2->d;
6897 exp->string = PrintDouble(op1->d *= value2);
6900 exp->expType = op1->type;
6902 op1->type->refCount++;
6907 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6909 int value2 = op2->i;
6912 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6915 exp->expType = op1->type;
6917 op1->type->refCount++;
6922 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6924 unsigned int value2 = op2->ui;
6927 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6930 exp->expType = op1->type;
6932 op1->type->refCount++;
6937 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6939 short value2 = op2->s;
6942 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6945 exp->expType = op1->type;
6947 op1->type->refCount++;
6952 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6954 unsigned short value2 = op2->us;
6957 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6960 exp->expType = op1->type;
6962 op1->type->refCount++;
6967 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6969 char value2 = op2->c;
6972 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6975 exp->expType = op1->type;
6977 op1->type->refCount++;
6982 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6984 unsigned char value2 = op2->uc;
6987 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
6990 exp->expType = op1->type;
6992 op1->type->refCount++;
6997 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6999 float value2 = op2->f;
7002 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
7005 exp->expType = op1->type;
7007 op1->type->refCount++;
7012 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7014 double value2 = op2->d;
7017 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
7020 exp->expType = op1->type;
7022 op1->type->refCount++;
7027 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7029 int value2 = op2->i;
7032 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7035 exp->expType = op1->type;
7037 op1->type->refCount++;
7042 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7044 unsigned int value2 = op2->ui;
7047 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7050 exp->expType = op1->type;
7052 op1->type->refCount++;
7057 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7059 short value2 = op2->s;
7062 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7065 exp->expType = op1->type;
7067 op1->type->refCount++;
7072 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7074 unsigned short value2 = op2->us;
7077 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7080 exp->expType = op1->type;
7082 op1->type->refCount++;
7087 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7089 char value2 = op2->c;
7092 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7095 exp->expType = op1->type;
7097 op1->type->refCount++;
7102 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7104 unsigned char value2 = op2->uc;
7107 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7110 exp->expType = op1->type;
7112 op1->type->refCount++;
7117 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7119 int value2 = op2->i;
7122 exp->string = PrintInt(op1->i & value2);
7125 exp->expType = op1->type;
7127 op1->type->refCount++;
7132 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7134 unsigned int value2 = op2->ui;
7137 exp->string = PrintUInt(op1->ui & value2);
7140 exp->expType = op1->type;
7142 op1->type->refCount++;
7147 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7149 short value2 = op2->s;
7152 exp->string = PrintShort(op1->s & value2);
7155 exp->expType = op1->type;
7157 op1->type->refCount++;
7162 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7164 unsigned short value2 = op2->us;
7167 exp->string = PrintUShort(op1->us & value2);
7170 exp->expType = op1->type;
7172 op1->type->refCount++;
7177 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7179 char value2 = op2->c;
7182 exp->string = PrintChar(op1->c & value2);
7185 exp->expType = op1->type;
7187 op1->type->refCount++;
7192 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7194 unsigned char value2 = op2->uc;
7197 exp->string = PrintUChar(op1->uc & value2);
7200 exp->expType = op1->type;
7202 op1->type->refCount++;
7207 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7209 int value2 = op2->i;
7212 exp->string = PrintInt(op1->i | value2);
7215 exp->expType = op1->type;
7217 op1->type->refCount++;
7222 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7224 unsigned int value2 = op2->ui;
7227 exp->string = PrintUInt(op1->ui | value2);
7230 exp->expType = op1->type;
7232 op1->type->refCount++;
7237 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7239 short value2 = op2->s;
7242 exp->string = PrintShort(op1->s | value2);
7245 exp->expType = op1->type;
7247 op1->type->refCount++;
7252 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7254 unsigned short value2 = op2->us;
7257 exp->string = PrintUShort(op1->us | value2);
7260 exp->expType = op1->type;
7262 op1->type->refCount++;
7267 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7269 char value2 = op2->c;
7272 exp->string = PrintChar(op1->c | value2);
7275 exp->expType = op1->type;
7277 op1->type->refCount++;
7282 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7284 unsigned char value2 = op2->uc;
7287 exp->string = PrintUChar(op1->uc | value2);
7290 exp->expType = op1->type;
7292 op1->type->refCount++;
7297 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7299 int value2 = op2->i;
7302 exp->string = PrintInt(op1->i ^ value2);
7305 exp->expType = op1->type;
7307 op1->type->refCount++;
7312 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7314 unsigned int value2 = op2->ui;
7317 exp->string = PrintUInt(op1->ui ^ value2);
7320 exp->expType = op1->type;
7322 op1->type->refCount++;
7327 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7329 short value2 = op2->s;
7332 exp->string = PrintShort(op1->s ^ value2);
7335 exp->expType = op1->type;
7337 op1->type->refCount++;
7342 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7344 unsigned short value2 = op2->us;
7347 exp->string = PrintUShort(op1->us ^ value2);
7350 exp->expType = op1->type;
7352 op1->type->refCount++;
7357 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7359 char value2 = op2->c;
7362 exp->string = PrintChar(op1->c ^ value2);
7365 exp->expType = op1->type;
7367 op1->type->refCount++;
7372 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7374 unsigned char value2 = op2->uc;
7377 exp->string = PrintUChar(op1->uc ^ value2);
7380 exp->expType = op1->type;
7382 op1->type->refCount++;
7387 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7389 int value2 = op2->i;
7392 exp->string = PrintInt(op1->i << value2);
7395 exp->expType = op1->type;
7397 op1->type->refCount++;
7402 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7404 unsigned int value2 = op2->ui;
7407 exp->string = PrintUInt(op1->ui << value2);
7410 exp->expType = op1->type;
7412 op1->type->refCount++;
7417 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7419 short value2 = op2->s;
7422 exp->string = PrintShort(op1->s << value2);
7425 exp->expType = op1->type;
7427 op1->type->refCount++;
7432 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7434 unsigned short value2 = op2->us;
7437 exp->string = PrintUShort(op1->us << value2);
7440 exp->expType = op1->type;
7442 op1->type->refCount++;
7447 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7449 char value2 = op2->c;
7452 exp->string = PrintChar(op1->c << value2);
7455 exp->expType = op1->type;
7457 op1->type->refCount++;
7462 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7464 unsigned char value2 = op2->uc;
7467 exp->string = PrintUChar(op1->uc << value2);
7470 exp->expType = op1->type;
7472 op1->type->refCount++;
7477 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7479 int value2 = op2->i;
7482 exp->string = PrintInt(op1->i >> value2);
7485 exp->expType = op1->type;
7487 op1->type->refCount++;
7492 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7494 unsigned int value2 = op2->ui;
7497 exp->string = PrintUInt(op1->ui >> value2);
7500 exp->expType = op1->type;
7502 op1->type->refCount++;
7507 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7509 short value2 = op2->s;
7512 exp->string = PrintShort(op1->s >> value2);
7515 exp->expType = op1->type;
7517 op1->type->refCount++;
7522 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7524 unsigned short value2 = op2->us;
7527 exp->string = PrintUShort(op1->us >> value2);
7530 exp->expType = op1->type;
7532 op1->type->refCount++;
7537 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7539 char value2 = op2->c;
7542 exp->string = PrintChar(op1->c >> value2);
7545 exp->expType = op1->type;
7547 op1->type->refCount++;
7552 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7554 unsigned char value2 = op2->uc;
7557 exp->string = PrintUChar(op1->uc >> value2);
7560 exp->expType = op1->type;
7562 op1->type->refCount++;
7567 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7570 exp->string = PrintInt(~op1->i);
7573 exp->expType = op1->type;
7575 op1->type->refCount++;
7580 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7583 exp->string = PrintUInt(~op1->ui);
7586 exp->expType = op1->type;
7588 op1->type->refCount++;
7593 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7596 exp->string = PrintShort(~op1->s);
7599 exp->expType = op1->type;
7601 op1->type->refCount++;
7606 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7609 exp->string = PrintUShort(~op1->us);
7612 exp->expType = op1->type;
7614 op1->type->refCount++;
7619 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7622 exp->string = PrintChar(~op1->c);
7625 exp->expType = op1->type;
7627 op1->type->refCount++;
7632 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7635 exp->string = PrintUChar(~op1->uc);
7638 exp->expType = op1->type;
7640 op1->type->refCount++;
7645 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7647 int value2 = op2->i;
7650 exp->string = PrintInt(op1->i &= value2);
7653 exp->expType = op1->type;
7655 op1->type->refCount++;
7660 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7662 unsigned int value2 = op2->ui;
7665 exp->string = PrintUInt(op1->ui &= value2);
7668 exp->expType = op1->type;
7670 op1->type->refCount++;
7675 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7677 short value2 = op2->s;
7680 exp->string = PrintShort(op1->s &= value2);
7683 exp->expType = op1->type;
7685 op1->type->refCount++;
7690 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7692 unsigned short value2 = op2->us;
7695 exp->string = PrintUShort(op1->us &= value2);
7698 exp->expType = op1->type;
7700 op1->type->refCount++;
7705 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7707 char value2 = op2->c;
7710 exp->string = PrintChar(op1->c &= value2);
7713 exp->expType = op1->type;
7715 op1->type->refCount++;
7720 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7722 unsigned char value2 = op2->uc;
7725 exp->string = PrintUChar(op1->uc &= value2);
7728 exp->expType = op1->type;
7730 op1->type->refCount++;
7735 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7737 int value2 = op2->i;
7740 exp->string = PrintInt(op1->i |= value2);
7743 exp->expType = op1->type;
7745 op1->type->refCount++;
7750 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7752 unsigned int value2 = op2->ui;
7755 exp->string = PrintUInt(op1->ui |= value2);
7758 exp->expType = op1->type;
7760 op1->type->refCount++;
7765 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7767 short value2 = op2->s;
7770 exp->string = PrintShort(op1->s |= value2);
7773 exp->expType = op1->type;
7775 op1->type->refCount++;
7780 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7782 unsigned short value2 = op2->us;
7785 exp->string = PrintUShort(op1->us |= value2);
7788 exp->expType = op1->type;
7790 op1->type->refCount++;
7795 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7797 char value2 = op2->c;
7800 exp->string = PrintChar(op1->c |= value2);
7803 exp->expType = op1->type;
7805 op1->type->refCount++;
7810 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7812 unsigned char value2 = op2->uc;
7815 exp->string = PrintUChar(op1->uc |= value2);
7818 exp->expType = op1->type;
7820 op1->type->refCount++;
7825 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7827 int value2 = op2->i;
7830 exp->string = PrintInt(op1->i ^= value2);
7833 exp->expType = op1->type;
7835 op1->type->refCount++;
7840 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7842 unsigned int value2 = op2->ui;
7845 exp->string = PrintUInt(op1->ui ^= value2);
7848 exp->expType = op1->type;
7850 op1->type->refCount++;
7855 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7857 short value2 = op2->s;
7860 exp->string = PrintShort(op1->s ^= value2);
7863 exp->expType = op1->type;
7865 op1->type->refCount++;
7870 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7872 unsigned short value2 = op2->us;
7875 exp->string = PrintUShort(op1->us ^= value2);
7878 exp->expType = op1->type;
7880 op1->type->refCount++;
7885 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7887 char value2 = op2->c;
7890 exp->string = PrintChar(op1->c ^= value2);
7893 exp->expType = op1->type;
7895 op1->type->refCount++;
7900 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7902 unsigned char value2 = op2->uc;
7905 exp->string = PrintUChar(op1->uc ^= value2);
7908 exp->expType = op1->type;
7910 op1->type->refCount++;
7915 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7917 int value2 = op2->i;
7920 exp->string = PrintInt(op1->i <<= value2);
7923 exp->expType = op1->type;
7925 op1->type->refCount++;
7930 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7932 unsigned int value2 = op2->ui;
7935 exp->string = PrintUInt(op1->ui <<= value2);
7938 exp->expType = op1->type;
7940 op1->type->refCount++;
7945 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7947 short value2 = op2->s;
7950 exp->string = PrintShort(op1->s <<= value2);
7953 exp->expType = op1->type;
7955 op1->type->refCount++;
7960 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7962 unsigned short value2 = op2->us;
7965 exp->string = PrintUShort(op1->us <<= value2);
7968 exp->expType = op1->type;
7970 op1->type->refCount++;
7975 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7977 char value2 = op2->c;
7980 exp->string = PrintChar(op1->c <<= value2);
7983 exp->expType = op1->type;
7985 op1->type->refCount++;
7990 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7992 unsigned char value2 = op2->uc;
7995 exp->string = PrintUChar(op1->uc <<= value2);
7998 exp->expType = op1->type;
8000 op1->type->refCount++;
8005 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8007 int value2 = op2->i;
8010 exp->string = PrintInt(op1->i >>= value2);
8013 exp->expType = op1->type;
8015 op1->type->refCount++;
8020 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8022 unsigned int value2 = op2->ui;
8025 exp->string = PrintUInt(op1->ui >>= value2);
8028 exp->expType = op1->type;
8030 op1->type->refCount++;
8035 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8037 short value2 = op2->s;
8040 exp->string = PrintShort(op1->s >>= value2);
8043 exp->expType = op1->type;
8045 op1->type->refCount++;
8050 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8052 unsigned short value2 = op2->us;
8055 exp->string = PrintUShort(op1->us >>= value2);
8058 exp->expType = op1->type;
8060 op1->type->refCount++;
8065 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8067 char value2 = op2->c;
8070 exp->string = PrintChar(op1->c >>= value2);
8073 exp->expType = op1->type;
8075 op1->type->refCount++;
8080 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8082 unsigned char value2 = op2->uc;
8085 exp->string = PrintUChar(op1->uc >>= value2);
8088 exp->expType = op1->type;
8090 op1->type->refCount++;
8095 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8098 exp->string = PrintInt(!op1->i);
8101 exp->expType = op1->type;
8103 op1->type->refCount++;
8108 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8111 exp->string = PrintUInt(!op1->ui);
8114 exp->expType = op1->type;
8116 op1->type->refCount++;
8121 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8124 exp->string = PrintShort(!op1->s);
8127 exp->expType = op1->type;
8129 op1->type->refCount++;
8134 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8137 exp->string = PrintUShort(!op1->us);
8140 exp->expType = op1->type;
8142 op1->type->refCount++;
8147 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8150 exp->string = PrintChar(!op1->c);
8153 exp->expType = op1->type;
8155 op1->type->refCount++;
8160 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8163 exp->string = PrintUChar(!op1->uc);
8166 exp->expType = op1->type;
8168 op1->type->refCount++;
8173 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8175 int value2 = op2->i;
8178 exp->string = PrintInt(op1->i == value2);
8181 exp->expType = op1->type;
8183 op1->type->refCount++;
8188 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8190 unsigned int value2 = op2->ui;
8193 exp->string = PrintUInt(op1->ui == value2);
8196 exp->expType = op1->type;
8198 op1->type->refCount++;
8203 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8205 short value2 = op2->s;
8208 exp->string = PrintShort(op1->s == value2);
8211 exp->expType = op1->type;
8213 op1->type->refCount++;
8218 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8220 unsigned short value2 = op2->us;
8223 exp->string = PrintUShort(op1->us == value2);
8226 exp->expType = op1->type;
8228 op1->type->refCount++;
8233 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8235 char value2 = op2->c;
8238 exp->string = PrintChar(op1->c == value2);
8241 exp->expType = op1->type;
8243 op1->type->refCount++;
8248 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8250 unsigned char value2 = op2->uc;
8253 exp->string = PrintUChar(op1->uc == value2);
8256 exp->expType = op1->type;
8258 op1->type->refCount++;
8263 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8265 float value2 = op2->f;
8268 exp->string = PrintFloat(op1->f == value2);
8271 exp->expType = op1->type;
8273 op1->type->refCount++;
8278 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8280 double value2 = op2->d;
8283 exp->string = PrintDouble(op1->d == value2);
8286 exp->expType = op1->type;
8288 op1->type->refCount++;
8293 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8295 int value2 = op2->i;
8298 exp->string = PrintInt(op1->i != value2);
8301 exp->expType = op1->type;
8303 op1->type->refCount++;
8308 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8310 unsigned int value2 = op2->ui;
8313 exp->string = PrintUInt(op1->ui != value2);
8316 exp->expType = op1->type;
8318 op1->type->refCount++;
8323 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8325 short value2 = op2->s;
8328 exp->string = PrintShort(op1->s != value2);
8331 exp->expType = op1->type;
8333 op1->type->refCount++;
8338 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8340 unsigned short value2 = op2->us;
8343 exp->string = PrintUShort(op1->us != value2);
8346 exp->expType = op1->type;
8348 op1->type->refCount++;
8353 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8355 char value2 = op2->c;
8358 exp->string = PrintChar(op1->c != value2);
8361 exp->expType = op1->type;
8363 op1->type->refCount++;
8368 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8370 unsigned char value2 = op2->uc;
8373 exp->string = PrintUChar(op1->uc != value2);
8376 exp->expType = op1->type;
8378 op1->type->refCount++;
8383 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8385 float value2 = op2->f;
8388 exp->string = PrintFloat(op1->f != value2);
8391 exp->expType = op1->type;
8393 op1->type->refCount++;
8398 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8400 double value2 = op2->d;
8403 exp->string = PrintDouble(op1->d != value2);
8406 exp->expType = op1->type;
8408 op1->type->refCount++;
8413 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8415 int value2 = op2->i;
8418 exp->string = PrintInt(op1->i && value2);
8421 exp->expType = op1->type;
8423 op1->type->refCount++;
8428 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8430 unsigned int value2 = op2->ui;
8433 exp->string = PrintUInt(op1->ui && value2);
8436 exp->expType = op1->type;
8438 op1->type->refCount++;
8443 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8445 short value2 = op2->s;
8448 exp->string = PrintShort(op1->s && value2);
8451 exp->expType = op1->type;
8453 op1->type->refCount++;
8458 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8460 unsigned short value2 = op2->us;
8463 exp->string = PrintUShort(op1->us && value2);
8466 exp->expType = op1->type;
8468 op1->type->refCount++;
8473 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8475 char value2 = op2->c;
8478 exp->string = PrintChar(op1->c && value2);
8481 exp->expType = op1->type;
8483 op1->type->refCount++;
8488 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8490 unsigned char value2 = op2->uc;
8493 exp->string = PrintUChar(op1->uc && value2);
8496 exp->expType = op1->type;
8498 op1->type->refCount++;
8503 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8505 float value2 = op2->f;
8508 exp->string = PrintFloat(op1->f && value2);
8511 exp->expType = op1->type;
8513 op1->type->refCount++;
8518 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8520 double value2 = op2->d;
8523 exp->string = PrintDouble(op1->d && value2);
8526 exp->expType = op1->type;
8528 op1->type->refCount++;
8533 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8535 int value2 = op2->i;
8538 exp->string = PrintInt(op1->i || value2);
8541 exp->expType = op1->type;
8543 op1->type->refCount++;
8548 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8550 unsigned int value2 = op2->ui;
8553 exp->string = PrintUInt(op1->ui || value2);
8556 exp->expType = op1->type;
8558 op1->type->refCount++;
8563 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8565 short value2 = op2->s;
8568 exp->string = PrintShort(op1->s || value2);
8571 exp->expType = op1->type;
8573 op1->type->refCount++;
8578 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8580 unsigned short value2 = op2->us;
8583 exp->string = PrintUShort(op1->us || value2);
8586 exp->expType = op1->type;
8588 op1->type->refCount++;
8593 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8595 char value2 = op2->c;
8598 exp->string = PrintChar(op1->c || value2);
8601 exp->expType = op1->type;
8603 op1->type->refCount++;
8608 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8610 unsigned char value2 = op2->uc;
8613 exp->string = PrintUChar(op1->uc || value2);
8616 exp->expType = op1->type;
8618 op1->type->refCount++;
8623 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8625 float value2 = op2->f;
8628 exp->string = PrintFloat(op1->f || value2);
8631 exp->expType = op1->type;
8633 op1->type->refCount++;
8638 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8640 double value2 = op2->d;
8643 exp->string = PrintDouble(op1->d || value2);
8646 exp->expType = op1->type;
8648 op1->type->refCount++;
8653 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8655 int value2 = op2->i;
8658 exp->string = PrintInt(op1->i > value2);
8661 exp->expType = op1->type;
8663 op1->type->refCount++;
8668 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8670 unsigned int value2 = op2->ui;
8673 exp->string = PrintUInt(op1->ui > value2);
8676 exp->expType = op1->type;
8678 op1->type->refCount++;
8683 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8685 short value2 = op2->s;
8688 exp->string = PrintShort(op1->s > value2);
8691 exp->expType = op1->type;
8693 op1->type->refCount++;
8698 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8700 unsigned short value2 = op2->us;
8703 exp->string = PrintUShort(op1->us > value2);
8706 exp->expType = op1->type;
8708 op1->type->refCount++;
8713 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8715 char value2 = op2->c;
8718 exp->string = PrintChar(op1->c > value2);
8721 exp->expType = op1->type;
8723 op1->type->refCount++;
8728 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8730 unsigned char value2 = op2->uc;
8733 exp->string = PrintUChar(op1->uc > value2);
8736 exp->expType = op1->type;
8738 op1->type->refCount++;
8743 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8745 float value2 = op2->f;
8748 exp->string = PrintFloat(op1->f > value2);
8751 exp->expType = op1->type;
8753 op1->type->refCount++;
8758 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8760 double value2 = op2->d;
8763 exp->string = PrintDouble(op1->d > value2);
8766 exp->expType = op1->type;
8768 op1->type->refCount++;
8773 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8775 int value2 = op2->i;
8778 exp->string = PrintInt(op1->i < value2);
8781 exp->expType = op1->type;
8783 op1->type->refCount++;
8788 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8790 unsigned int value2 = op2->ui;
8793 exp->string = PrintUInt(op1->ui < value2);
8796 exp->expType = op1->type;
8798 op1->type->refCount++;
8803 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8805 short value2 = op2->s;
8808 exp->string = PrintShort(op1->s < value2);
8811 exp->expType = op1->type;
8813 op1->type->refCount++;
8818 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8820 unsigned short value2 = op2->us;
8823 exp->string = PrintUShort(op1->us < value2);
8826 exp->expType = op1->type;
8828 op1->type->refCount++;
8833 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8835 char value2 = op2->c;
8838 exp->string = PrintChar(op1->c < value2);
8841 exp->expType = op1->type;
8843 op1->type->refCount++;
8848 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8850 unsigned char value2 = op2->uc;
8853 exp->string = PrintUChar(op1->uc < value2);
8856 exp->expType = op1->type;
8858 op1->type->refCount++;
8863 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8865 float value2 = op2->f;
8868 exp->string = PrintFloat(op1->f < value2);
8871 exp->expType = op1->type;
8873 op1->type->refCount++;
8878 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8880 double value2 = op2->d;
8883 exp->string = PrintDouble(op1->d < value2);
8886 exp->expType = op1->type;
8888 op1->type->refCount++;
8893 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8895 int value2 = op2->i;
8898 exp->string = PrintInt(op1->i >= value2);
8901 exp->expType = op1->type;
8903 op1->type->refCount++;
8908 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8910 unsigned int value2 = op2->ui;
8913 exp->string = PrintUInt(op1->ui >= value2);
8916 exp->expType = op1->type;
8918 op1->type->refCount++;
8923 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8925 short value2 = op2->s;
8928 exp->string = PrintShort(op1->s >= value2);
8931 exp->expType = op1->type;
8933 op1->type->refCount++;
8938 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8940 unsigned short value2 = op2->us;
8943 exp->string = PrintUShort(op1->us >= value2);
8946 exp->expType = op1->type;
8948 op1->type->refCount++;
8953 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8955 char value2 = op2->c;
8958 exp->string = PrintChar(op1->c >= value2);
8961 exp->expType = op1->type;
8963 op1->type->refCount++;
8968 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8970 unsigned char value2 = op2->uc;
8973 exp->string = PrintUChar(op1->uc >= value2);
8976 exp->expType = op1->type;
8978 op1->type->refCount++;
8983 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8985 float value2 = op2->f;
8988 exp->string = PrintFloat(op1->f >= value2);
8991 exp->expType = op1->type;
8993 op1->type->refCount++;
8998 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9000 double value2 = op2->d;
9003 exp->string = PrintDouble(op1->d >= value2);
9006 exp->expType = op1->type;
9008 op1->type->refCount++;
9013 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9015 int value2 = op2->i;
9018 exp->string = PrintInt(op1->i <= value2);
9021 exp->expType = op1->type;
9023 op1->type->refCount++;
9028 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9030 unsigned int value2 = op2->ui;
9033 exp->string = PrintUInt(op1->ui <= value2);
9036 exp->expType = op1->type;
9038 op1->type->refCount++;
9043 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9045 short value2 = op2->s;
9048 exp->string = PrintShort(op1->s <= value2);
9051 exp->expType = op1->type;
9053 op1->type->refCount++;
9058 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9060 unsigned short value2 = op2->us;
9063 exp->string = PrintUShort(op1->us <= value2);
9066 exp->expType = op1->type;
9068 op1->type->refCount++;
9073 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9075 char value2 = op2->c;
9078 exp->string = PrintChar(op1->c <= value2);
9081 exp->expType = op1->type;
9083 op1->type->refCount++;
9088 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9090 unsigned char value2 = op2->uc;
9093 exp->string = PrintUChar(op1->uc <= value2);
9096 exp->expType = op1->type;
9098 op1->type->refCount++;
9103 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9105 float value2 = op2->f;
9108 exp->string = PrintFloat(op1->f <= value2);
9111 exp->expType = op1->type;
9113 op1->type->refCount++;
9118 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9120 double value2 = op2->d;
9123 exp->string = PrintDouble(op1->d <= value2);
9126 exp->expType = op1->type;
9128 op1->type->refCount++;
9133 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9136 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9139 exp->expType = op1->type;
9141 op1->type->refCount++;
9146 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9149 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9152 exp->expType = op1->type;
9154 op1->type->refCount++;
9159 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9162 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9165 exp->expType = op1->type;
9167 op1->type->refCount++;
9172 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9175 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9178 exp->expType = op1->type;
9180 op1->type->refCount++;
9185 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9188 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9191 exp->expType = op1->type;
9193 op1->type->refCount++;
9198 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9201 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9204 exp->expType = op1->type;
9206 op1->type->refCount++;
9211 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9214 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9217 exp->expType = op1->type;
9219 op1->type->refCount++;
9224 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9227 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9230 exp->expType = op1->type;
9232 op1->type->refCount++;
9237 struct OpTable intOps =
9239 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
9242 struct OpTable uintOps =
9244 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
9247 struct OpTable shortOps =
9249 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
9252 struct OpTable ushortOps =
9254 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
9257 struct OpTable floatOps =
9259 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
9262 struct OpTable doubleOps =
9264 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
9267 struct OpTable charOps =
9269 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
9272 struct OpTable ucharOps =
9274 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
9277 void ReadString(char * output, char * string)
9279 int len = strlen(string);
9281 unsigned int quoted = 0x0, escaped = 0x0;
9283 for(c = 0; c < len; c++)
9285 char ch = string[c];
9341 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9343 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9345 extern double strtod(char * , char * * );
9347 struct Operand GetOperand(struct Expression * exp)
9353 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9356 struct Type * type = exp->expType;
9360 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9362 if(!type->_class->registered->dataType)
9363 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9364 type = type->_class->registered->dataType;
9366 op.kind = type->kind;
9367 op.type = exp->expType;
9368 if(exp->isConstant && exp->type == 2)
9374 if(exp->constant[0] == '\'')
9375 op.c = exp->constant[1];
9376 else if(type->isSigned)
9378 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9383 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9391 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9396 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9404 op.i = strtol(exp->constant, (((void *)0)), 0);
9409 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9417 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9422 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9430 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9435 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9443 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9448 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9454 op.f = (float)strtod(exp->constant, (((void *)0)));
9458 op.d = (double)strtod(exp->constant, (((void *)0)));
9464 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9474 int __ecereVMethodID_class_OnGetString;
9476 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9478 static void UnusedFunction()
9482 ((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);
9485 extern int __ecereVMethodID_class_OnGetString;
9487 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9489 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9491 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9493 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9494 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9497 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9498 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9500 void * ptr = inst->data + dataMember->offset + offset;
9501 char * result = (((void *)0));
9503 exp->loc = member->loc = inst->loc;
9504 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9505 if(!dataMember->dataType)
9506 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9507 type = dataMember->dataType;
9510 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9512 if(_class->type == 4)
9514 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9518 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9519 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9521 for(item = e->values.first; item; item = item->next)
9523 if((int)item->data == *(int *)ptr)
9525 result = item->name;
9531 exp->identifier = MkIdentifier(result);
9533 exp->destType = MkClassType(_class->fullName);
9534 ProcessExpressionType(exp);
9538 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9540 if(!_class->dataType)
9541 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9542 type = _class->dataType;
9551 FreeExpContents(exp);
9552 exp->constant = PrintFloat(*(float *)ptr);
9558 FreeExpContents(exp);
9559 exp->constant = PrintDouble(*(double *)ptr);
9565 FreeExpContents(exp);
9566 exp->constant = PrintInt(*(int *)ptr);
9572 FreeExpContents(exp);
9573 exp->constant = PrintInt64(*(long long *)ptr);
9579 FreeExpContents(exp);
9580 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9586 FreeExpContents(exp);
9587 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9592 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9595 ListAdd(memberList, member);
9597 if(parentDataMember->type == 1)
9602 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9604 void PopulateInstance(struct Instantiation * inst)
9606 struct Symbol * classSym = inst->_class->symbol;
9607 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9608 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9609 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9611 inst->members = MkListOne(MkMembersInitList(memberList));
9612 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9614 if(!dataMember->isProperty)
9616 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9617 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9620 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9621 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9623 void * ptr = inst->data + dataMember->offset;
9624 char * result = (((void *)0));
9626 exp->loc = member->loc = inst->loc;
9627 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9628 if(!dataMember->dataType)
9629 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9630 type = dataMember->dataType;
9633 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9635 if(_class->type == 4)
9637 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9641 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9642 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9644 for(item = e->values.first; item; item = item->next)
9646 if((int)item->data == *(int *)ptr)
9648 result = item->name;
9655 exp->identifier = MkIdentifier(result);
9657 exp->destType = MkClassType(_class->fullName);
9658 ProcessExpressionType(exp);
9661 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9663 if(!_class->dataType)
9664 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9665 type = _class->dataType;
9674 exp->constant = PrintFloat(*(float *)ptr);
9680 exp->constant = PrintDouble(*(double *)ptr);
9686 exp->constant = PrintInt(*(int *)ptr);
9692 exp->constant = PrintInt64(*(long long *)ptr);
9698 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9703 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9706 ListAdd(memberList, member);
9712 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);
9714 extern void FreeInstance(struct Instantiation * inst);
9716 void ComputeInstantiation(struct Expression * exp)
9718 struct Instantiation * inst = exp->instance;
9719 struct MembersInit * members;
9720 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9721 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9722 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9723 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9724 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9725 int subMemberStackPos = 0;
9728 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9732 if(_class->type == 0 || _class->type == 5)
9733 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9735 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9739 for(members = (*inst->members).first; members; members = members->next)
9741 switch(members->type)
9745 if(members->dataMembers)
9747 struct MemberInit * member;
9749 for(member = (*members->dataMembers).first; member; member = member->next)
9751 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9752 unsigned int found = 0x0;
9753 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9754 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9755 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9756 unsigned int dataMemberOffset;
9760 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9763 if(curMember->isProperty)
9764 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9767 dataMember = curMember;
9768 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9775 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9779 if(prop->memberAccess == 1)
9781 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9782 curClass = prop->_class;
9787 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9788 int _subMemberStackPos = 0;
9790 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9794 if(dataMember->memberAccess == 1)
9796 curMember = dataMember;
9797 curClass = dataMember->_class;
9798 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9799 subMemberStackPos = _subMemberStackPos;
9804 if(found && member->initializer && member->initializer->type == 0)
9806 struct Expression * value = member->initializer->exp;
9807 struct Type * type = (((void *)0));
9811 type = prop->dataType;
9815 if(!dataMember->dataType)
9816 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9817 type = dataMember->dataType;
9819 if(ident && ident->next)
9821 for(ident = ident->next; ident && type; ident = ident->next)
9825 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9827 type = prop->dataType;
9830 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9832 type = dataMember->dataType;
9835 else if(type->kind == 9 || type->kind == 10)
9837 struct Type * memberType;
9839 for(memberType = type->members.first; memberType; memberType = memberType->next)
9841 if(!strcmp(memberType->name, ident->string))
9852 FreeType(value->destType);
9853 value->destType = type;
9856 ComputeExpression(value);
9858 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9862 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9864 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9866 if(!_class->dataType)
9867 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9868 type = _class->dataType;
9873 void * ptr = inst->data + dataMemberOffset;
9875 if(value->type == 2)
9881 GetInt(value, (int *)ptr);
9886 GetInt64(value, (long long *)ptr);
9891 GetIntPtr(value, (intptr_t *)ptr);
9896 GetIntSize(value, (ssize_t *)ptr);
9901 GetFloat(value, (float *)ptr);
9906 GetDouble(value, (double *)ptr);
9911 else if(value->type == 1)
9915 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9917 if(_class->type == 1)
9919 ComputeTypeSize(type);
9920 if(value->instance->data)
9921 memcpy(ptr, value->instance->data, type->size);
9928 if(value->type == 1 && value->instance->data)
9930 void (* Set)(void *, void *) = (void *)prop->Set;
9932 Set(inst->data, value->instance->data);
9933 PopulateInstance(inst);
9935 else if(value->type == 2)
9941 void (* Set)(void *, double) = (void *)prop->Set;
9943 Set(inst->data, strtod(value->constant, (((void *)0))));
9948 void (* Set)(void *, float) = (void *)prop->Set;
9950 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9955 void (* Set)(void *, int) = (void *)prop->Set;
9957 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9962 void (* Set)(void *, long long) = (void *)prop->Set;
9964 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9969 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9971 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9976 void (* Set)(void *, ssize_t) = (void *)prop->Set;
9978 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9983 else if(value->type == 3)
9987 ReadString(temp, value->string);
9988 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
9992 else if(_class->type == 3)
9996 if(value->type == 2)
10000 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10002 if(_class->type == 3)
10004 if(!_class->dataType)
10005 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10006 type = _class->dataType;
10014 float (* Set)(float) = (void *)prop->Set;
10016 GetFloat(member->initializer->exp, &fValue);
10017 exp->constant = PrintFloat(Set(fValue));
10024 double (* Set)(double) = (void *)prop->Set;
10026 GetDouble(member->initializer->exp, &dValue);
10027 exp->constant = PrintDouble(Set(dValue));
10035 else if(_class->type == 2)
10039 if(value->type == 1 && value->instance->data)
10041 unsigned int (* Set)(void *) = (void *)prop->Set;
10043 bits = Set(value->instance->data);
10045 else if(value->type == 2)
10049 else if(dataMember)
10051 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10052 struct Type * type;
10055 GetInt(value, &part);
10056 bits = (bits & ~bitMember->mask);
10057 if(!bitMember->dataType)
10058 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10059 type = bitMember->dataType;
10060 if(type->kind == 8 && type->_class && type->_class->registered)
10062 if(!type->_class->registered->dataType)
10063 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10064 type = type->_class->registered->dataType;
10070 bits |= ((char)part << bitMember->pos);
10072 bits |= ((unsigned char)part << bitMember->pos);
10076 bits |= ((short)part << bitMember->pos);
10078 bits |= ((unsigned short)part << bitMember->pos);
10083 bits |= (part << bitMember->pos);
10085 bits |= ((unsigned int)part << bitMember->pos);
10089 bits |= ((long long)part << bitMember->pos);
10091 bits |= ((uint64)part << bitMember->pos);
10095 bits |= ((intptr_t)part << bitMember->pos);
10097 bits |= ((uintptr_t)part << bitMember->pos);
10101 bits |= ((ssize_t)part << bitMember->pos);
10103 bits |= ((size_t)part << bitMember->pos);
10111 if(_class && _class->type == 3)
10113 ComputeExpression(member->initializer->exp);
10114 exp->constant = member->initializer->exp->constant;
10116 member->initializer->exp->constant = (((void *)0));
10126 if(_class && _class->type == 2)
10128 exp->constant = PrintHexUInt(bits);
10133 FreeInstance(inst);
10137 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10139 if(exp->op.op == SIZEOF)
10141 FreeExpContents(exp);
10143 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10153 struct Expression * exp2 = exp->op.exp2;
10155 exp->op.exp2 = (((void *)0));
10156 FreeExpContents(exp);
10157 FreeType(exp->expType);
10158 FreeType(exp->destType);
10160 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10166 FreeExpContents(exp);
10167 op1->ops.Neg(exp, op1);
10171 if(op1->ops.BitNot)
10173 FreeExpContents(exp);
10174 op1->ops.BitNot(exp, op1);
10180 FreeExpContents(exp);
10181 op1->ops.Not(exp, op1);
10193 FreeExpContents(exp);
10194 op1->ops.Add(exp, op1, op2);
10200 FreeExpContents(exp);
10201 op1->ops.Sub(exp, op1, op2);
10207 FreeExpContents(exp);
10208 op1->ops.Mul(exp, op1, op2);
10214 FreeExpContents(exp);
10215 op1->ops.Div(exp, op1, op2);
10221 FreeExpContents(exp);
10222 op1->ops.Mod(exp, op1, op2);
10228 if(op1->ops.BitAnd)
10230 FreeExpContents(exp);
10231 op1->ops.BitAnd(exp, op1, op2);
10238 FreeExpContents(exp);
10239 op1->ops.BitOr(exp, op1, op2);
10243 if(op1->ops.BitXor)
10245 FreeExpContents(exp);
10246 op1->ops.BitXor(exp, op1, op2);
10250 if(op1->ops.LShift)
10252 FreeExpContents(exp);
10253 op1->ops.LShift(exp, op1, op2);
10257 if(op1->ops.RShift)
10259 FreeExpContents(exp);
10260 op1->ops.RShift(exp, op1, op2);
10266 FreeExpContents(exp);
10267 op1->ops.Equ(exp, op1, op2);
10273 FreeExpContents(exp);
10274 op1->ops.Nqu(exp, op1, op2);
10280 FreeExpContents(exp);
10281 op1->ops.And(exp, op1, op2);
10287 FreeExpContents(exp);
10288 op1->ops.Or(exp, op1, op2);
10294 FreeExpContents(exp);
10295 op1->ops.Grt(exp, op1, op2);
10301 FreeExpContents(exp);
10302 op1->ops.Sma(exp, op1, op2);
10306 if(op1->ops.GrtEqu)
10308 FreeExpContents(exp);
10309 op1->ops.GrtEqu(exp, op1, op2);
10313 if(op1->ops.SmaEqu)
10315 FreeExpContents(exp);
10316 op1->ops.SmaEqu(exp, op1, op2);
10324 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10326 void ComputeExpression(struct Expression * exp)
10328 char expString[10240];
10330 expString[0] = '\0';
10335 ComputeInstantiation(exp);
10340 struct Expression * exp1, * exp2 = (((void *)0));
10341 struct Operand op1 =
10345 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10348 struct Operand op2 =
10352 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10357 ComputeExpression(exp->op.exp2);
10360 ComputeExpression(exp->op.exp1);
10361 exp1 = exp->op.exp1;
10362 exp2 = exp->op.exp2;
10363 op1 = GetOperand(exp1);
10365 op1.type->refCount++;
10368 op2 = GetOperand(exp2);
10370 op2.type->refCount++;
10375 exp1 = exp->op.exp2;
10376 op1 = GetOperand(exp1);
10378 op1.type->refCount++;
10380 CallOperator(exp, exp1, exp2, &op1, &op2);
10382 FreeType(op1.type);
10384 FreeType(op2.type);
10390 struct Expression * e, * n;
10392 for(e = (*exp->list).first; e; e = n)
10397 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10399 ComputeExpression(e);
10400 FreeType(exp->expType);
10401 FreeType(exp->destType);
10403 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10404 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10415 struct Expression * memberExp = exp->member.exp;
10416 struct Identifier * memberID = exp->member.member;
10417 struct Type * type;
10419 ComputeExpression(exp->member.exp);
10420 type = exp->member.exp->expType;
10423 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)));
10424 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10425 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10426 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10428 if(type->kind == 19 && exp->member.exp->type == 26)
10429 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10433 struct Symbol * classSym;
10436 PrintType(type, string, 0x0, 0x1);
10437 classSym = FindClass(string);
10438 _class = classSym ? classSym->registered : (((void *)0));
10440 if(exp->member.member)
10442 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10444 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10446 if(!prop && !member && _class && exp->member.member)
10448 struct Symbol * classSym = FindClass(exp->member.member->string);
10450 convertTo = _class;
10451 _class = classSym ? classSym->registered : (((void *)0));
10452 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10458 struct Type * type = prop->dataType;
10460 if(_class->type == 3)
10462 if(type->kind == 8)
10464 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10466 if(_class->type == 3)
10468 if(!_class->dataType)
10469 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10470 type = _class->dataType;
10478 float (* Get)(float) = (void *)prop->Get;
10480 GetFloat(exp->member.exp, &value);
10481 exp->constant = PrintFloat(Get ? Get(value) : value);
10488 double (* Get)(double);
10490 GetDouble(exp->member.exp, &value);
10492 Get = (void *)prop->Set;
10494 Get = (void *)prop->Get;
10495 exp->constant = PrintDouble(Get ? Get(value) : value);
10505 struct Expression * value = exp->member.exp;
10506 struct Type * type;
10508 if(!prop->dataType)
10509 ProcessPropertyType(prop);
10510 type = prop->dataType;
10514 else if(_class->type == 1)
10520 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10522 if(propertyClass->type == 1 && value->type == 1)
10524 void (* Set)(void *, void *) = (void *)prop->Set;
10526 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10527 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10528 exp->instance->_class = MkSpecifierName(_class->fullName);
10529 exp->instance->loc = exp->loc;
10531 Set(exp->instance->data, value->instance->data);
10532 PopulateInstance(exp->instance);
10539 void (* Set)(void *, int) = (void *)prop->Set;
10541 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10542 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10543 exp->instance->_class = MkSpecifierName(_class->fullName);
10544 exp->instance->loc = exp->loc;
10546 GetInt(value, &intValue);
10547 Set(exp->instance->data, intValue);
10548 PopulateInstance(exp->instance);
10553 long long intValue;
10554 void (* Set)(void *, long long) = (void *)prop->Set;
10556 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10557 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10558 exp->instance->_class = MkSpecifierName(_class->fullName);
10559 exp->instance->loc = exp->loc;
10561 GetInt64(value, &intValue);
10562 Set(exp->instance->data, intValue);
10563 PopulateInstance(exp->instance);
10569 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10571 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10572 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10573 exp->instance->_class = MkSpecifierName(_class->fullName);
10574 exp->instance->loc = exp->loc;
10576 GetIntPtr(value, &intValue);
10577 Set(exp->instance->data, intValue);
10578 PopulateInstance(exp->instance);
10584 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10586 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10587 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10588 exp->instance->_class = MkSpecifierName(_class->fullName);
10589 exp->instance->loc = exp->loc;
10591 GetIntSize(value, &intValue);
10592 Set(exp->instance->data, intValue);
10593 PopulateInstance(exp->instance);
10598 double doubleValue;
10599 void (* Set)(void *, double) = (void *)prop->Set;
10601 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10602 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10603 exp->instance->_class = MkSpecifierName(_class->fullName);
10604 exp->instance->loc = exp->loc;
10606 GetDouble(value, &doubleValue);
10607 Set(exp->instance->data, doubleValue);
10608 PopulateInstance(exp->instance);
10613 else if(_class->type == 2)
10619 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10621 if(propertyClass->type == 1 && value->instance->data)
10623 unsigned int (* Set)(void *) = (void *)prop->Set;
10624 unsigned int bits = Set(value->instance->data);
10626 exp->constant = PrintHexUInt(bits);
10630 else if(_class->type == 2)
10632 unsigned int value;
10633 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10636 GetUInt(exp->member.exp, &value);
10638 exp->constant = PrintHexUInt(bits);
10647 if(_class->type == 2)
10649 unsigned int value;
10651 GetUInt(exp->member.exp, &value);
10656 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10658 if(_class->type == 1)
10660 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10662 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10663 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10664 exp->instance->_class = MkSpecifierName(_class->fullName);
10665 exp->instance->loc = exp->loc;
10667 Get(value, exp->instance->data);
10668 PopulateInstance(exp->instance);
10670 else if(_class->type == 2)
10672 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10673 uint64 bits = Get(value);
10675 exp->constant = PrintHexUInt64(bits);
10682 else if(_class->type == 1)
10684 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10690 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10692 if(_class->type == 1 && value)
10694 void (* Get)(void *, void *) = (void *)prop->Get;
10696 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10697 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10698 exp->instance->_class = MkSpecifierName(_class->fullName);
10699 exp->instance->loc = exp->loc;
10701 Get(value, exp->instance->data);
10702 PopulateInstance(exp->instance);
10713 exp->isConstant = 0x0;
10722 FreeExpression(memberExp);
10723 FreeIdentifier(memberID);
10729 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10731 FreeExpContents(exp);
10732 exp->constant = PrintUInt(ComputeTypeSize(type));
10739 struct Symbol * classSym = exp->_class->symbol;
10741 if(classSym && classSym->registered)
10743 if(classSym->registered->fixed)
10745 FreeSpecifier(exp->_class);
10746 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10751 char className[1024];
10753 strcpy(className, "__ecereClass_");
10754 FullClassNameCat(className, classSym->string, 0x1);
10755 MangleClassName(className);
10756 FreeExpContents(exp);
10758 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10759 exp->member.member = MkIdentifier("structSize");
10766 struct Type * type;
10767 struct Expression * e = exp;
10769 if(exp->type == 11)
10772 ComputeExpression(exp->cast.exp);
10775 if(e && exp->expType)
10777 type = exp->expType;
10778 if(type->kind == 8)
10780 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10782 if(_class && (_class->type == 3 || _class->type == 2))
10784 if(!_class->dataType)
10785 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10786 type = _class->dataType;
10796 GetChar(e, &value);
10797 FreeExpContents(exp);
10798 exp->constant = PrintChar(value);
10803 unsigned char value;
10805 GetUChar(e, &value);
10806 FreeExpContents(exp);
10807 exp->constant = PrintUChar(value);
10816 GetShort(e, &value);
10817 FreeExpContents(exp);
10818 exp->constant = PrintShort(value);
10823 unsigned short value;
10825 GetUShort(e, &value);
10826 FreeExpContents(exp);
10827 exp->constant = PrintUShort(value);
10837 FreeExpContents(exp);
10838 exp->constant = PrintInt(value);
10843 unsigned int value;
10845 GetUInt(e, &value);
10846 FreeExpContents(exp);
10847 exp->constant = PrintUInt(value);
10856 GetInt64(e, &value);
10857 FreeExpContents(exp);
10858 exp->constant = PrintInt64(value);
10865 GetUInt64(e, &value);
10866 FreeExpContents(exp);
10867 exp->constant = PrintUInt64(value);
10876 GetIntPtr(e, &value);
10877 FreeExpContents(exp);
10878 exp->constant = PrintInt64((long long)value);
10885 GetUIntPtr(e, &value);
10886 FreeExpContents(exp);
10887 exp->constant = PrintUInt64((uint64)value);
10896 GetIntSize(e, &value);
10897 FreeExpContents(exp);
10898 exp->constant = PrintInt64((long long)value);
10905 GetUIntSize(e, &value);
10906 FreeExpContents(exp);
10907 exp->constant = PrintUInt64((uint64)value);
10915 GetFloat(e, &value);
10916 FreeExpContents(exp);
10917 exp->constant = PrintFloat(value);
10925 GetDouble(e, &value);
10926 FreeExpContents(exp);
10927 exp->constant = PrintDouble(value);
10937 struct Operand op1 =
10941 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10944 struct Operand op2 =
10948 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10951 struct Operand op3 =
10955 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10960 ComputeExpression((*exp->cond.exp).last);
10961 if(exp->cond.elseExp)
10962 ComputeExpression(exp->cond.elseExp);
10964 ComputeExpression(exp->cond.cond);
10965 op1 = GetOperand(exp->cond.cond);
10967 op1.type->refCount++;
10968 op2 = GetOperand((*exp->cond.exp).last);
10970 op2.type->refCount++;
10971 op3 = GetOperand(exp->cond.elseExp);
10973 op3.type->refCount++;
10976 FreeExpContents(exp);
10977 op1.ops.Cond(exp, &op1, &op2, &op3);
10980 FreeType(op1.type);
10982 FreeType(op2.type);
10984 FreeType(op3.type);
10990 void ApplyAnyObjectLogic(struct Expression * e);
10992 extern void CopyTypeInto(struct Type * type, struct Type * src);
10994 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
10996 unsigned int result = 0x1;
11000 struct __ecereNameSpace__ecere__sys__OldList converts =
11004 struct Conversion * convert;
11006 if(destType->kind == 0)
11008 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11012 for(convert = converts.first; convert; convert = convert->next)
11014 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11018 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11019 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11022 newExp->destType = (((void *)0));
11026 exp->addedThis = 0x1;
11027 exp->member.exp = newExp;
11028 FreeType(exp->member.exp->expType);
11029 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11030 exp->member.exp->expType->classObjectType = objectType;
11031 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11032 exp->member.memberType = 1;
11033 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11034 exp->needCast = 0x1;
11036 exp->expType->refCount++;
11037 ApplyAnyObjectLogic(exp->member.exp);
11043 exp->addedThis = 0x1;
11044 exp->member.exp = newExp;
11045 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11047 newExp->byReference = 0x1;
11049 FreeType(exp->member.exp->expType);
11050 exp->member.exp->expType = (((void *)0));
11051 if(convert->convert->dataType)
11053 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11054 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11055 exp->member.exp->expType->refCount = 1;
11056 exp->member.exp->expType->classObjectType = objectType;
11057 ApplyAnyObjectLogic(exp->member.exp);
11059 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11060 exp->member.memberType = 4;
11061 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11062 exp->needCast = 0x1;
11063 if(convert->resultType)
11064 convert->resultType->refCount++;
11070 FreeType(exp->expType);
11073 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11074 exp->needCast = 0x1;
11076 exp->expType->refCount++;
11080 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11081 exp->needCast = 0x1;
11082 if(convert->resultType)
11083 convert->resultType->refCount++;
11087 if(exp->isConstant && inCompiler)
11088 ComputeExpression(exp);
11089 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11091 if(!result && exp->expType && converts.count)
11093 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11095 if(!result && exp->expType && exp->destType)
11097 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))
11104 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11106 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11108 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11110 void CheckTemplateTypes(struct Expression * exp)
11112 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11114 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11115 struct Statement * compound;
11116 struct Context * context;
11120 exp->destType->refCount++;
11122 exp->expType->refCount++;
11123 newExp->prev = (((void *)0));
11124 newExp->next = (((void *)0));
11125 switch(exp->expType->kind)
11128 if(exp->destType->classObjectType)
11131 exp->destType->refCount--;
11133 exp->expType->refCount--;
11134 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11138 struct __ecereNameSpace__ecere__sys__OldList * specs;
11139 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11140 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11142 context = PushContext();
11143 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11144 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11145 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11147 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11148 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11149 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11150 exp->compound->compound.context = context;
11151 PopContext(context);
11156 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11157 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11161 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11163 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11164 struct Statement * compound;
11165 struct Context * context;
11169 exp->destType->refCount++;
11171 exp->expType->refCount++;
11172 newExp->prev = (((void *)0));
11173 newExp->next = (((void *)0));
11174 switch(exp->expType->kind)
11177 if(exp->destType->classObjectType)
11180 exp->destType->refCount--;
11182 exp->expType->refCount--;
11183 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11187 struct __ecereNameSpace__ecere__sys__OldList * specs;
11188 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11189 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11191 context = PushContext();
11192 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11193 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11194 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11196 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11197 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11198 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11199 exp->compound->compound.context = context;
11200 PopContext(context);
11205 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11208 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11209 ProcessExpressionType((*exp->list).first);
11215 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11216 newExp->needCast = 0x1;
11217 ProcessExpressionType((*exp->list).first);
11223 if(exp->expType->kind == 20)
11225 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11229 FreeType(exp->destType);
11230 FreeType(exp->expType);
11231 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11235 if(newExp->type == 8 && newExp->member.memberType == 3)
11239 exp->op.exp1 = (((void *)0));
11240 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11244 char typeString[1024];
11245 struct Declarator * decl;
11246 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11248 typeString[0] = '\0';
11249 PrintType(exp->expType, typeString, 0x0, 0x0);
11250 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11252 exp->cast.typeName = MkTypeName(specs, decl);
11253 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11254 exp->cast.exp->needCast = 0x1;
11262 extern int strncmp(const char * , const char * , size_t n);
11264 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11266 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11268 int nsLen = strlen(nameSpace);
11269 struct Symbol * symbol;
11271 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)))
11273 char * s = symbol->string;
11275 if(!strncmp(s, nameSpace, nsLen))
11280 for(c = strlen(s) - 1; c >= 0; c--)
11283 namePart = s + c + 1;
11284 if(!strcmp(namePart, name))
11292 return (((void *)0));
11295 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11298 char nameSpace[1024];
11300 unsigned int gotColon = 0x0;
11302 nameSpace[0] = '\0';
11303 for(c = strlen(name) - 1; c >= 0; c--)
11309 namePart = name + c + 1;
11310 while(c >= 0 && name[c] == ':')
11314 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11318 memcpy(nameSpace, name, c + 1);
11319 nameSpace[c + 1] = (char)0;
11320 return ScanWithNameSpace(tree, nameSpace, namePart);
11324 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11330 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11334 return ScanWithNameSpace(tree, "", namePart);
11336 return (((void *)0));
11339 static void ProcessDeclaration(struct Declaration * decl);
11341 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11343 struct Context * ctx;
11344 struct Symbol * symbol = (((void *)0));
11346 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11348 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11350 symbol = (((void *)0));
11353 char curName[1024];
11355 strcpy(curName, thisNameSpace);
11356 strcat(curName, "::");
11357 strcat(curName, name);
11358 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11361 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11364 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11365 if(symbol || ctx == endContext)
11368 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11370 if(symbol->pointerExternal->type == 0)
11372 struct FunctionDefinition * function = symbol->pointerExternal->function;
11373 struct Context * tmpContext = curContext;
11375 curContext = (((void *)0));
11376 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11377 curContext = tmpContext;
11378 symbol->pointerExternal->symbol = symbol;
11379 DeclareType(symbol->type, 0x1, 0x1);
11380 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11381 symbol->id = curExternal->symbol->idCode;
11383 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11385 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11386 symbol->id = curExternal->symbol->idCode;
11392 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11394 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11395 ListAdd(specs, MkSpecifier(UNSIGNED));
11400 if(type->_class->registered)
11402 if(!type->_class->registered->dataType)
11403 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11404 GetTypeSpecs(type->_class->registered->dataType, specs);
11409 ListAdd(specs, MkSpecifier(DOUBLE));
11412 ListAdd(specs, MkSpecifier(FLOAT));
11415 ListAdd(specs, MkSpecifier(CHAR));
11418 ListAdd(specs, MkSpecifier(SHORT));
11421 ListAdd(specs, MkSpecifier(INT64));
11424 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11427 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11431 ListAdd(specs, MkSpecifier(INT));
11436 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11438 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11445 if(type->_class && type->_class->string)
11447 if(type->classObjectType == 2)
11448 strcat(string, "typed_object");
11450 strcat(string, type->_class->string);
11453 if(type->_class->registered)
11454 strcat(string, type->_class->registered->name);
11456 strcat(string, type->_class->string);
11463 _PrintType(type->type, string, 0x0, printFunction, fullName);
11464 strcat(string, " *");
11469 strcat(string, "void");
11472 strcat(string, type->isSigned ? "int" : "uint");
11475 strcat(string, type->isSigned ? "int64" : "uint64");
11478 strcat(string, type->isSigned ? "intptr" : "uintptr");
11481 strcat(string, type->isSigned ? "intsize" : "uintsize");
11484 strcat(string, type->isSigned ? "char" : "byte");
11487 strcat(string, type->isSigned ? "short" : "uint16");
11490 strcat(string, "float");
11493 strcat(string, "double");
11498 strcat(string, "struct ");
11499 strcat(string, type->enumName);
11501 else if(type->typeName)
11503 strcat(string, type->typeName);
11507 struct Type * member;
11509 strcat(string, "struct {");
11510 for(member = type->members.first; member; member = member->next)
11512 PrintType(member, string, 0x1, fullName);
11513 strcat(string, "; ");
11515 strcat(string, "}");
11521 strcat(string, "union ");
11522 strcat(string, type->enumName);
11524 else if(type->typeName)
11526 strcat(string, type->typeName);
11530 strcat(string, "union ");
11531 strcat(string, "(unnamed)");
11537 strcat(string, "enum ");
11538 strcat(string, type->enumName);
11540 else if(type->typeName)
11542 strcat(string, type->typeName);
11545 strcat(string, "enum");
11551 if(type->dllExport)
11552 strcat(string, "dllexport ");
11553 PrintType(type->returnType, string, 0x0, fullName);
11554 strcat(string, " ");
11561 strcat(string, type->name);
11564 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11570 strcat(string, name);
11576 struct Type * param;
11578 strcat(string, "(");
11579 for(param = type->params.first; param; param = param->next)
11581 PrintType(param, string, 0x1, fullName);
11583 strcat(string, ", ");
11585 strcat(string, ")");
11592 char baseType[1024], size[256];
11593 struct Type * arrayType = type;
11595 baseType[0] = '\0';
11597 while(arrayType->kind == 12)
11600 if(arrayType->enumClass)
11601 strcat(size, arrayType->enumClass->string);
11602 else if(arrayType->arraySizeExp)
11603 PrintExpression(arrayType->arraySizeExp, size);
11605 arrayType = arrayType->arrayType;
11607 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11608 strcat(string, baseType);
11609 strcat(string, size);
11615 strcat(string, "...");
11618 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11621 strcat(string, "subclass(");
11622 strcat(string, type->_class ? type->_class->string : "int");
11623 strcat(string, ")");
11626 strcat(string, type->templateParameter->identifier->string);
11629 strcat(string, "thisclass");
11632 strcat(string, "__builtin_va_list");
11635 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11637 strcat(string, " ");
11638 strcat(string, type->name);
11643 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11645 struct Type * funcType;
11647 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11649 if(funcType && funcType->kind == 11 && type != funcType)
11651 char typeString[1024];
11652 struct Type * param;
11654 PrintType(funcType->returnType, string, 0x0, fullName);
11655 strcat(string, "(");
11656 _PrintType(type, string, printName, 0x0, fullName);
11657 strcat(string, ")");
11658 strcat(string, "(");
11659 for(param = funcType->params.first; param; param = param->next)
11661 PrintType(param, string, 0x1, fullName);
11663 strcat(string, ", ");
11665 strcat(string, ")");
11668 _PrintType(type, string, printName, 0x1, fullName);
11669 if(type->bitFieldCount)
11673 sprintf(count, ":%d", type->bitFieldCount);
11674 strcat(string, count);
11678 static struct Type * FindMember(struct Type * type, char * string)
11680 struct Type * memberType;
11682 for(memberType = type->members.first; memberType; memberType = memberType->next)
11684 if(!memberType->name)
11686 struct Type * subType = FindMember(memberType, string);
11691 else if(!strcmp(memberType->name, string))
11694 return (((void *)0));
11697 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11699 struct Type * memberType;
11701 for(memberType = type->members.first; memberType; memberType = memberType->next)
11703 if(!memberType->name)
11705 struct Type * subType = FindMember(memberType, string);
11709 *offset += memberType->offset;
11713 else if(!strcmp(memberType->name, string))
11715 *offset += memberType->offset;
11719 return (((void *)0));
11722 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11724 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11726 struct Expression * ParseExpressionString(char * expression)
11728 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11729 ((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));
11730 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11732 parsedExpression = (((void *)0));
11734 expression_yyparse();
11735 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11736 return parsedExpression;
11739 extern char * QMkString(char * source);
11741 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11743 void * __ecereTemp1;
11744 struct Identifier * id = exp->identifier;
11745 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11746 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11747 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11748 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11750 if(_class && _class->type == 4)
11752 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11753 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11757 struct __ecereNameSpace__ecere__com__Class * baseClass;
11759 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11761 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11763 for(value = e->values.first; value; value = value->next)
11765 if(!strcmp(value->name, id->string))
11770 char constant[256];
11772 FreeExpContents(exp);
11774 exp->isConstant = 0x1;
11775 if(!strcmp(baseClass->dataTypeString, "int"))
11776 sprintf(constant, "%d", value->data);
11778 sprintf(constant, "0x%X", value->data);
11779 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11780 exp->expType = MkClassType(baseClass->fullName);
11788 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11790 ProcessMethodType(method);
11791 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1)->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), ((struct Type *)__ecereTemp1));
11794 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11796 if(!prop->dataType)
11797 ProcessPropertyType(prop);
11798 exp->expType = prop->dataType;
11800 prop->dataType->refCount++;
11803 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11805 if(!member->dataType)
11806 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11807 exp->expType = member->dataType;
11808 if(member->dataType)
11809 member->dataType->refCount++;
11812 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11814 if(!classProp->dataType)
11815 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11816 if(classProp->constant)
11818 FreeExpContents(exp);
11819 exp->isConstant = 0x1;
11820 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11823 exp->constant = QMkString((char *)classProp->Get(_class));
11827 char constant[256];
11830 sprintf(constant, "%d", (int)classProp->Get(_class));
11831 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11837 exp->expType = classProp->dataType;
11838 if(classProp->dataType)
11839 classProp->dataType->refCount++;
11845 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11847 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11848 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11849 struct __ecereNameSpace__ecere__com__NameSpace * child;
11853 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)))
11855 data = ScanGlobalData(child, name);
11863 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11865 extern char * strncpy(char * , const char * , size_t n);
11867 static struct GlobalData * FindGlobalData(char * name)
11870 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11872 nameSpace = globalData;
11873 for(c = 0; name[c]; c++)
11875 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11877 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11878 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11880 strncpy(spaceName, name + start, c - start);
11881 spaceName[c - start] = '\0';
11882 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11883 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11885 return (((void *)0));
11886 nameSpace = newSpace;
11894 return ScanGlobalData(nameSpace, name + start);
11896 return (((void *)0));
11899 static int definedExpStackPos;
11901 static void * definedExpStack[512];
11903 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11905 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11907 FreeExpContents(checkedExp);
11908 FreeType(checkedExp->expType);
11909 FreeType(checkedExp->destType);
11910 *checkedExp = *newExp;
11911 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11912 checkedExp->prev = prev;
11913 checkedExp->next = next;
11916 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11918 extern int printf(char * , ...);
11920 void __ecereMethod_Expression_Clear();
11922 void ApplyAnyObjectLogic(struct Expression * e)
11924 struct Type * destType = e->destType;
11926 if(destType && (destType->classObjectType == 3))
11928 if(e && e->expType)
11930 struct Type * type = e->expType;
11931 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11933 if(type->kind == 8 && type->_class && type->_class->registered)
11935 _class = type->_class->registered;
11937 else if(type->kind == 19)
11939 _class = FindClass("ecere::com::Class")->registered;
11943 char string[1024] = "";
11944 struct Symbol * classSym;
11946 PrintType(type, string, 0x0, 0x1);
11947 classSym = FindClass(string);
11949 _class = classSym->registered;
11951 if((_class && (_class->type == 4 || _class->type == 3 || _class->type == 2 || _class->type == 1000) && strcmp(_class->fullName, "class") && strcmp(_class->fullName, "ecere::com::Class")) || (!e->expType->classObjectType && (((type->kind != 13 && type->kind != 19 && (type->kind != 8 || !type->_class || !type->_class->registered || type->_class->registered->type == 1))) || destType->byReference)))
11953 if(!_class || strcmp(_class->fullName, "char *"))
11955 struct Expression * checkedExp = e, * newExp;
11957 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11959 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11961 if(checkedExp->type == 25)
11963 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11966 checkedExp = (*checkedExp->list).last;
11968 else if(checkedExp->type == 11)
11969 checkedExp = checkedExp->cast.exp;
11971 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
11973 newExp = checkedExp->op.exp2;
11974 checkedExp->op.exp2 = (((void *)0));
11975 FreeExpContents(checkedExp);
11976 if(e->expType && e->expType->passAsTemplate)
11980 ComputeTypeSize(e->expType);
11981 sprintf(size, "%d", e->expType->size);
11982 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))))));
11984 ReplaceExpContents(checkedExp, newExp);
11985 e->byReference = 0x1;
11987 else if(!e->byReference || (_class && _class->type == 5))
11989 struct Expression * checkedExp, * newExp;
11992 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;
11994 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
11996 struct Context * context = PushContext();
11997 struct Declarator * decl;
11998 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11999 char typeString[1024];
12000 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12002 typeString[0] = '\0';
12004 newExp->prev = (((void *)0));
12005 newExp->next = (((void *)0));
12006 newExp->expType = (((void *)0));
12007 PrintType(e->expType, typeString, 0x0, 0x1);
12008 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12009 newExp->destType = ProcessType(specs, decl);
12010 curContext = context;
12015 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12017 sprintf(name, "__internalValue%03X", internalValueCounter++);
12018 if(!curCompound->compound.declarations)
12019 curCompound->compound.declarations = MkList();
12020 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12021 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12022 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12023 e->compound = MkCompoundStmt((((void *)0)), stmts);
12026 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12028 struct Type * type = e->destType;
12030 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12031 CopyTypeInto(e->destType, type);
12032 e->destType->refCount = 1;
12033 e->destType->classObjectType = 0;
12036 e->compound->compound.context = context;
12037 PopContext(context);
12038 curContext = context->parent;
12042 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12044 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12046 if(checkedExp->type == 25)
12048 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12051 checkedExp = (*checkedExp->list).last;
12053 else if(checkedExp->type == 11)
12054 checkedExp = checkedExp->cast.exp;
12057 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12059 *operand = *checkedExp;
12060 checkedExp->destType = (((void *)0));
12061 checkedExp->expType = (((void *)0));
12062 __ecereMethod_Expression_Clear(checkedExp);
12063 checkedExp->type = 4;
12064 checkedExp->op.op = '&';
12065 checkedExp->op.exp1 = (((void *)0));
12066 checkedExp->op.exp2 = operand;
12075 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))))
12077 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
12083 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12086 thisExp->prev = (((void *)0));
12087 thisExp->next = (((void *)0));
12088 __ecereMethod_Expression_Clear(e);
12090 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
12091 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12092 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12094 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12095 CopyTypeInto(e->expType, thisExp->expType);
12096 e->expType->byReference = 0x0;
12097 e->expType->refCount = 1;
12098 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))
12100 e->expType->classObjectType = 0;
12105 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12107 if(destType->kind == 14)
12109 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12111 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12113 unsigned int byReference = e->expType->byReference;
12114 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12115 struct Declarator * decl;
12116 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12117 char typeString[1024];
12118 struct Type * type;
12119 int backupClassObjectType;
12121 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12125 backupClassObjectType = type->classObjectType;
12126 type->classObjectType = 0;
12127 typeString[0] = '\0';
12128 PrintType(type, typeString, 0x0, 0x1);
12129 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12130 type->classObjectType = backupClassObjectType;
12132 thisExp->prev = (((void *)0));
12133 thisExp->next = (((void *)0));
12134 __ecereMethod_Expression_Clear(e);
12135 if((type->kind == 8 && type->_class && type->_class->registered && strcmp(type->_class->registered->fullName, "ecere::com::Instance") && (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 != 12 && type->kind != 8) || (!destType->byReference && byReference && (destType->kind != 13 || type->kind != 13)))
12139 e->op.exp1 = (((void *)0));
12140 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12145 e->cast.typeName = MkTypeName(specs, decl);
12146 e->cast.exp = thisExp;
12147 e->byReference = 0x1;
12150 e->destType = destType;
12152 destType->refCount++;
12157 extern char * strstr(const char * , const char * );
12159 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12161 struct __ecereNameSpace__ecere__com__DefinedExpression
12163 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12164 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12167 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12168 } __attribute__ ((gcc_struct));
12170 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12172 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12174 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12176 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12178 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12180 extern struct Expression * CopyExpression(struct Expression * exp);
12182 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12184 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12186 static void ProcessStatement(struct Statement * stmt);
12188 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12190 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12192 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12194 extern char * sourceFile;
12196 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12198 void ProcessExpressionType(struct Expression * exp)
12200 void * __ecereTemp2;
12201 void * __ecereTemp1;
12202 unsigned int unresolved = 0x0;
12203 struct Location oldyylloc = yylloc;
12204 unsigned int notByReference = 0x0;
12206 if(!exp || exp->expType)
12213 struct Identifier * id = exp->identifier;
12217 if(id->_class && id->_class->name)
12219 id->classSym = id->_class->symbol;
12221 if(strstr(id->string, "__ecereClass") == id->string)
12223 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12226 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12228 ReplaceClassMembers(exp, thisClass);
12231 ProcessExpressionType(exp);
12234 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12239 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12243 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12249 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12252 ProcessExpressionType(exp);
12256 else if(currentClass && !id->_class)
12258 if(ResolveIdWithClass(exp, currentClass, 0x1))
12261 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12266 struct Type * type = symbol->type;
12267 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12269 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12271 struct Context * context = SetupTemplatesContext(_class);
12273 type = ReplaceThisClassType(_class);
12274 FinishTemplatesContext(context);
12276 type->refCount = 0;
12278 FreeSpecifier(id->_class);
12279 id->_class = (((void *)0));
12280 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12281 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12282 id->classSym = (((void *)0));
12283 exp->expType = type;
12286 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12287 exp->isConstant = 0x1;
12288 if(symbol->isParam || !strcmp(id->string, "this"))
12290 if(_class && _class->type == 1)
12291 exp->byReference = 0x1;
12293 if(symbol->isIterator)
12295 if(symbol->isIterator == 3)
12298 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12299 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12300 exp->expType = (((void *)0));
12301 ProcessExpressionType(exp);
12303 else if(symbol->isIterator != 4)
12306 exp->member.exp = MkExpIdentifier(exp->identifier);
12307 exp->member.exp->expType = exp->expType;
12308 exp->member.member = MkIdentifier("data");
12309 exp->expType = (((void *)0));
12310 ProcessExpressionType(exp);
12317 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12319 if(thisNameSpace && !(id->_class && !id->_class->name))
12323 strcpy(name, thisNameSpace);
12324 strcat(name, "::");
12325 strcat(name, id->string);
12326 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12329 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12334 for(c = 0; c < definedExpStackPos; c++)
12335 if(definedExpStack[c] == definedExp)
12337 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12339 struct Location backupYylloc = yylloc;
12341 definedExpStack[definedExpStackPos++] = definedExp;
12342 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12343 ((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));
12344 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12346 parsedExpression = (((void *)0));
12348 expression_yyparse();
12349 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12350 yylloc = backupYylloc;
12351 if(parsedExpression)
12353 FreeIdentifier(id);
12355 exp->list = MkListOne(parsedExpression);
12356 parsedExpression->loc = yylloc;
12357 ProcessExpressionType(exp);
12358 definedExpStackPos--;
12361 definedExpStackPos--;
12367 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12373 struct GlobalData * data = (((void *)0));
12375 if(thisNameSpace && !(id->_class && !id->_class->name))
12379 strcpy(name, thisNameSpace);
12380 strcat(name, "::");
12381 strcat(name, id->string);
12382 data = FindGlobalData(name);
12385 data = FindGlobalData(id->string);
12388 DeclareGlobalData(data);
12389 exp->expType = data->dataType;
12391 data->dataType->refCount++;
12392 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12393 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12394 FreeSpecifier(id->_class);
12395 id->_class = (((void *)0));
12400 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12402 if(thisNameSpace && !(id->_class && !id->_class->name))
12406 strcpy(name, thisNameSpace);
12407 strcat(name, "::");
12408 strcat(name, id->string);
12409 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12412 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12417 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12418 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12420 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12421 strcpy(name, "__ecereFunction_");
12422 FullClassNameCat(name, id->string, 0x0);
12423 if(DeclareFunction(function, name))
12425 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12426 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12428 exp->expType = function->dataType;
12429 if(function->dataType)
12430 function->dataType->refCount++;
12431 FreeSpecifier(id->_class);
12432 id->_class = (((void *)0));
12444 struct __ecereNameSpace__ecere__com__Class * _class;
12446 if(!exp->instance->_class)
12448 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12450 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12453 ProcessInstantiationType(exp->instance);
12454 exp->isConstant = exp->instance->isConstant;
12455 if(exp->instance->_class)
12457 exp->expType = MkClassType(exp->instance->_class->name);
12465 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12467 exp->expType = type;
12468 if(exp->constant[0] == '\'')
12470 if((int)((unsigned char *)exp->constant)[1] > 127)
12473 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12476 ch = exp->constant[1];
12477 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12478 exp->constant = PrintUInt(ch);
12480 type->_class = FindClass("unichar");
12481 type->isSigned = 0x0;
12486 type->isSigned = 0x1;
12489 else if(strchr(exp->constant, '.'))
12491 char ch = exp->constant[strlen(exp->constant) - 1];
12497 type->isSigned = 0x1;
12501 if(exp->constant[0] == '0' && exp->constant[1])
12502 type->isSigned = 0x0;
12503 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12504 type->isSigned = 0x0;
12505 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12506 type->isSigned = 0x0;
12508 type->isSigned = 0x1;
12511 exp->isConstant = 0x1;
12517 exp->isConstant = 0x1;
12518 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->constant = 0x1, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
12523 ProcessExpressionType(exp->_new.size);
12524 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12525 DeclareType(exp->expType->type, 0x0, 0x0);
12529 ProcessExpressionType(exp->_renew.size);
12530 ProcessExpressionType(exp->_renew.exp);
12531 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), ((struct Type *)__ecereTemp1));
12532 DeclareType(exp->expType->type, 0x0, 0x0);
12536 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12537 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12538 unsigned int useDestType = 0x0, useSideType = 0x0;
12539 struct Location oldyylloc = yylloc;
12540 unsigned int useSideUnit = 0x0;
12541 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12583 if(exp->op.op != '*' || exp->op.exp1)
12590 if(exp->op.op == '&')
12592 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12594 struct Identifier * id = exp->op.exp2->identifier;
12595 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12597 if(symbol && symbol->isIterator == 2)
12600 exp->member.exp = exp->op.exp2;
12601 exp->member.member = MkIdentifier("key");
12602 exp->expType = (((void *)0));
12603 exp->op.exp2->expType = symbol->type;
12604 symbol->type->refCount++;
12605 ProcessExpressionType(exp);
12613 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))
12615 if(exp->op.exp1->destType)
12616 FreeType(exp->op.exp1->destType);
12617 exp->op.exp1->destType = exp->destType;
12619 exp->destType->refCount++;
12623 if(exp->op.exp1->destType)
12624 FreeType(exp->op.exp1->destType);
12625 exp->op.exp1->destType = dummy;
12628 if(exp->op.exp1->destType && exp->op.op != '=')
12629 exp->op.exp1->destType->count++;
12630 ProcessExpressionType(exp->op.exp1);
12631 if(exp->op.exp1->destType && exp->op.op != '=')
12632 exp->op.exp1->destType->count--;
12633 if(exp->op.exp1->destType == dummy)
12636 exp->op.exp1->destType = (((void *)0));
12638 type1 = exp->op.exp1->expType;
12642 char expString[10240];
12644 expString[0] = '\0';
12645 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12649 exp->op.exp2->destType = exp->op.exp1->expType;
12650 if(exp->op.exp1->expType)
12651 exp->op.exp1->expType->refCount++;
12655 exp->op.exp2->destType = exp->destType;
12657 exp->destType->refCount++;
12661 exp->expType = type1;
12666 PrintExpression(exp->op.exp2, expString);
12667 if(type1 && type1->kind == 13)
12669 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)
12670 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12671 else if(exp->op.op == '=')
12673 if(exp->op.exp2->destType)
12674 FreeType(exp->op.exp2->destType);
12675 exp->op.exp2->destType = type1;
12682 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)
12686 if(exp->op.exp2->destType)
12687 FreeType(exp->op.exp2->destType);
12688 exp->op.exp2->destType = type1;
12695 exp->expType = type1;
12697 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)))
12699 if(exp->op.exp2->destType)
12700 FreeType(exp->op.exp2->destType);
12701 exp->op.exp2->destType = exp->destType;
12703 exp->destType->refCount++;
12707 if(exp->op.exp2->destType)
12708 FreeType(exp->op.exp2->destType);
12709 exp->op.exp2->destType = dummy;
12712 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12714 FreeType(exp->op.exp2->destType);
12715 exp->op.exp2->destType = type1;
12718 if(exp->op.exp2->destType && exp->op.op != '=')
12719 exp->op.exp2->destType->count++;
12720 ProcessExpressionType(exp->op.exp2);
12721 if(exp->op.exp2->destType && exp->op.op != '=')
12722 exp->op.exp2->destType->count--;
12723 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12725 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)
12727 if(exp->op.op != '=' && type1->type->kind == 0)
12728 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12730 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)))
12732 if(exp->op.op == ADD_ASSIGN)
12733 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12735 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))
12737 if(exp->op.op == ADD_ASSIGN)
12738 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12740 else if(inCompiler)
12742 char type1String[1024];
12743 char type2String[1024];
12745 type1String[0] = '\0';
12746 type2String[0] = '\0';
12747 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12748 PrintType(type1, type2String, 0x0, 0x1);
12749 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12750 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12753 if(exp->op.exp2->destType == dummy)
12756 exp->op.exp2->destType = (((void *)0));
12758 type2 = exp->op.exp2->expType;
12761 if(exp->op.op == SIZEOF)
12763 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12764 exp->isConstant = 0x1;
12766 else if(exp->op.op == '*' && !exp->op.exp1)
12768 exp->expType = Dereference(type2);
12769 if(type2 && type2->kind == 8)
12770 notByReference = 0x1;
12772 else if(exp->op.op == '&' && !exp->op.exp1)
12773 exp->expType = Reference(type2);
12780 if(exp->op.exp1->destType)
12781 FreeType(exp->op.exp1->destType);
12782 exp->op.exp1->destType = MkClassType("bool");
12783 exp->op.exp1->destType->truth = 0x1;
12784 if(!exp->op.exp1->expType)
12785 ProcessExpressionType(exp->op.exp1);
12787 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12788 FreeType(exp->op.exp1->expType);
12789 exp->op.exp1->expType = MkClassType("bool");
12790 exp->op.exp1->expType->truth = 0x1;
12794 if(exp->op.exp2->destType)
12795 FreeType(exp->op.exp2->destType);
12796 exp->op.exp2->destType = MkClassType("bool");
12797 exp->op.exp2->destType->truth = 0x1;
12798 if(!exp->op.exp2->expType)
12799 ProcessExpressionType(exp->op.exp2);
12801 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12802 FreeType(exp->op.exp2->expType);
12803 exp->op.exp2->expType = MkClassType("bool");
12804 exp->op.exp2->expType->truth = 0x1;
12807 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")))))
12809 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12811 if(exp->op.exp2->destType)
12812 FreeType(exp->op.exp2->destType);
12813 exp->op.exp2->destType = type1;
12815 if(exp->op.exp1->destType)
12816 FreeType(exp->op.exp1->destType);
12817 exp->op.exp1->destType = type2;
12819 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)
12820 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);
12821 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12823 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12827 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12829 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12830 ProcessExpressionType(exp->op.exp1);
12831 if(type2->kind != 13)
12833 ProcessExpressionType(classExp);
12834 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"))))))));
12835 if(!exp->op.exp2->expType)
12836 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12837 ProcessExpressionType(exp->op.exp2);
12841 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)))
12843 if(type1->kind != 8 && type1->type->kind == 0)
12844 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12845 exp->expType = type1;
12849 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)))
12851 if(type2->kind != 8 && type2->type->kind == 0)
12852 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12853 exp->expType = type2;
12857 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))
12859 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12863 unsigned int success = 0x0;
12865 if(type1->kind == 13 && type2->kind == 13)
12867 if(exp->op.op == '+')
12868 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12869 else if(exp->op.op == '-')
12871 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12873 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12875 if(type1->type->kind == 20)
12877 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12881 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12883 ProcessExpressionType(classExp);
12885 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")))))));
12886 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12894 if(!success && exp->op.exp1->type == 2)
12896 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12899 FreeType(exp->expType);
12900 exp->expType = exp->op.exp1->destType;
12901 if(exp->op.exp1->destType)
12902 exp->op.exp1->destType->refCount++;
12905 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12908 FreeType(exp->expType);
12909 exp->expType = exp->op.exp2->destType;
12910 if(exp->op.exp2->destType)
12911 exp->op.exp2->destType->refCount++;
12917 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12920 FreeType(exp->expType);
12921 exp->expType = exp->op.exp2->destType;
12922 if(exp->op.exp2->destType)
12923 exp->op.exp2->destType->refCount++;
12926 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12929 FreeType(exp->expType);
12930 exp->expType = exp->op.exp1->destType;
12931 if(exp->op.exp1->destType)
12932 exp->op.exp1->destType->refCount++;
12938 char expString1[10240];
12939 char expString2[10240];
12943 expString1[0] = '\0';
12944 expString2[0] = '\0';
12949 PrintExpression(exp->op.exp1, expString1);
12950 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12951 PrintExpression(exp->op.exp2, expString2);
12952 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12953 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12954 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12956 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12960 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12962 if(exp->op.exp1->destType)
12963 FreeType(exp->op.exp1->destType);
12964 exp->op.exp1->destType = type2->_class->registered->dataType;
12965 if(type2->_class->registered->dataType)
12966 type2->_class->registered->dataType->refCount++;
12967 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12968 exp->expType = type2;
12972 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
12974 if(exp->op.exp2->destType)
12975 FreeType(exp->op.exp2->destType);
12976 exp->op.exp2->destType = type1->_class->registered->dataType;
12977 if(type1->_class->registered->dataType)
12978 type1->_class->registered->dataType->refCount++;
12979 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12980 exp->expType = type1;
12986 unsigned int valid = 0x0;
12988 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
12990 if(exp->op.exp2->destType)
12991 FreeType(exp->op.exp2->destType);
12992 if(!type1->_class->registered->dataType)
12993 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
12994 exp->op.exp2->destType = type1->_class->registered->dataType;
12995 exp->op.exp2->destType->refCount++;
12996 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12997 type2 = exp->op.exp2->destType;
12998 exp->expType = type2;
13001 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13003 if(exp->op.exp1->destType)
13004 FreeType(exp->op.exp1->destType);
13005 if(!type2->_class->registered->dataType)
13006 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13007 exp->op.exp1->destType = type2->_class->registered->dataType;
13008 exp->op.exp1->destType->refCount++;
13009 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13010 type1 = exp->op.exp1->destType;
13011 exp->expType = type1;
13014 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13016 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13018 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13021 FreeType(exp->expType);
13022 exp->expType = exp->op.exp1->expType;
13023 if(exp->op.exp2->expType)
13024 exp->op.exp1->expType->refCount++;
13028 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13030 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13033 FreeType(exp->expType);
13034 exp->expType = exp->op.exp2->expType;
13035 if(exp->op.exp2->expType)
13036 exp->op.exp2->expType->refCount++;
13043 if(exp->op.exp2->destType)
13044 FreeType(exp->op.exp2->destType);
13045 exp->op.exp2->destType = type1;
13047 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13050 FreeType(exp->expType);
13051 exp->expType = exp->op.exp2->destType;
13052 if(exp->op.exp2->destType)
13053 exp->op.exp2->destType->refCount++;
13055 else if(type1 && type2)
13057 char expString1[10240];
13058 char expString2[10240];
13059 char type1String[1024];
13060 char type2String[1024];
13062 expString1[0] = '\0';
13063 expString2[0] = '\0';
13064 type1String[0] = '\0';
13065 type2String[0] = '\0';
13068 PrintExpression(exp->op.exp1, expString1);
13069 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13070 PrintExpression(exp->op.exp2, expString2);
13071 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13072 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13073 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13075 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13076 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13078 exp->expType = exp->op.exp1->expType;
13079 if(exp->op.exp1->expType)
13080 exp->op.exp1->expType->refCount++;
13082 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13084 exp->expType = exp->op.exp2->expType;
13085 if(exp->op.exp2->expType)
13086 exp->op.exp2->expType->refCount++;
13093 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13095 struct Type * oldType = exp->op.exp1->expType;
13097 exp->op.exp1->expType = (((void *)0));
13098 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13101 exp->op.exp1->expType = oldType;
13103 if(exp->op.exp1->destType)
13104 FreeType(exp->op.exp1->destType);
13105 exp->op.exp1->destType = type2;
13107 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13110 FreeType(exp->expType);
13111 exp->expType = exp->op.exp1->destType;
13112 if(exp->op.exp1->destType)
13113 exp->op.exp1->destType->refCount++;
13117 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13119 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13121 if(exp->op.exp1->destType)
13122 FreeType(exp->op.exp1->destType);
13123 exp->op.exp1->destType = type2->_class->registered->dataType;
13124 if(type2->_class->registered->dataType)
13125 type2->_class->registered->dataType->refCount++;
13126 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13128 if(exp->op.op == '!')
13130 exp->expType = MkClassType("bool");
13131 exp->expType->truth = 0x1;
13135 exp->expType = type2;
13140 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13142 if(type2 && 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);
13151 exp->expType = type1;
13157 if(exp->op.exp1 && !exp->op.exp1->expType)
13159 char expString[10000];
13161 expString[0] = '\0';
13164 PrintExpression(exp->op.exp1, expString);
13165 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13168 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13170 if(exp->op.exp2 && !exp->op.exp2->expType)
13172 char expString[10240];
13174 expString[0] = '\0';
13177 PrintExpression(exp->op.exp2, expString);
13178 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13181 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13185 FreeType(exp->expType);
13186 exp->expType = MkClassType("bool");
13187 exp->expType->truth = 0x1;
13189 if(exp->op.op != SIZEOF)
13190 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13191 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13193 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13195 yylloc = oldyylloc;
13202 struct Expression * e;
13204 exp->isConstant = 0x1;
13205 for(e = (*exp->list).first; e; e = e->next)
13207 unsigned int inced = 0x0;
13211 FreeType(e->destType);
13212 e->destType = exp->destType;
13215 exp->destType->refCount++;
13216 e->destType->count++;
13220 ProcessExpressionType(e);
13222 exp->destType->count--;
13223 if(!exp->expType && !e->next)
13225 exp->expType = e->expType;
13227 e->expType->refCount++;
13230 exp->isConstant = 0x0;
13232 e = (*exp->list).first;
13233 if(!e->next && e->type == 8)
13235 struct Expression * next = exp->next, * prev = exp->prev;
13237 FreeType(exp->expType);
13238 FreeType(exp->destType);
13239 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13243 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13244 ProcessExpressionType(exp);
13250 struct Expression * e;
13252 exp->isConstant = 0x1;
13253 ProcessExpressionType(exp->index.exp);
13254 if(!exp->index.exp->isConstant)
13255 exp->isConstant = 0x0;
13256 if(exp->index.exp->expType)
13258 struct Type * source = exp->index.exp->expType;
13260 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)
13262 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13264 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13265 if(exp->index.index && (*exp->index.index).last)
13267 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13271 for(e = (*exp->index.index).first; e; e = e->next)
13273 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13276 FreeType(e->destType);
13277 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13279 ProcessExpressionType(e);
13284 exp->isConstant = 0x0;
13287 exp->expType = Dereference(exp->index.exp->expType);
13289 DeclareType(exp->expType, 0x0, 0x0);
13294 struct Expression * e;
13295 struct Type * functionType;
13296 struct Type * methodType = (((void *)0));
13302 PrintExpression(exp->call.exp, name);
13303 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13305 PrintExpression(exp->call.exp, name);
13308 if(exp->call.exp->type == 0)
13310 struct Expression * idExp = exp->call.exp;
13311 struct Identifier * id = idExp->identifier;
13313 if(!strcmp(id->string, "__builtin_frame_address"))
13315 exp->expType = ProcessTypeString("void *", 0x1);
13316 if(exp->call.arguments && (*exp->call.arguments).first)
13317 ProcessExpressionType((*exp->call.arguments).first);
13320 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13322 exp->expType = ProcessTypeString("int", 0x1);
13323 if(exp->call.arguments && (*exp->call.arguments).first)
13324 ProcessExpressionType((*exp->call.arguments).first);
13327 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13329 struct Expression * a = (((void *)0));
13330 struct Expression * b = (((void *)0));
13331 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13333 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13335 a = (*exp->call.arguments).first;
13336 b = (*exp->call.arguments).last;
13340 else if((*exp->call.arguments).count == 1)
13342 a = (*exp->call.arguments).first;
13347 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13348 idExp->identifier = (((void *)0));
13349 FreeExpContents(exp);
13350 ProcessExpressionType(a);
13352 ProcessExpressionType(b);
13354 exp->list = MkList();
13355 if(a->expType && (!b || b->expType))
13357 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13361 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13362 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13363 struct Declaration * decl;
13364 char temp1[1024], temp2[1024];
13366 GetTypeSpecs(a->expType, specs);
13367 if(a && !a->isConstant && a->type != 0)
13369 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13370 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13371 tempExp1 = QMkExpId(temp1);
13372 tempExp1->expType = a->expType;
13374 a->expType->refCount++;
13375 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13377 if(b && !b->isConstant && b->type != 0)
13379 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13380 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13381 tempExp2 = QMkExpId(temp2);
13382 tempExp2->expType = b->expType;
13384 b->expType->refCount++;
13385 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13387 decl = MkDeclaration(specs, decls);
13388 if(!curCompound->compound.declarations)
13389 curCompound->compound.declarations = MkList();
13390 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13394 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13396 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13398 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13399 exp->expType = a->expType;
13401 a->expType->refCount++;
13403 else if(!strcmp(id->string, "Abs"))
13405 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13406 exp->expType = a->expType;
13408 a->expType->refCount++;
13410 else if(!strcmp(id->string, "Sgn"))
13412 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"))))));
13413 exp->expType = ProcessTypeString("int", 0x0);
13415 FreeExpression(tempExp1);
13417 FreeExpression(tempExp2);
13418 FreeIdentifier(id);
13424 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13426 if(!exp->call.exp->destType)
13428 exp->call.exp->destType = dummy;
13431 ProcessExpressionType(exp->call.exp);
13432 if(exp->call.exp->destType == dummy)
13435 exp->call.exp->destType = (((void *)0));
13439 functionType = exp->call.exp->expType;
13440 if(functionType && functionType->kind == 16)
13442 methodType = functionType;
13443 functionType = methodType->method->dataType;
13444 if(exp->call.exp->expType->usedClass)
13446 char typeString[1024];
13448 typeString[0] = '\0';
13449 PrintType(functionType, typeString, 0x1, 0x1);
13450 if(strstr(typeString, "thisclass"))
13452 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13453 struct Declarator * decl;
13456 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13458 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13459 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13460 thisClassParams = 0x0;
13461 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13463 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13465 thisClass = exp->call.exp->expType->usedClass;
13466 ProcessDeclarator(decl);
13467 thisClass = backupThisClass;
13469 thisClassParams = 0x1;
13470 functionType = ProcessType(specs, decl);
13471 functionType->refCount = 0;
13472 FinishTemplatesContext(context);
13474 FreeList(specs, FreeSpecifier);
13475 FreeDeclarator(decl);
13479 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13481 struct Type * type = functionType->type;
13483 if(!functionType->refCount)
13485 functionType->type = (((void *)0));
13486 FreeType(functionType);
13488 functionType = type;
13490 if(functionType && functionType->kind != 11)
13492 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13494 else if(functionType)
13496 unsigned int emptyParams = 0x0, noParams = 0x0;
13497 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13498 struct Type * type = functionType->params.first;
13499 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13501 struct Location oldyylloc = yylloc;
13505 if(functionType->extraParam && e && functionType->thisClass)
13507 e->destType = MkClassType(functionType->thisClass->string);
13510 if(!functionType->staticMethod)
13512 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13514 type = MkClassType(memberExp->member.exp->expType->_class->string);
13517 e->destType = type;
13519 type = functionType->params.first;
13522 type->refCount = 0;
13524 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13526 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13529 e->destType = type;
13531 type = functionType->params.first;
13534 type->refCount = 0;
13537 if(type && type->kind == 0)
13540 if(!type->refCount)
13542 type = (((void *)0));
13544 for(; e; e = e->next)
13546 if(!type && !emptyParams)
13549 if(methodType && methodType->methodClass)
13550 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);
13552 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);
13555 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13557 struct Type * templatedType = (((void *)0));
13558 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13559 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13562 if(_class && _class->templateArgs)
13564 struct __ecereNameSpace__ecere__com__Class * sClass;
13566 for(sClass = _class; sClass; sClass = sClass->base)
13568 if(sClass->templateClass)
13569 sClass = sClass->templateClass;
13571 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13573 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13575 struct __ecereNameSpace__ecere__com__Class * nextClass;
13577 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13579 if(nextClass->templateClass)
13580 nextClass = nextClass->templateClass;
13581 id += nextClass->templateParams.count;
13591 if(curParam && _class->templateArgs[id].dataTypeString)
13593 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13596 struct Context * context = SetupTemplatesContext(_class);
13598 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13599 FinishTemplatesContext(context);
13601 e->destType = templatedType;
13604 templatedType->passAsTemplate = 0x1;
13609 e->destType = type;
13616 e->destType = type;
13620 if(type && type->kind != 14)
13622 struct Type * next = type->next;
13624 if(!type->refCount)
13629 if(type && type->kind != 14)
13631 if(methodType && methodType->methodClass)
13632 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);
13634 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);
13636 yylloc = oldyylloc;
13637 if(type && !type->refCount)
13642 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13643 if(exp->call.exp->type == 0)
13645 char * string = exp->call.exp->identifier->string;
13649 struct Symbol * symbol;
13650 struct Location oldyylloc = yylloc;
13652 yylloc = exp->call.exp->identifier->loc;
13653 if(strstr(string, "__builtin_") == string)
13656 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13657 symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString(string), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("int()", 0x1), ((struct Symbol *)__ecereTemp1));
13658 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13659 if(strstr(symbol->string, "::"))
13660 globalContext->hasNameSpace = 0x1;
13661 yylloc = oldyylloc;
13664 else if(exp->call.exp->type == 8)
13668 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13669 if(!functionType->returnType)
13671 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13674 if(functionType && functionType->kind == 11)
13676 exp->expType = functionType->returnType;
13677 if(functionType->returnType)
13678 functionType->returnType->refCount++;
13679 if(!functionType->refCount)
13680 FreeType(functionType);
13682 if(exp->call.arguments)
13684 for(e = (*exp->call.arguments).first; e; e = e->next)
13686 struct Type * destType = e->destType;
13688 ProcessExpressionType(e);
13695 struct Type * type;
13696 struct Location oldyylloc = yylloc;
13697 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13699 exp->thisPtr = thisPtr;
13700 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13702 exp->member.member->classSym = exp->member.member->_class->symbol;
13704 ProcessExpressionType(exp->member.exp);
13705 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)
13707 exp->isConstant = 0x0;
13710 exp->isConstant = exp->member.exp->isConstant;
13711 type = exp->member.exp->expType;
13713 if(type && (type->kind == 20))
13715 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13716 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13720 for(param = _class->templateParams.first; param; param = param->next)
13722 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13726 if(param && param->defaultArg.member)
13728 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13732 struct Expression * expMember = exp->member.exp;
13733 struct Declarator * decl;
13734 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13735 char thisClassTypeString[1024];
13737 FreeIdentifier(exp->member.member);
13738 ProcessExpressionType(argExp);
13740 char * colon = strstr(param->defaultArg.memberString, "::");
13744 char className[1024];
13745 struct __ecereNameSpace__ecere__com__Class * sClass;
13747 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13748 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13751 strcpy(thisClassTypeString, _class->fullName);
13753 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13754 exp->expType = ProcessType(specs, decl);
13755 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13757 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13758 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13760 int paramCount = 0;
13761 int lastParam = -1;
13762 char templateString[1024];
13763 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13765 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13766 for(cClass = expClass; cClass; cClass = cClass->base)
13770 for(param = cClass->templateParams.first; param; param = param->next)
13773 struct __ecereNameSpace__ecere__com__Class * sClass;
13774 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13776 for(sClass = cClass->base; sClass; sClass = sClass->base)
13777 id += sClass->templateParams.count;
13778 arg = expClass->templateArgs[id];
13779 for(sClass = _class; sClass; sClass = sClass->base)
13781 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13783 struct __ecereNameSpace__ecere__com__Class * nextClass;
13785 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13786 p += nextClass->templateParams.count;
13787 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13789 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13791 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13793 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13794 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13801 char argument[256];
13803 argument[0] = '\0';
13804 switch(param->type)
13808 char expString[1024];
13809 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13810 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13811 struct Expression * exp;
13812 char * string = PrintHexUInt64(arg.expression.ui64);
13814 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13815 ProcessExpressionType(exp);
13816 ComputeExpression(exp);
13817 expString[0] = '\0';
13818 PrintExpression(exp, expString);
13819 strcat(argument, expString);
13820 FreeExpression(exp);
13825 strcat(argument, arg.member->name);
13830 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13832 if(!strcmp(arg.dataTypeString, "thisclass"))
13833 strcat(argument, thisClassTypeString);
13835 strcat(argument, arg.dataTypeString);
13843 strcat(templateString, ", ");
13844 if(lastParam != p - 1)
13846 strcat(templateString, param->name);
13847 strcat(templateString, " = ");
13849 strcat(templateString, argument);
13858 int len = strlen(templateString);
13860 if(templateString[len - 1] == '>')
13861 templateString[len++] = ' ';
13862 templateString[len++] = '>';
13863 templateString[len++] = '\0';
13866 struct Context * context = SetupTemplatesContext(_class);
13868 FreeType(exp->expType);
13869 exp->expType = ProcessTypeString(templateString, 0x0);
13870 FinishTemplatesContext(context);
13874 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")))))))));
13877 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13879 type = ProcessTemplateParameterType(type->templateParameter);
13882 if(type && (type->kind == 20))
13884 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13886 struct Identifier * id = exp->member.member;
13887 int typeKind = type->kind;
13888 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));
13890 if(typeKind == 19 && exp->member.exp->type == 26)
13892 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13895 if(id && (typeKind == 3 || typeKind == 15))
13896 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13899 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13900 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13901 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13902 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13903 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13905 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13906 exp->member.memberType = 1;
13907 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13908 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13911 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13913 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13914 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13916 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13918 member = (((void *)0));
13920 if(!member && !prop)
13921 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13922 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13923 exp->member.thisPtr = 0x1;
13929 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13930 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13931 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13933 if(!prop && !member)
13935 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13938 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13939 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13940 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13945 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13946 prop = (((void *)0));
13948 member = (((void *)0));
13952 if(!prop && !member)
13953 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13954 if(!prop && !member && !method)
13958 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13961 exp->member.memberType = 5;
13962 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
13966 char structName[1024];
13967 struct Identifier * id = exp->member.member;
13968 struct Expression * classExp = exp->member.exp;
13971 FreeType(classExp->expType);
13972 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
13973 strcpy(structName, "__ecereClassData_");
13974 FullClassNameCat(structName, type->_class->string, 0x0);
13976 exp->member.member = id;
13977 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"))))))));
13979 ProcessExpressionType(exp);
13985 struct Symbol * classSym = FindClass(id->string);
13989 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
13992 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
13998 exp->member.memberType = 1;
13999 if(!prop->dataType)
14000 ProcessPropertyType(prop);
14001 exp->expType = prop->dataType;
14003 prop->dataType->refCount++;
14007 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14009 FreeExpContents(exp);
14011 exp->identifier = MkIdentifier("class");
14012 ProcessExpressionType(exp);
14015 exp->member.memberType = 3;
14016 DeclareStruct(_class->fullName, 0x0);
14017 if(!member->dataType)
14019 struct Context * context = SetupTemplatesContext(_class);
14021 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14022 FinishTemplatesContext(context);
14024 exp->expType = member->dataType;
14025 if(member->dataType)
14026 member->dataType->refCount++;
14028 else if(revConvert)
14030 exp->member.memberType = 4;
14031 exp->expType = MkClassType(revConvert->_class->fullName);
14037 exp->member.memberType = 2;
14039 if(!method->dataType)
14040 ProcessMethodType(method);
14041 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 16, ((struct Type *)__ecereTemp1)->method = method, ((struct Type *)__ecereTemp1));
14042 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14043 exp->expType->usedClass = _class;
14045 else if(!classProp)
14047 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14049 FreeExpContents(exp);
14051 exp->identifier = MkIdentifier("class");
14052 ProcessExpressionType(exp);
14055 yylloc = exp->member.member->loc;
14056 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14058 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14060 if(_class && exp->expType)
14062 struct __ecereNameSpace__ecere__com__Class * tClass;
14065 while(tClass && !tClass->templateClass)
14066 tClass = tClass->base;
14067 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14070 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14071 struct __ecereNameSpace__ecere__com__Class * sClass;
14073 for(sClass = tClass; sClass; sClass = sClass->base)
14076 if(sClass->templateClass)
14077 sClass = sClass->templateClass;
14078 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14080 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14082 for(sClass = sClass->base; sClass; sClass = sClass->base)
14083 id += sClass->templateParams.count;
14091 if(curParam && tClass->templateArgs[id].dataTypeString)
14093 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14094 struct Context * context = SetupTemplatesContext(tClass);
14096 FreeType(exp->expType);
14097 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14100 if(exp->expType->kind == 21)
14102 FreeType(exp->expType);
14103 exp->expType = ReplaceThisClassType(_class);
14105 if(tClass->templateClass)
14106 exp->expType->passAsTemplate = 0x1;
14109 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14110 if(exp->destType->kind == 21)
14112 FreeType(exp->destType);
14113 exp->destType = ReplaceThisClassType(_class);
14117 FinishTemplatesContext(context);
14120 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14123 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14124 struct __ecereNameSpace__ecere__com__Class * sClass;
14126 for(sClass = tClass; sClass; sClass = sClass->base)
14129 if(sClass->templateClass)
14130 sClass = sClass->templateClass;
14131 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14133 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14135 for(sClass = sClass->base; sClass; sClass = sClass->base)
14136 id += sClass->templateParams.count;
14146 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14147 struct Context * context = SetupTemplatesContext(tClass);
14148 struct Type * basicType;
14150 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14153 if(basicType->kind == 21)
14155 FreeType(basicType);
14156 basicType = ReplaceThisClassType(_class);
14158 FreeType(exp->expType);
14159 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 13, ((struct Type *)__ecereTemp1)->type = basicType, ((struct Type *)__ecereTemp1));
14162 exp->destType = exp->expType;
14163 exp->destType->refCount++;
14166 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14167 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14168 struct Declarator * decl;
14170 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14173 exp->destType->refCount++;
14175 exp->expType->refCount++;
14177 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14178 exp->cast.exp = newExp;
14181 FinishTemplatesContext(context);
14184 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14186 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14190 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14193 int paramCount = 0;
14194 int lastParam = -1;
14195 char templateString[1024];
14196 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14198 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14199 while(cClass != expClass)
14201 struct __ecereNameSpace__ecere__com__Class * sClass;
14203 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14206 for(param = cClass->templateParams.first; param; param = param->next)
14208 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14211 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14212 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14214 while(cClassCur != tClass && !paramCur)
14216 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14218 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14220 cClassCur = sClassCur;
14221 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14223 if(!strcmp(paramCur->name, param->name))
14230 if(paramCur && paramCur->type == 0)
14231 arg = tClass->templateArgs[cp];
14233 arg = expClass->templateArgs[p];
14235 char argument[256];
14237 argument[0] = '\0';
14238 switch(param->type)
14242 char expString[1024];
14243 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14244 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14245 struct Expression * exp;
14246 char * string = PrintHexUInt64(arg.expression.ui64);
14248 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14249 ProcessExpressionType(exp);
14250 ComputeExpression(exp);
14251 expString[0] = '\0';
14252 PrintExpression(exp, expString);
14253 strcat(argument, expString);
14254 FreeExpression(exp);
14259 strcat(argument, arg.member->name);
14264 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14265 strcat(argument, arg.dataTypeString);
14272 strcat(templateString, ", ");
14273 if(lastParam != p - 1)
14275 strcat(templateString, param->name);
14276 strcat(templateString, " = ");
14278 strcat(templateString, argument);
14287 int len = strlen(templateString);
14289 if(templateString[len - 1] == '>')
14290 templateString[len++] = ' ';
14291 templateString[len++] = '>';
14292 templateString[len++] = '\0';
14294 FreeType(exp->expType);
14296 struct Context * context = SetupTemplatesContext(tClass);
14298 exp->expType = ProcessTypeString(templateString, 0x0);
14299 FinishTemplatesContext(context);
14306 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)");
14308 else if(type && (type->kind == 9 || type->kind == 10))
14310 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14314 exp->expType = memberType;
14316 memberType->refCount++;
14321 char expString[10240];
14323 expString[0] = '\0';
14326 PrintExpression(exp, expString);
14327 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14329 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14331 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14333 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14335 struct Identifier * id = exp->member.member;
14336 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));
14340 FreeType(exp->expType);
14341 exp->expType = ReplaceThisClassType(_class);
14345 yylloc = oldyylloc;
14350 struct Type * destType = exp->destType;
14352 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14354 exp->member.member->classSym = exp->member.member->_class->symbol;
14356 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14360 ProcessExpressionType(exp);
14367 struct Symbol * classSym = exp->_class->symbol;
14369 if(classSym && classSym->registered)
14371 if(classSym->registered->type == 5)
14376 DeclareStruct(classSym->string, 0x0);
14377 FreeSpecifier(exp->_class);
14379 FullClassNameCat(name, classSym->string, 0x0);
14380 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14384 if(classSym->registered->fixed)
14386 FreeSpecifier(exp->_class);
14387 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14392 char className[1024];
14394 strcpy(className, "__ecereClass_");
14395 FullClassNameCat(className, classSym->string, 0x1);
14396 MangleClassName(className);
14397 DeclareClass(classSym, className);
14398 FreeExpContents(exp);
14400 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14401 exp->member.member = MkIdentifier("structSize");
14405 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14410 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14412 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14413 exp->isConstant = 0x1;
14414 DeclareType(type, 0x0, 0x0);
14420 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14422 type->count = (unsigned int)1;
14423 FreeType(exp->cast.exp->destType);
14424 exp->cast.exp->destType = type;
14426 ProcessExpressionType(exp->cast.exp);
14427 type->count = (unsigned int)0;
14428 exp->expType = type;
14429 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14431 void * prev = exp->prev, * next = exp->next;
14432 struct Type * expType = exp->cast.exp->destType;
14433 struct Expression * castExp = exp->cast.exp;
14434 struct Type * destType = exp->destType;
14437 expType->refCount++;
14438 FreeType(exp->expType);
14439 FreeTypeName(exp->cast.typeName);
14441 FreeType(exp->expType);
14442 FreeType(exp->destType);
14443 exp->expType = expType;
14444 exp->destType = destType;
14445 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14451 exp->isConstant = exp->cast.exp->isConstant;
14457 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14460 exp->expType = type;
14465 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14467 ProcessExpressionType(exp->vaArg.exp);
14469 exp->expType = type;
14474 struct Expression * e;
14476 exp->isConstant = 0x1;
14477 FreeType(exp->cond.cond->destType);
14478 exp->cond.cond->destType = MkClassType("bool");
14479 exp->cond.cond->destType->truth = 0x1;
14480 ProcessExpressionType(exp->cond.cond);
14481 if(!exp->cond.cond->isConstant)
14482 exp->isConstant = 0x0;
14483 for(e = (*exp->cond.exp).first; e; e = e->next)
14487 FreeType(e->destType);
14488 e->destType = exp->destType;
14490 e->destType->refCount++;
14492 ProcessExpressionType(e);
14495 exp->expType = e->expType;
14497 e->expType->refCount++;
14500 exp->isConstant = 0x0;
14502 FreeType(exp->cond.elseExp->destType);
14503 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14504 if(exp->cond.elseExp->destType)
14505 exp->cond.elseExp->destType->refCount++;
14506 ProcessExpressionType(exp->cond.elseExp);
14507 if(!exp->cond.elseExp->isConstant)
14508 exp->isConstant = 0x0;
14513 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14515 struct Statement * last = (*exp->compound->compound.statements).last;
14517 if(last->type == 3 && last->expressions && (*last->expressions).last)
14519 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14521 exp->destType->refCount++;
14523 ProcessStatement(exp->compound);
14524 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14525 if(((struct Expression *)(*last->expressions).last)->expType)
14526 exp->expType->refCount++;
14532 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14534 if(spec && spec->type == 1)
14536 exp->expType = MkClassType(spec->name);
14537 exp->expType->kind = 19;
14538 exp->byReference = 0x1;
14542 exp->expType = MkClassType("ecere::com::Class");
14543 exp->byReference = 0x1;
14549 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14553 struct Identifier * id = exp->classData.id;
14554 char structName[1024];
14555 struct Expression * classExp;
14557 strcpy(structName, "__ecereClassData_");
14558 FullClassNameCat(structName, _class->fullName, 0x0);
14560 exp->member.member = id;
14561 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14562 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14564 classExp = MkExpIdentifier(MkIdentifier("class"));
14565 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"))))))));
14566 ProcessExpressionType(exp);
14573 struct Type * type = (((void *)0));
14574 char * typeString = (((void *)0));
14575 char typeStringBuf[1024];
14577 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))
14579 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14581 typeString = templateClass->templateArgs[2].dataTypeString;
14585 struct Expression * e;
14587 for(e = (*exp->list).first; e; e = e->next)
14589 ProcessExpressionType(e);
14599 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14603 e->expType = (((void *)0));
14604 e = (*exp->list).first;
14605 ProcessExpressionType(e);
14608 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14610 FreeType(e->expType);
14611 e->expType = (((void *)0));
14613 type = (((void *)0));
14621 FreeType(e->expType);
14622 e->expType = (((void *)0));
14628 typeStringBuf[0] = '\0';
14629 PrintType(type, typeStringBuf, 0x0, 0x1);
14630 typeString = typeStringBuf;
14632 type = (((void *)0));
14637 char templateString[1024];
14638 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14639 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14640 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14641 struct Expression * expExt;
14642 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14644 sprintf(templateString, "Container<%s>", typeString);
14647 struct Expression * e;
14649 type = ProcessTypeString(typeString, 0x0);
14650 while(e = (*exp->list).first)
14652 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14653 e->destType = type;
14655 ProcessExpressionType(e);
14656 ListAdd(initializers, MkInitializerAssignment(e));
14659 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14661 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14662 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14663 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14664 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14665 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14666 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14667 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14668 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14669 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14670 ListAdd(structInitializers, MkInitializerAssignment((__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression), ((struct Expression *)__ecereTemp1)->type = 2, ((struct Expression *)__ecereTemp1)->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), ((struct Expression *)__ecereTemp1))));
14671 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14672 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14673 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14674 exp->expType = ProcessTypeString(templateString, 0x0);
14676 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14677 ProcessExpressionType(expExt);
14681 exp->expType = ProcessTypeString("Container", 0x0);
14682 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14687 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14689 FreeType(exp->expType);
14690 exp->expType = ReplaceThisClassType(thisClass);
14692 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14694 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14698 if(exp->expType->kind != 15)
14700 struct Type * member;
14701 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14703 FreeType(exp->expType);
14704 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14705 exp->expType->kind = symbol->type->kind;
14706 exp->expType->refCount++;
14707 exp->expType->enumName = enumName;
14708 exp->expType->members = symbol->type->members;
14709 for(member = symbol->type->members.first; member; member = member->next)
14710 member->refCount++;
14714 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14716 for(member = symbol->type->members.first; member; member = member->next)
14718 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14720 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14726 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14728 else if(exp->destType && !exp->destType->keepCast)
14730 if(!CheckExpressionType(exp, exp->destType, 0x0))
14732 if(!exp->destType->count || unresolved)
14737 if(exp->destType->kind != 14)
14744 char expString[10240];
14746 expString[0] = '\0';
14747 PrintType(exp->destType, type2, 0x0, 0x1);
14750 PrintExpression(exp, expString);
14751 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14755 else if(exp->type != 16)
14756 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14761 char expString[10240];
14763 expString[0] = '\0';
14766 PrintExpression(exp, expString);
14767 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14770 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14771 else if(exp->type != 16)
14772 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14784 PrintType(exp->expType, type1, 0x0, 0x1);
14785 PrintType(exp->destType, type2, 0x0, 0x1);
14787 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)))
14791 char expString[10240];
14793 expString[0] = '\0';
14796 PrintExpression(exp, expString);
14797 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14799 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14800 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14801 FreeType(exp->expType);
14802 exp->destType->refCount++;
14803 exp->expType = exp->destType;
14808 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14810 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14811 char typeString[1024];
14812 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14813 struct Declarator * decl;
14815 typeString[0] = '\0';
14818 exp->expType->refCount++;
14820 exp->expType->refCount++;
14822 newExp->destType = exp->expType;
14823 PrintType(exp->expType, typeString, 0x0, 0x0);
14824 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14825 exp->cast.typeName = MkTypeName(specs, decl);
14826 exp->cast.exp = newExp;
14829 else if(unresolved)
14831 if(exp->identifier->_class && exp->identifier->_class->name)
14832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14833 else if(exp->identifier->string && exp->identifier->string[0])
14834 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14836 else if(!exp->expType && exp->type != 16)
14838 char expString[10240];
14840 expString[0] = '\0';
14843 PrintExpression(exp, expString);
14844 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14846 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14848 ApplyAnyObjectLogic(exp);
14849 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14851 exp->byReference = 0x1;
14853 yylloc = oldyylloc;
14856 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)
14860 *curMember = (*curMember)->next;
14861 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14863 *curMember = subMemberStack[--(*subMemberStackPos)];
14864 *curMember = (*curMember)->next;
14866 while((*curMember) && (*curMember)->isProperty)
14867 *curMember = (*curMember)->next;
14868 if(subMemberStackPos)
14870 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14872 subMemberStack[(*subMemberStackPos)++] = *curMember;
14873 *curMember = (*curMember)->members.first;
14874 while(*curMember && (*curMember)->isProperty)
14875 *curMember = (*curMember)->next;
14883 if(subMemberStackPos && *subMemberStackPos)
14885 *curMember = subMemberStack[--(*subMemberStackPos)];
14886 *curMember = (*curMember)->next;
14890 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14892 if(*curClass == _class)
14894 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14896 *curMember = (*curClass)->membersAndProperties.first;
14898 while((*curMember) && (*curMember)->isProperty)
14899 *curMember = (*curMember)->next;
14900 if(subMemberStackPos)
14902 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14904 subMemberStack[(*subMemberStackPos)++] = *curMember;
14905 *curMember = (*curMember)->members.first;
14906 while(*curMember && (*curMember)->isProperty)
14907 *curMember = (*curMember)->next;
14914 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14919 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14921 if(init->exp && !init->exp->destType)
14923 FreeType(init->exp->destType);
14924 init->exp->destType = type;
14930 ProcessExpressionType(init->exp);
14931 init->isConstant = init->exp->isConstant;
14937 struct Expression * exp = init->exp;
14938 struct Instantiation * inst = exp->instance;
14939 struct MembersInit * members;
14942 init->list = MkList();
14945 for(members = (*inst->members).first; members; members = members->next)
14947 if(members->type == 0)
14949 struct MemberInit * member;
14951 for(member = (*members->dataMembers).first; member; member = member->next)
14953 ListAdd(init->list, member->initializer);
14954 member->initializer = (((void *)0));
14959 FreeExpression(exp);
14963 struct Initializer * i;
14964 struct Type * initializerType = (((void *)0));
14965 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
14966 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
14967 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
14968 int subMemberStackPos = 0;
14970 if(type && type->kind == 12)
14971 initializerType = Dereference(type);
14972 else if(type && (type->kind == 9 || type->kind == 10))
14973 initializerType = type->members.first;
14974 for(i = (*init->list).first; i; i = i->next)
14976 if(type && type->kind == 8 && type->_class && type->_class->registered)
14978 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
14981 if(!curMember->dataType)
14982 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
14983 initializerType = curMember->dataType;
14986 ProcessInitializer(i, initializerType);
14987 if(initializerType && type && (type->kind == 9 || type->kind == 10))
14988 initializerType = initializerType->next;
14990 init->isConstant = 0x0;
14992 if(type && type->kind == 12)
14993 FreeType(initializerType);
14994 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
14996 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15003 extern struct Symbol * FindType(struct Context * ctx, char * name);
15005 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15007 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15013 if(spec->specifier == THISCLASS)
15018 spec->name = ReplaceThisClass(thisClass);
15019 spec->symbol = FindClass(spec->name);
15020 ProcessSpecifier(spec, declareStruct);
15027 struct Symbol * symbol = FindType(curContext, spec->name);
15030 DeclareType(symbol->type, 0x1, 0x1);
15031 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15032 DeclareStruct(spec->name, 0x0);
15037 struct Enumerator * e;
15041 for(e = (*spec->list).first; e; e = e->next)
15044 ProcessExpressionType(e->exp);
15052 if(spec->definitions)
15054 struct ClassDef * def;
15055 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15057 ProcessClass(spec->definitions, symbol);
15064 static void ProcessDeclarator(struct Declarator * decl)
15069 if(decl->identifier->classSym)
15071 FreeSpecifier(decl->identifier->_class);
15072 decl->identifier->_class = (((void *)0));
15076 if(decl->array.exp)
15077 ProcessExpressionType(decl->array.exp);
15084 if(decl->declarator)
15085 ProcessDeclarator(decl->declarator);
15086 if(decl->type == 4)
15088 struct Identifier * id = GetDeclId(decl);
15090 if(id && id->_class)
15092 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15094 if(!decl->function.parameters)
15095 decl->function.parameters = MkList();
15096 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15097 id->_class = (((void *)0));
15099 if(decl->function.parameters)
15101 struct TypeName * param;
15103 for(param = (*decl->function.parameters).first; param; param = param->next)
15105 if(param->qualifiers && (*param->qualifiers).first)
15107 struct Specifier * spec = (*param->qualifiers).first;
15109 if(spec && spec->specifier == TYPED_OBJECT)
15111 struct Declarator * d = param->declarator;
15112 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);
15114 FreeList(param->qualifiers, FreeSpecifier);
15115 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15116 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15117 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15120 else if(spec && spec->specifier == ANY_OBJECT)
15122 struct Declarator * d = param->declarator;
15124 FreeList(param->qualifiers, FreeSpecifier);
15125 param->qualifiers = MkListOne(MkSpecifier(VOID));
15126 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15128 else if(spec->specifier == THISCLASS)
15133 spec->name = ReplaceThisClass(thisClass);
15134 spec->symbol = FindClass(spec->name);
15135 ProcessSpecifier(spec, 0x0);
15139 if(param->declarator)
15140 ProcessDeclarator(param->declarator);
15148 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15150 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15152 static void ProcessDeclaration(struct Declaration * decl)
15154 yylloc = decl->loc;
15159 unsigned int declareStruct = 0x0;
15161 if(decl->declarators)
15163 struct InitDeclarator * d;
15165 for(d = (*decl->declarators).first; d; d = d->next)
15167 struct Type * type, * subType;
15169 ProcessDeclarator(d->declarator);
15170 type = ProcessType(decl->specifiers, d->declarator);
15173 ProcessInitializer(d->initializer, type);
15174 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15176 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15178 struct Instantiation * inst = d->initializer->exp->instance;
15180 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15181 d->initializer->exp->instance = (((void *)0));
15182 if(decl->specifiers)
15183 FreeList(decl->specifiers, FreeSpecifier);
15184 FreeList(decl->declarators, FreeInitDeclarator);
15191 for(subType = type; subType; )
15193 if(subType->kind == 8)
15195 declareStruct = 0x1;
15198 else if(subType->kind == 13)
15200 else if(subType->kind == 12)
15201 subType = subType->arrayType;
15210 if(decl->specifiers)
15212 struct Specifier * s;
15214 for(s = (*decl->specifiers).first; s; s = s->next)
15216 ProcessSpecifier(s, declareStruct);
15223 ProcessInstantiationType(decl->inst);
15228 struct Specifier * spec;
15229 struct Declarator * d;
15230 unsigned int declareStruct = 0x0;
15232 if(decl->declarators)
15234 for(d = (*decl->declarators).first; d; d = d->next)
15236 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15237 struct Type * subType;
15239 ProcessDeclarator(d);
15240 for(subType = type; subType; )
15242 if(subType->kind == 8)
15244 declareStruct = 0x1;
15247 else if(subType->kind == 13)
15249 else if(subType->kind == 12)
15250 subType = subType->arrayType;
15257 if(decl->specifiers)
15259 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15260 ProcessSpecifier(spec, declareStruct);
15267 static struct FunctionDefinition * curFunction;
15269 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15271 char propName[1024], propNameM[1024];
15272 char getName[1024], setName[1024];
15273 struct __ecereNameSpace__ecere__sys__OldList * args;
15275 DeclareProperty(prop, setName, getName);
15276 strcpy(propName, "__ecereProp_");
15277 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15278 strcat(propName, "_");
15279 FullClassNameCat(propName, prop->name, 0x1);
15280 MangleClassName(propName);
15281 strcpy(propNameM, "__ecerePropM_");
15282 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15283 strcat(propNameM, "_");
15284 FullClassNameCat(propNameM, prop->name, 0x1);
15285 MangleClassName(propNameM);
15286 if(prop->isWatchable)
15289 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15290 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15291 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15293 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15294 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15295 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15299 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15300 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15301 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15303 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15304 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15305 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15307 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15308 curFunction->propSet->fireWatchersDone = 0x1;
15311 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15313 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15315 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15317 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15319 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15321 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15323 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15325 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15327 static void ProcessStatement(struct Statement * stmt)
15329 yylloc = stmt->loc;
15333 ProcessStatement(stmt->labeled.stmt);
15336 if(stmt->caseStmt.exp)
15338 FreeType(stmt->caseStmt.exp->destType);
15339 stmt->caseStmt.exp->destType = curSwitchType;
15341 curSwitchType->refCount++;
15342 ProcessExpressionType(stmt->caseStmt.exp);
15343 ComputeExpression(stmt->caseStmt.exp);
15345 if(stmt->caseStmt.stmt)
15346 ProcessStatement(stmt->caseStmt.stmt);
15350 if(stmt->compound.context)
15352 struct Declaration * decl;
15353 struct Statement * s;
15354 struct Statement * prevCompound = curCompound;
15355 struct Context * prevContext = curContext;
15357 if(!stmt->compound.isSwitch)
15359 curCompound = stmt;
15360 curContext = stmt->compound.context;
15362 if(stmt->compound.declarations)
15364 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15365 ProcessDeclaration(decl);
15367 if(stmt->compound.statements)
15369 for(s = (*stmt->compound.statements).first; s; s = s->next)
15370 ProcessStatement(s);
15372 curContext = prevContext;
15373 curCompound = prevCompound;
15379 struct Expression * exp;
15381 if(stmt->expressions)
15383 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15384 ProcessExpressionType(exp);
15390 struct Expression * exp;
15392 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15393 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15394 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15395 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15397 ProcessExpressionType(exp);
15399 if(stmt->ifStmt.stmt)
15400 ProcessStatement(stmt->ifStmt.stmt);
15401 if(stmt->ifStmt.elseStmt)
15402 ProcessStatement(stmt->ifStmt.elseStmt);
15407 struct Type * oldSwitchType = curSwitchType;
15409 if(stmt->switchStmt.exp)
15411 struct Expression * exp;
15413 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15417 ProcessExpressionType(exp);
15420 curSwitchType = exp->expType;
15423 ProcessStatement(stmt->switchStmt.stmt);
15424 curSwitchType = oldSwitchType;
15429 if(stmt->whileStmt.exp)
15431 struct Expression * exp;
15433 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15434 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15435 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15436 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15438 ProcessExpressionType(exp);
15441 if(stmt->whileStmt.stmt)
15442 ProcessStatement(stmt->whileStmt.stmt);
15447 if(stmt->doWhile.exp)
15449 struct Expression * exp;
15451 if((*stmt->doWhile.exp).last)
15453 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15454 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15455 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15457 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15459 ProcessExpressionType(exp);
15462 if(stmt->doWhile.stmt)
15463 ProcessStatement(stmt->doWhile.stmt);
15468 struct Expression * exp;
15470 if(stmt->forStmt.init)
15471 ProcessStatement(stmt->forStmt.init);
15472 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15474 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15475 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15476 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15478 if(stmt->forStmt.check)
15479 ProcessStatement(stmt->forStmt.check);
15480 if(stmt->forStmt.increment)
15482 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15483 ProcessExpressionType(exp);
15485 if(stmt->forStmt.stmt)
15486 ProcessStatement(stmt->forStmt.stmt);
15491 struct Identifier * id = stmt->forEachStmt.id;
15492 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15493 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15494 struct Statement * block = stmt->forEachStmt.stmt;
15495 char iteratorType[1024];
15496 struct Type * source;
15497 struct Expression * e;
15498 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));
15499 struct Expression * arrayExp;
15500 char * typeString = (((void *)0));
15501 int builtinCount = 0;
15503 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15507 FreeType(e->destType);
15508 e->destType = ProcessTypeString("Container", 0x0);
15510 if(!isBuiltin || e->next)
15511 ProcessExpressionType(e);
15513 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15514 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15516 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15517 struct Symbol * symbol;
15518 struct Expression * expIt = (((void *)0));
15519 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15520 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15521 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15522 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15525 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15526 stmt->compound.context->parent = curContext;
15527 curContext = stmt->compound.context;
15528 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15530 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15531 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15533 isCustomAVLTree = 0x1;
15534 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15536 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15539 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15541 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15543 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15546 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15550 struct Declarator * decl;
15551 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15553 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15554 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15555 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15559 struct Type * type = (((void *)0));
15560 char typeStringBuf[1024];
15562 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15563 if(((struct Expression *)(*exp).last)->type == 11)
15565 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15568 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15570 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)
15572 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15574 typeString = templateClass->templateArgs[2].dataTypeString;
15576 else if(arrayExp->list)
15578 struct Expression * e;
15580 for(e = (*arrayExp->list).first; e; e = e->next)
15582 ProcessExpressionType(e);
15592 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15596 e->expType = (((void *)0));
15597 e = (*arrayExp->list).first;
15598 ProcessExpressionType(e);
15601 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15603 FreeType(e->expType);
15604 e->expType = (((void *)0));
15606 type = (((void *)0));
15614 FreeType(e->expType);
15615 e->expType = (((void *)0));
15621 typeStringBuf[0] = '\0';
15622 PrintType(type, typeStringBuf, 0x0, 0x1);
15623 typeString = typeStringBuf;
15629 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15630 struct Declarator * decl;
15631 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15635 struct Expression * e;
15637 builtinCount = (*arrayExp->list).count;
15638 type = ProcessTypeString(typeString, 0x0);
15639 while(e = (*arrayExp->list).first)
15641 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15642 e->destType = type;
15644 ProcessExpressionType(e);
15645 ListAdd(initializers, MkInitializerAssignment(e));
15648 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15650 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15651 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15652 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15653 FreeList(exp, FreeExpression);
15657 arrayExp->expType = ProcessTypeString("Container", 0x0);
15658 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15661 else if(isLinkList && !isList)
15663 struct Declarator * decl;
15664 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15666 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15667 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15668 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15670 else if(_class->templateArgs)
15673 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15675 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15676 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15678 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15679 if(block && block->type == 2 && block->compound.context)
15681 block->compound.context->parent = stmt->compound.context;
15685 block = MkIfStmt(filter, block, (((void *)0)));
15689 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));
15690 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15691 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15692 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15698 sprintf(count, "%d", builtinCount);
15699 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));
15700 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15701 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15702 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15704 else if(isLinkList && !isList)
15706 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15707 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15709 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15711 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));
15715 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15716 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15718 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));
15720 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15721 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15722 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15726 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15728 ProcessExpressionType(expIt);
15729 if((*stmt->compound.declarations).first)
15730 ProcessDeclaration((*stmt->compound.declarations).first);
15732 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15733 ProcessStatement(stmt);
15734 curContext = stmt->compound.context->parent;
15739 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15751 struct Expression * exp;
15753 if(stmt->expressions)
15755 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15759 if(curFunction && !curFunction->type)
15760 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15761 FreeType(exp->destType);
15762 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15764 exp->destType->refCount++;
15766 ProcessExpressionType(exp);
15773 ProcessDeclaration(stmt->decl);
15778 struct AsmField * field;
15780 if(stmt->asmStmt.inputFields)
15782 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15783 if(field->expression)
15784 ProcessExpressionType(field->expression);
15786 if(stmt->asmStmt.outputFields)
15788 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15789 if(field->expression)
15790 ProcessExpressionType(field->expression);
15792 if(stmt->asmStmt.clobberedFields)
15794 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15796 if(field->expression)
15797 ProcessExpressionType(field->expression);
15804 struct PropertyWatch * propWatch;
15805 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15806 struct Expression * object = stmt->_watch.object;
15807 struct Expression * watcher = stmt->_watch.watcher;
15810 ProcessExpressionType(watcher);
15812 ProcessExpressionType(object);
15815 if(watcher || thisClass)
15817 struct External * external = curExternal;
15818 struct Context * context = curContext;
15821 stmt->expressions = MkList();
15822 curExternal = external->prev;
15823 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15825 struct ClassFunction * func;
15826 char watcherName[1024];
15827 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15828 struct External * createdExternal;
15829 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15831 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15832 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15833 if(propWatch->deleteWatch)
15834 strcat(watcherName, "_delete");
15837 struct Identifier * propID;
15839 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15841 strcat(watcherName, "_");
15842 strcat(watcherName, propID->string);
15845 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15847 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15848 ProcessClassFunctionBody(func, propWatch->compound);
15849 propWatch->compound = (((void *)0));
15850 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15851 createdExternal->symbol->idCode = external->symbol->idCode;
15852 curExternal = createdExternal;
15853 ProcessFunction(createdExternal->function);
15855 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15857 externalDecl->declaration = decl;
15858 if(decl->symbol && !decl->symbol->pointerExternal)
15859 decl->symbol->pointerExternal = externalDecl;
15861 if(propWatch->deleteWatch)
15863 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15865 ListAdd(args, CopyExpression(object));
15866 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15867 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15868 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15872 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15873 struct Identifier * propID;
15875 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15877 char propName[1024];
15878 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15882 char getName[1024], setName[1024];
15883 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15885 DeclareProperty(prop, setName, getName);
15886 strcpy(propName, "__ecereProp_");
15887 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15888 strcat(propName, "_");
15889 FullClassNameCat(propName, prop->name, 0x1);
15890 ListAdd(args, CopyExpression(object));
15891 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15892 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15893 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15894 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15897 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15904 curExternal = external;
15905 curContext = context;
15907 FreeExpression(watcher);
15909 FreeExpression(object);
15910 FreeList(watches, FreePropertyWatch);
15913 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15917 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15919 ProcessStatement(propWatch->compound);
15926 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15927 struct Expression * object = stmt->_watch.object;
15928 struct __ecereNameSpace__ecere__com__Class * _class;
15931 ProcessExpressionType(object);
15934 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15937 struct Identifier * propID;
15940 stmt->expressions = MkList();
15941 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15943 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15950 for(propID = (*watches).first; propID; propID = propID->next)
15952 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15956 CreateFireWatcher(prop, object, stmt);
15959 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15964 struct __ecereNameSpace__ecere__com__Property * prop;
15965 struct __ecereNameSpace__ecere__com__Class * base;
15967 for(base = _class; base; base = base->base)
15969 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
15971 if(prop->isProperty && prop->isWatchable)
15973 CreateFireWatcher(prop, object, stmt);
15979 FreeExpression(object);
15980 FreeList(watches, FreeIdentifier);
15983 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
15989 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15990 struct Expression * object = stmt->_watch.object;
15991 struct Expression * watcher = stmt->_watch.watcher;
15992 struct __ecereNameSpace__ecere__com__Class * _class;
15995 ProcessExpressionType(object);
15997 ProcessExpressionType(watcher);
16000 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16001 if(watcher || thisClass)
16005 struct Identifier * propID;
16008 stmt->expressions = MkList();
16011 struct __ecereNameSpace__ecere__sys__OldList * args;
16014 ListAdd(args, CopyExpression(object));
16015 ListAdd(args, MkExpConstant("0"));
16016 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16017 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16021 for(propID = (*watches).first; propID; propID = propID->next)
16023 char propName[1024];
16024 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16028 char getName[1024], setName[1024];
16029 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16031 DeclareProperty(prop, setName, getName);
16032 strcpy(propName, "__ecereProp_");
16033 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16034 strcat(propName, "_");
16035 FullClassNameCat(propName, prop->name, 0x1);
16036 MangleClassName(propName);
16037 ListAdd(args, CopyExpression(object));
16038 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16039 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16040 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16043 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16047 FreeExpression(object);
16049 FreeExpression(watcher);
16050 FreeList(watches, FreeIdentifier);
16053 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16056 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16063 extern struct Expression * QBrackets(struct Expression * exp);
16065 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16067 extern struct Declarator * QMkPtrDecl(char * id);
16069 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16071 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16073 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16075 static void ProcessFunction(struct FunctionDefinition * function)
16077 void * __ecereTemp2;
16078 void * __ecereTemp1;
16079 struct Identifier * id = GetDeclId(function->declarator);
16080 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16081 struct Type * type = symbol ? symbol->type : (((void *)0));
16082 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16083 struct Context * oldTopContext = topContext;
16085 yylloc = function->loc;
16086 if(type && type->thisClass)
16088 struct Symbol * classSym = type->thisClass;
16089 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16090 char className[1024];
16091 char structName[1024];
16092 struct Declarator * funcDecl;
16093 struct Symbol * thisSymbol;
16094 unsigned int typedObject = 0x0;
16096 if(_class && !_class->base)
16098 _class = currentClass;
16099 if(_class && !_class->symbol)
16100 _class->symbol = FindClass(_class->fullName);
16101 classSym = _class ? _class->symbol : (((void *)0));
16104 thisClass = _class;
16105 if(inCompiler && _class)
16107 if(type->kind == 11)
16109 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16111 struct Type * param = symbol->type->params.first;
16113 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16116 if(type->classObjectType != 1)
16118 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16119 symbol->type->staticMethod = 0x1;
16120 symbol->type->thisClass = (((void *)0));
16121 symbol->type->extraParam = 0x0;
16124 strcpy(className, "__ecereClass_");
16125 FullClassNameCat(className, _class->fullName, 0x1);
16126 MangleClassName(className);
16127 structName[0] = (char)0;
16128 FullClassNameCat(structName, _class->fullName, 0x0);
16129 funcDecl = GetFuncDecl(function->declarator);
16132 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16134 struct TypeName * param = (*funcDecl->function.parameters).first;
16136 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16139 FreeTypeName(param);
16142 if(!function->propertyNoThis)
16144 struct TypeName * thisParam;
16146 if(type->classObjectType != 1)
16148 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16149 if(!funcDecl->function.parameters)
16150 funcDecl->function.parameters = MkList();
16151 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16155 if(type->classObjectType != 1)
16157 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16158 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16160 thisParam = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), ((struct TypeName *)__ecereTemp1)->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), ((struct TypeName *)__ecereTemp1)->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), ((struct TypeName *)__ecereTemp1));
16161 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16165 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16167 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16169 funcDecl = GetFuncDecl(initDecl->declarator);
16172 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16174 struct TypeName * param = (*funcDecl->function.parameters).first;
16176 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16178 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16179 FreeTypeName(param);
16182 if(type->classObjectType != 1)
16184 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16186 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16188 if(!funcDecl->function.parameters)
16189 funcDecl->function.parameters = MkList();
16190 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16198 if(type->classObjectType != 1)
16200 thisSymbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("this"), ((struct Symbol *)__ecereTemp1)->type = classSym ? MkClassType(classSym->string) : (((void *)0)), ((struct Symbol *)__ecereTemp1));
16201 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16202 if(typedObject && thisSymbol->type)
16204 thisSymbol->type->classObjectType = 2;
16205 thisSymbol->type->byReference = type->byReference;
16209 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16211 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16214 struct __ecereNameSpace__ecere__com__Class * base;
16216 for(base = _class; base && base->type != 1000; base = base->next)
16218 for(member = base->membersAndProperties.first; member; member = member->next)
16219 if(!member->isProperty)
16225 for(member = _class->membersAndProperties.first; member; member = member->next)
16226 if(!member->isProperty)
16230 char pointerName[1024];
16231 struct Declaration * decl;
16232 struct Initializer * initializer;
16233 struct Expression * exp, * bytePtr;
16235 strcpy(pointerName, "__ecerePointer_");
16236 FullClassNameCat(pointerName, _class->fullName, 0x0);
16238 char className[1024];
16240 strcpy(className, "__ecereClass_");
16241 FullClassNameCat(className, classSym->string, 0x1);
16242 MangleClassName(className);
16243 DeclareClass(classSym, className);
16245 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16250 sprintf(string, "%d", _class->offset);
16251 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16255 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16257 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16258 exp->expType = (__ecereTemp2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp2)->refCount = 1, ((struct Type *)__ecereTemp2)->kind = 13, ((struct Type *)__ecereTemp2)->type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 0, ((struct Type *)__ecereTemp1)), ((struct Type *)__ecereTemp2));
16261 yylloc = function->body->loc;
16262 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16264 struct Context * prevContext = curContext;
16266 curContext = function->body->compound.context;
16267 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16268 curContext = prevContext;
16270 decl->symbol = (((void *)0));
16271 if(!function->body->compound.declarations)
16272 function->body->compound.declarations = MkList();
16273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16279 thisClass = (((void *)0));
16282 FreeSpecifier(id->_class);
16283 id->_class = (((void *)0));
16284 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16286 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16288 id = GetDeclId(initDecl->declarator);
16289 FreeSpecifier(id->_class);
16290 id->_class = (((void *)0));
16294 topContext = function->body->compound.context;
16296 struct FunctionDefinition * oldFunction = curFunction;
16298 curFunction = function;
16300 ProcessStatement(function->body);
16301 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16303 struct Statement * prevCompound = curCompound;
16304 struct Context * prevContext = curContext;
16305 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16307 if(!function->body->compound.statements)
16308 function->body->compound.statements = MkList();
16309 ListAdd(function->body->compound.statements, fireWatchers);
16310 curCompound = function->body;
16311 curContext = function->body->compound.context;
16312 ProcessStatement(fireWatchers);
16313 curContext = prevContext;
16314 curCompound = prevCompound;
16316 curFunction = oldFunction;
16318 if(function->declarator)
16320 ProcessDeclarator(function->declarator);
16322 topContext = oldTopContext;
16323 thisClass = oldThisClass;
16326 extern void FreeSymbol(struct Symbol * symbol);
16328 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16330 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16332 struct ClassDef * def;
16333 struct External * external = curExternal;
16334 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16336 for(def = definitions->first; def; def = def->next)
16340 if(def->function->declarator)
16341 curExternal = def->function->declarator->symbol->pointerExternal;
16343 curExternal = external;
16344 ProcessFunction((struct FunctionDefinition *)def->function);
16346 else if(def->type == 2)
16348 if(def->decl->type == 2)
16350 thisClass = regClass;
16351 ProcessInstantiationType(def->decl->inst);
16352 thisClass = (((void *)0));
16356 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16359 thisClass = regClass;
16360 ProcessDeclaration(def->decl);
16361 thisClass = backThisClass;
16364 else if(def->type == 1 && def->defProperties)
16366 struct MemberInit * defProperty;
16367 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);
16369 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16370 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16372 thisClass = regClass;
16373 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16374 thisClass = (((void *)0));
16376 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16377 FreeSymbol(thisSymbol);
16379 else if(def->type == 3 && def->propertyDef)
16381 struct PropertyDef * prop = def->propertyDef;
16383 thisClass = regClass;
16388 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16390 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16392 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16393 ProcessStatement(prop->setStmt);
16399 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16401 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16403 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16404 ProcessStatement(prop->getStmt);
16406 if(prop->issetStmt)
16410 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16412 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16414 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16415 ProcessStatement(prop->issetStmt);
16417 thisClass = (((void *)0));
16419 else if(def->type == 4 && def->propertyWatch)
16421 struct PropertyWatch * propertyWatch = def->propertyWatch;
16423 thisClass = regClass;
16424 if(propertyWatch->compound)
16426 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);
16428 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16429 curExternal = (((void *)0));
16430 ProcessStatement(propertyWatch->compound);
16432 thisClass = (((void *)0));
16437 void DeclareFunctionUtil(char * s)
16439 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16446 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16447 strcpy(name, "__ecereFunction_");
16448 FullClassNameCat(name, s, 0x0);
16449 DeclareFunction(function, name);
16453 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16455 void ComputeDataTypes()
16457 void * __ecereTemp1;
16458 struct External * external;
16459 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16460 struct External * after = (((void *)0));
16462 currentClass = (((void *)0));
16463 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16464 for(external = (*ast).first; external; external = external->next)
16466 if(external->type == 1)
16468 struct Declaration * decl = external->declaration;
16472 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16476 struct InitDeclarator * initDecl = (*decls).first;
16480 struct Declarator * declarator = initDecl->declarator;
16482 if(declarator && declarator->type == 1)
16484 struct Identifier * id = declarator->identifier;
16486 if(id && id->string)
16488 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16490 external->symbol->id = -1001, external->symbol->idCode = -1001;
16500 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16501 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16502 curExternal = temp;
16503 DeclareFunctionUtil("eSystem_New");
16504 DeclareFunctionUtil("eSystem_New0");
16505 DeclareFunctionUtil("eSystem_Renew");
16506 DeclareFunctionUtil("eSystem_Renew0");
16507 DeclareFunctionUtil("eClass_GetProperty");
16508 DeclareStruct("ecere::com::Class", 0x0);
16509 DeclareStruct("ecere::com::Instance", 0x0);
16510 DeclareStruct("ecere::com::Property", 0x0);
16511 DeclareStruct("ecere::com::DataMember", 0x0);
16512 DeclareStruct("ecere::com::Method", 0x0);
16513 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16514 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16515 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16516 for(external = (*ast).first; external; external = external->next)
16518 afterExternal = curExternal = external;
16519 if(external->type == 0)
16521 currentClass = external->function->_class;
16522 ProcessFunction(external->function);
16524 else if(external->type == 1)
16526 currentClass = (((void *)0));
16527 ProcessDeclaration(external->declaration);
16529 else if(external->type == 2)
16531 struct ClassDefinition * _class = external->_class;
16533 currentClass = external->symbol->registered;
16534 if(_class->definitions)
16536 ProcessClass(_class->definitions, _class->symbol);
16540 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16541 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16544 else if(external->type == 4)
16546 thisNameSpace = external->id->string;
16549 currentClass = (((void *)0));
16550 thisNameSpace = (((void *)0));
16551 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16552 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16555 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);
16557 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char * name, char * baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
16559 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16561 struct __ecereNameSpace__ecere__com__Class * class;
16563 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16564 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16565 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16566 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16567 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16568 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16569 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16570 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16571 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16572 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16573 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16574 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16575 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16576 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16577 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16578 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16579 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16580 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16581 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16582 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16583 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16584 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16585 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16586 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16587 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16588 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16589 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16590 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16591 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16592 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16593 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16594 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16595 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16596 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16597 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16598 __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);
16599 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16600 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16601 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16602 __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);
16603 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16604 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16605 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16607 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16608 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16610 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16611 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16612 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16613 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16614 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16615 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16616 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16617 __ecereClass_Conversion = class;
16618 __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);
16619 __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);
16620 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16621 __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);
16622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16623 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16626 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16627 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16637 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16641 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)