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;
5162 struct Type * backupSourceExpType = (((void *)0));
5164 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5166 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5168 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5170 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5172 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5174 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5176 if(sourceBase == destBase)
5182 struct __ecereNameSpace__ecere__sys__OldList * specs;
5183 unsigned int flag = 0x0;
5184 long long value = (((int)0x7fffffff));
5188 if(sourceExp->type == 2)
5190 if(source->isSigned)
5191 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5193 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5195 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5197 if(source->isSigned)
5198 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5200 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5202 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5205 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));
5209 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5211 if(_class && _class->type == 3)
5213 if(source->kind != 8)
5215 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5216 struct Type * tempDest, * tempSource;
5218 for(; _class->base->type != 1000; _class = _class->base)
5221 tempDest = tempType;
5224 _class->symbol = FindClass(_class->fullName);
5225 tempType->_class = _class->symbol;
5226 tempType->truth = dest->truth;
5227 if(tempType->_class)
5228 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5229 backupSourceExpType = sourceExp->expType;
5230 sourceExp->expType = dest;
5233 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5236 if(_class && _class->type == 2 && source->kind != 8)
5238 if(!dest->_class->registered->dataType)
5239 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5240 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5243 FreeType(sourceExp->expType);
5244 source = sourceExp->expType = MkClassType(dest->_class->string);
5248 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5250 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5251 struct Declarator * decl;
5254 ReadString(string, sourceExp->string);
5255 decl = SpecDeclFromString(string, specs, (((void *)0)));
5256 FreeExpContents(sourceExp);
5257 FreeType(sourceExp->expType);
5258 sourceExp->type = 26;
5259 sourceExp->_classExp.specifiers = specs;
5260 sourceExp->_classExp.decl = decl;
5261 sourceExp->expType = dest;
5265 if(backupSourceExpType)
5266 FreeType(backupSourceExpType);
5270 else if(source->kind == 8)
5272 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5274 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5278 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5279 struct Type * tempDest, * tempSource;
5281 if(!source->_class->registered->dataType)
5282 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5283 for(; _class->base->type != 1000; _class = _class->base)
5286 tempSource = tempType;
5288 tempType->_class = FindClass(_class->fullName);
5289 tempType->truth = source->truth;
5290 tempType->classObjectType = source->classObjectType;
5291 if(tempType->_class)
5292 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5293 if(conversions->last)
5295 ((struct Conversion *)conversions->last)->resultType = dest;
5298 FreeType(sourceExp->expType);
5299 sourceExp->expType = MkClassType(_class->fullName);
5300 sourceExp->expType->truth = source->truth;
5301 sourceExp->expType->classObjectType = source->classObjectType;
5302 if(!sourceExp->destType)
5304 FreeType(sourceExp->destType);
5305 sourceExp->destType = sourceExp->expType;
5306 if(sourceExp->expType)
5307 sourceExp->expType->refCount++;
5309 if(!_class->dataType)
5310 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5312 dest = MkClassType(source->_class->string);
5313 dest->truth = source->truth;
5314 dest->classObjectType = source->classObjectType;
5316 source = _class->dataType;
5318 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5324 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5333 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5335 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5337 if(_class->type == 0 || _class->type == 5)
5339 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5341 *newExp = *sourceExp;
5342 if(sourceExp->destType)
5343 sourceExp->destType->refCount++;
5344 if(sourceExp->expType)
5345 sourceExp->expType->refCount++;
5346 sourceExp->type = 11;
5347 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5348 sourceExp->cast.exp = newExp;
5349 FreeType(sourceExp->expType);
5350 sourceExp->expType = (((void *)0));
5351 ProcessExpressionType(sourceExp);
5354 FreeType(sourceExp->expType);
5355 sourceExp->expType = dest;
5360 if(backupSourceExpType)
5361 FreeType(backupSourceExpType);
5364 if(!_class->dataType)
5365 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5367 dest = _class->dataType;
5370 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5372 specs = MkListOne(MkSpecifier(DOUBLE));
5374 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5376 specs = MkListOne(MkSpecifier(FLOAT));
5378 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5382 ListAdd(specs, MkSpecifier(UNSIGNED));
5383 ListAdd(specs, MkSpecifier(INT64));
5385 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5389 ListAdd(specs, MkSpecifier(UNSIGNED));
5390 ListAdd(specs, MkSpecifier(INT));
5392 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5396 ListAdd(specs, MkSpecifier(UNSIGNED));
5397 ListAdd(specs, MkSpecifier(SHORT));
5399 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5403 ListAdd(specs, MkSpecifier(UNSIGNED));
5404 ListAdd(specs, MkSpecifier(CHAR));
5410 if(backupSourceExpType)
5412 if(sourceExp->expType)
5413 FreeType(sourceExp->expType);
5414 sourceExp->expType = backupSourceExpType;
5419 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))
5421 specs = MkListOne(MkSpecifier(DOUBLE));
5423 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5425 specs = MkListOne(MkSpecifier(FLOAT));
5427 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)))
5431 ListAdd(specs, MkSpecifier(UNSIGNED));
5432 ListAdd(specs, MkSpecifier(CHAR));
5434 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)))))
5438 ListAdd(specs, MkSpecifier(UNSIGNED));
5439 ListAdd(specs, MkSpecifier(SHORT));
5441 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5445 ListAdd(specs, MkSpecifier(UNSIGNED));
5446 ListAdd(specs, MkSpecifier(INT));
5448 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5452 ListAdd(specs, MkSpecifier(UNSIGNED));
5453 ListAdd(specs, MkSpecifier(INT64));
5455 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5457 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5463 if(backupSourceExpType)
5465 if(sourceExp->expType)
5466 FreeType(sourceExp->expType);
5467 sourceExp->expType = backupSourceExpType;
5473 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5475 *newExp = *sourceExp;
5476 newExp->prev = (((void *)0));
5477 newExp->next = (((void *)0));
5478 if(sourceExp->destType)
5479 sourceExp->destType->refCount++;
5480 if(sourceExp->expType)
5481 sourceExp->expType->refCount++;
5482 sourceExp->type = 11;
5483 if(realDest->kind == 8)
5485 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5486 FreeList(specs, FreeSpecifier);
5489 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5490 if(newExp->type == 4)
5492 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5495 sourceExp->cast.exp = newExp;
5496 FreeType(sourceExp->expType);
5497 sourceExp->expType = (((void *)0));
5498 ProcessExpressionType(sourceExp);
5501 FreeList(specs, FreeSpecifier);
5504 if(backupSourceExpType)
5505 FreeType(backupSourceExpType);
5510 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5511 sourceExp = (*sourceExp->list).last;
5512 if(sourceExp->type == 0)
5514 struct Identifier * id = sourceExp->identifier;
5518 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5520 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5521 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5525 for(; _class && _class->type == 4; _class = _class->base)
5527 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5528 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5530 for(value = e->values.first; value; value = value->next)
5532 if(!strcmp(value->name, id->string))
5537 FreeExpContents(sourceExp);
5538 FreeType(sourceExp->expType);
5539 sourceExp->isConstant = 0x1;
5540 sourceExp->expType = MkClassType(_class->fullName);
5544 sourceExp->type = 2;
5545 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5546 sprintf(constant, "%d", value->data);
5548 sprintf(constant, "0x%X", value->data);
5549 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5557 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5564 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5566 int value2 = op2->i;
5569 exp->string = PrintInt(op1->i + value2);
5572 exp->expType = op1->type;
5574 op1->type->refCount++;
5579 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5581 unsigned int value2 = op2->ui;
5584 exp->string = PrintUInt(op1->ui + value2);
5587 exp->expType = op1->type;
5589 op1->type->refCount++;
5594 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5596 short value2 = op2->s;
5599 exp->string = PrintShort(op1->s + value2);
5602 exp->expType = op1->type;
5604 op1->type->refCount++;
5609 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5611 unsigned short value2 = op2->us;
5614 exp->string = PrintUShort(op1->us + value2);
5617 exp->expType = op1->type;
5619 op1->type->refCount++;
5624 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5626 char value2 = op2->c;
5629 exp->string = PrintChar(op1->c + value2);
5632 exp->expType = op1->type;
5634 op1->type->refCount++;
5639 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5641 unsigned char value2 = op2->uc;
5644 exp->string = PrintUChar(op1->uc + value2);
5647 exp->expType = op1->type;
5649 op1->type->refCount++;
5654 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5656 float value2 = op2->f;
5659 exp->string = PrintFloat(op1->f + value2);
5662 exp->expType = op1->type;
5664 op1->type->refCount++;
5669 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5671 double value2 = op2->d;
5674 exp->string = PrintDouble(op1->d + value2);
5677 exp->expType = op1->type;
5679 op1->type->refCount++;
5684 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5686 int value2 = op2->i;
5689 exp->string = PrintInt(op1->i - value2);
5692 exp->expType = op1->type;
5694 op1->type->refCount++;
5699 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5701 unsigned int value2 = op2->ui;
5704 exp->string = PrintUInt(op1->ui - value2);
5707 exp->expType = op1->type;
5709 op1->type->refCount++;
5714 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5716 short value2 = op2->s;
5719 exp->string = PrintShort(op1->s - value2);
5722 exp->expType = op1->type;
5724 op1->type->refCount++;
5729 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5731 unsigned short value2 = op2->us;
5734 exp->string = PrintUShort(op1->us - value2);
5737 exp->expType = op1->type;
5739 op1->type->refCount++;
5744 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5746 char value2 = op2->c;
5749 exp->string = PrintChar(op1->c - value2);
5752 exp->expType = op1->type;
5754 op1->type->refCount++;
5759 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5761 unsigned char value2 = op2->uc;
5764 exp->string = PrintUChar(op1->uc - value2);
5767 exp->expType = op1->type;
5769 op1->type->refCount++;
5774 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5776 float value2 = op2->f;
5779 exp->string = PrintFloat(op1->f - value2);
5782 exp->expType = op1->type;
5784 op1->type->refCount++;
5789 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5791 double value2 = op2->d;
5794 exp->string = PrintDouble(op1->d - value2);
5797 exp->expType = op1->type;
5799 op1->type->refCount++;
5804 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5806 int value2 = op2->i;
5809 exp->string = PrintInt(op1->i * value2);
5812 exp->expType = op1->type;
5814 op1->type->refCount++;
5819 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5821 unsigned int value2 = op2->ui;
5824 exp->string = PrintUInt(op1->ui * value2);
5827 exp->expType = op1->type;
5829 op1->type->refCount++;
5834 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5836 short value2 = op2->s;
5839 exp->string = PrintShort(op1->s * value2);
5842 exp->expType = op1->type;
5844 op1->type->refCount++;
5849 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5851 unsigned short value2 = op2->us;
5854 exp->string = PrintUShort(op1->us * value2);
5857 exp->expType = op1->type;
5859 op1->type->refCount++;
5864 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5866 char value2 = op2->c;
5869 exp->string = PrintChar(op1->c * value2);
5872 exp->expType = op1->type;
5874 op1->type->refCount++;
5879 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5881 unsigned char value2 = op2->uc;
5884 exp->string = PrintUChar(op1->uc * value2);
5887 exp->expType = op1->type;
5889 op1->type->refCount++;
5894 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5896 float value2 = op2->f;
5899 exp->string = PrintFloat(op1->f * value2);
5902 exp->expType = op1->type;
5904 op1->type->refCount++;
5909 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5911 double value2 = op2->d;
5914 exp->string = PrintDouble(op1->d * value2);
5917 exp->expType = op1->type;
5919 op1->type->refCount++;
5924 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5926 int value2 = op2->i;
5929 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5932 exp->expType = op1->type;
5934 op1->type->refCount++;
5939 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5941 unsigned int value2 = op2->ui;
5944 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5947 exp->expType = op1->type;
5949 op1->type->refCount++;
5954 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5956 short value2 = op2->s;
5959 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5962 exp->expType = op1->type;
5964 op1->type->refCount++;
5969 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5971 unsigned short value2 = op2->us;
5974 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5977 exp->expType = op1->type;
5979 op1->type->refCount++;
5984 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5986 char value2 = op2->c;
5989 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5992 exp->expType = op1->type;
5994 op1->type->refCount++;
5999 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6001 unsigned char value2 = op2->uc;
6004 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6007 exp->expType = op1->type;
6009 op1->type->refCount++;
6014 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6016 float value2 = op2->f;
6019 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
6022 exp->expType = op1->type;
6024 op1->type->refCount++;
6029 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6031 double value2 = op2->d;
6034 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
6037 exp->expType = op1->type;
6039 op1->type->refCount++;
6044 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6046 int value2 = op2->i;
6049 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6052 exp->expType = op1->type;
6054 op1->type->refCount++;
6059 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6061 unsigned int value2 = op2->ui;
6064 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6067 exp->expType = op1->type;
6069 op1->type->refCount++;
6074 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6076 short value2 = op2->s;
6079 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6082 exp->expType = op1->type;
6084 op1->type->refCount++;
6089 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6091 unsigned short value2 = op2->us;
6094 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6097 exp->expType = op1->type;
6099 op1->type->refCount++;
6104 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6106 char value2 = op2->c;
6109 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6112 exp->expType = op1->type;
6114 op1->type->refCount++;
6119 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6121 unsigned char value2 = op2->uc;
6124 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6127 exp->expType = op1->type;
6129 op1->type->refCount++;
6134 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6137 exp->string = PrintInt(-op1->i);
6140 exp->expType = op1->type;
6142 op1->type->refCount++;
6147 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6150 exp->string = PrintUInt(-op1->ui);
6153 exp->expType = op1->type;
6155 op1->type->refCount++;
6160 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6163 exp->string = PrintShort(-op1->s);
6166 exp->expType = op1->type;
6168 op1->type->refCount++;
6173 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6176 exp->string = PrintUShort(-op1->us);
6179 exp->expType = op1->type;
6181 op1->type->refCount++;
6186 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6189 exp->string = PrintChar(-op1->c);
6192 exp->expType = op1->type;
6194 op1->type->refCount++;
6199 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6202 exp->string = PrintUChar(-op1->uc);
6205 exp->expType = op1->type;
6207 op1->type->refCount++;
6212 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6215 exp->string = PrintFloat(-op1->f);
6218 exp->expType = op1->type;
6220 op1->type->refCount++;
6225 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6228 exp->string = PrintDouble(-op1->d);
6231 exp->expType = op1->type;
6233 op1->type->refCount++;
6238 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6241 exp->string = PrintInt(++op1->i);
6244 exp->expType = op1->type;
6246 op1->type->refCount++;
6251 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6254 exp->string = PrintUInt(++op1->ui);
6257 exp->expType = op1->type;
6259 op1->type->refCount++;
6264 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6267 exp->string = PrintShort(++op1->s);
6270 exp->expType = op1->type;
6272 op1->type->refCount++;
6277 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6280 exp->string = PrintUShort(++op1->us);
6283 exp->expType = op1->type;
6285 op1->type->refCount++;
6290 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6293 exp->string = PrintChar(++op1->c);
6296 exp->expType = op1->type;
6298 op1->type->refCount++;
6303 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6306 exp->string = PrintUChar(++op1->uc);
6309 exp->expType = op1->type;
6311 op1->type->refCount++;
6316 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6319 exp->string = PrintFloat(++op1->f);
6322 exp->expType = op1->type;
6324 op1->type->refCount++;
6329 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6332 exp->string = PrintDouble(++op1->d);
6335 exp->expType = op1->type;
6337 op1->type->refCount++;
6342 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6345 exp->string = PrintInt(--op1->i);
6348 exp->expType = op1->type;
6350 op1->type->refCount++;
6355 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6358 exp->string = PrintUInt(--op1->ui);
6361 exp->expType = op1->type;
6363 op1->type->refCount++;
6368 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6371 exp->string = PrintShort(--op1->s);
6374 exp->expType = op1->type;
6376 op1->type->refCount++;
6381 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6384 exp->string = PrintUShort(--op1->us);
6387 exp->expType = op1->type;
6389 op1->type->refCount++;
6394 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6397 exp->string = PrintChar(--op1->c);
6400 exp->expType = op1->type;
6402 op1->type->refCount++;
6407 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6410 exp->string = PrintUChar(--op1->uc);
6413 exp->expType = op1->type;
6415 op1->type->refCount++;
6420 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6423 exp->string = PrintFloat(--op1->f);
6426 exp->expType = op1->type;
6428 op1->type->refCount++;
6433 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6436 exp->string = PrintDouble(--op1->d);
6439 exp->expType = op1->type;
6441 op1->type->refCount++;
6446 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6448 int value2 = op2->i;
6451 exp->string = PrintInt(op1->i = value2);
6454 exp->expType = op1->type;
6456 op1->type->refCount++;
6461 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6463 unsigned int value2 = op2->ui;
6466 exp->string = PrintUInt(op1->ui = value2);
6469 exp->expType = op1->type;
6471 op1->type->refCount++;
6476 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6478 short value2 = op2->s;
6481 exp->string = PrintShort(op1->s = value2);
6484 exp->expType = op1->type;
6486 op1->type->refCount++;
6491 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6493 unsigned short value2 = op2->us;
6496 exp->string = PrintUShort(op1->us = value2);
6499 exp->expType = op1->type;
6501 op1->type->refCount++;
6506 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6508 char value2 = op2->c;
6511 exp->string = PrintChar(op1->c = value2);
6514 exp->expType = op1->type;
6516 op1->type->refCount++;
6521 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6523 unsigned char value2 = op2->uc;
6526 exp->string = PrintUChar(op1->uc = value2);
6529 exp->expType = op1->type;
6531 op1->type->refCount++;
6536 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6538 float value2 = op2->f;
6541 exp->string = PrintFloat(op1->f = value2);
6544 exp->expType = op1->type;
6546 op1->type->refCount++;
6551 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6553 double value2 = op2->d;
6556 exp->string = PrintDouble(op1->d = value2);
6559 exp->expType = op1->type;
6561 op1->type->refCount++;
6566 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6568 int value2 = op2->i;
6571 exp->string = PrintInt(op1->i += value2);
6574 exp->expType = op1->type;
6576 op1->type->refCount++;
6581 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6583 unsigned int value2 = op2->ui;
6586 exp->string = PrintUInt(op1->ui += value2);
6589 exp->expType = op1->type;
6591 op1->type->refCount++;
6596 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6598 short value2 = op2->s;
6601 exp->string = PrintShort(op1->s += value2);
6604 exp->expType = op1->type;
6606 op1->type->refCount++;
6611 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6613 unsigned short value2 = op2->us;
6616 exp->string = PrintUShort(op1->us += value2);
6619 exp->expType = op1->type;
6621 op1->type->refCount++;
6626 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6628 char value2 = op2->c;
6631 exp->string = PrintChar(op1->c += value2);
6634 exp->expType = op1->type;
6636 op1->type->refCount++;
6641 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6643 unsigned char value2 = op2->uc;
6646 exp->string = PrintUChar(op1->uc += value2);
6649 exp->expType = op1->type;
6651 op1->type->refCount++;
6656 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6658 float value2 = op2->f;
6661 exp->string = PrintFloat(op1->f += value2);
6664 exp->expType = op1->type;
6666 op1->type->refCount++;
6671 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6673 double value2 = op2->d;
6676 exp->string = PrintDouble(op1->d += value2);
6679 exp->expType = op1->type;
6681 op1->type->refCount++;
6686 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6688 int value2 = op2->i;
6691 exp->string = PrintInt(op1->i -= value2);
6694 exp->expType = op1->type;
6696 op1->type->refCount++;
6701 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6703 unsigned int value2 = op2->ui;
6706 exp->string = PrintUInt(op1->ui -= value2);
6709 exp->expType = op1->type;
6711 op1->type->refCount++;
6716 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6718 short value2 = op2->s;
6721 exp->string = PrintShort(op1->s -= value2);
6724 exp->expType = op1->type;
6726 op1->type->refCount++;
6731 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6733 unsigned short value2 = op2->us;
6736 exp->string = PrintUShort(op1->us -= value2);
6739 exp->expType = op1->type;
6741 op1->type->refCount++;
6746 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6748 char value2 = op2->c;
6751 exp->string = PrintChar(op1->c -= value2);
6754 exp->expType = op1->type;
6756 op1->type->refCount++;
6761 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6763 unsigned char value2 = op2->uc;
6766 exp->string = PrintUChar(op1->uc -= value2);
6769 exp->expType = op1->type;
6771 op1->type->refCount++;
6776 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6778 float value2 = op2->f;
6781 exp->string = PrintFloat(op1->f -= value2);
6784 exp->expType = op1->type;
6786 op1->type->refCount++;
6791 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6793 double value2 = op2->d;
6796 exp->string = PrintDouble(op1->d -= value2);
6799 exp->expType = op1->type;
6801 op1->type->refCount++;
6806 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6808 int value2 = op2->i;
6811 exp->string = PrintInt(op1->i *= value2);
6814 exp->expType = op1->type;
6816 op1->type->refCount++;
6821 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6823 unsigned int value2 = op2->ui;
6826 exp->string = PrintUInt(op1->ui *= value2);
6829 exp->expType = op1->type;
6831 op1->type->refCount++;
6836 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6838 short value2 = op2->s;
6841 exp->string = PrintShort(op1->s *= value2);
6844 exp->expType = op1->type;
6846 op1->type->refCount++;
6851 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6853 unsigned short value2 = op2->us;
6856 exp->string = PrintUShort(op1->us *= value2);
6859 exp->expType = op1->type;
6861 op1->type->refCount++;
6866 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6868 char value2 = op2->c;
6871 exp->string = PrintChar(op1->c *= value2);
6874 exp->expType = op1->type;
6876 op1->type->refCount++;
6881 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6883 unsigned char value2 = op2->uc;
6886 exp->string = PrintUChar(op1->uc *= value2);
6889 exp->expType = op1->type;
6891 op1->type->refCount++;
6896 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6898 float value2 = op2->f;
6901 exp->string = PrintFloat(op1->f *= value2);
6904 exp->expType = op1->type;
6906 op1->type->refCount++;
6911 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6913 double value2 = op2->d;
6916 exp->string = PrintDouble(op1->d *= value2);
6919 exp->expType = op1->type;
6921 op1->type->refCount++;
6926 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6928 int value2 = op2->i;
6931 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6934 exp->expType = op1->type;
6936 op1->type->refCount++;
6941 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6943 unsigned int value2 = op2->ui;
6946 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6949 exp->expType = op1->type;
6951 op1->type->refCount++;
6956 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6958 short value2 = op2->s;
6961 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6964 exp->expType = op1->type;
6966 op1->type->refCount++;
6971 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6973 unsigned short value2 = op2->us;
6976 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6979 exp->expType = op1->type;
6981 op1->type->refCount++;
6986 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6988 char value2 = op2->c;
6991 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
6994 exp->expType = op1->type;
6996 op1->type->refCount++;
7001 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7003 unsigned char value2 = op2->uc;
7006 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7009 exp->expType = op1->type;
7011 op1->type->refCount++;
7016 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7018 float value2 = op2->f;
7021 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
7024 exp->expType = op1->type;
7026 op1->type->refCount++;
7031 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7033 double value2 = op2->d;
7036 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
7039 exp->expType = op1->type;
7041 op1->type->refCount++;
7046 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7048 int value2 = op2->i;
7051 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7054 exp->expType = op1->type;
7056 op1->type->refCount++;
7061 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7063 unsigned int value2 = op2->ui;
7066 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7069 exp->expType = op1->type;
7071 op1->type->refCount++;
7076 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7078 short value2 = op2->s;
7081 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7084 exp->expType = op1->type;
7086 op1->type->refCount++;
7091 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7093 unsigned short value2 = op2->us;
7096 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7099 exp->expType = op1->type;
7101 op1->type->refCount++;
7106 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7108 char value2 = op2->c;
7111 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7114 exp->expType = op1->type;
7116 op1->type->refCount++;
7121 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7123 unsigned char value2 = op2->uc;
7126 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7129 exp->expType = op1->type;
7131 op1->type->refCount++;
7136 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7138 int value2 = op2->i;
7141 exp->string = PrintInt(op1->i & value2);
7144 exp->expType = op1->type;
7146 op1->type->refCount++;
7151 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7153 unsigned int value2 = op2->ui;
7156 exp->string = PrintUInt(op1->ui & value2);
7159 exp->expType = op1->type;
7161 op1->type->refCount++;
7166 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7168 short value2 = op2->s;
7171 exp->string = PrintShort(op1->s & value2);
7174 exp->expType = op1->type;
7176 op1->type->refCount++;
7181 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7183 unsigned short value2 = op2->us;
7186 exp->string = PrintUShort(op1->us & value2);
7189 exp->expType = op1->type;
7191 op1->type->refCount++;
7196 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7198 char value2 = op2->c;
7201 exp->string = PrintChar(op1->c & value2);
7204 exp->expType = op1->type;
7206 op1->type->refCount++;
7211 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7213 unsigned char value2 = op2->uc;
7216 exp->string = PrintUChar(op1->uc & value2);
7219 exp->expType = op1->type;
7221 op1->type->refCount++;
7226 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7228 int value2 = op2->i;
7231 exp->string = PrintInt(op1->i | value2);
7234 exp->expType = op1->type;
7236 op1->type->refCount++;
7241 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7243 unsigned int value2 = op2->ui;
7246 exp->string = PrintUInt(op1->ui | value2);
7249 exp->expType = op1->type;
7251 op1->type->refCount++;
7256 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7258 short value2 = op2->s;
7261 exp->string = PrintShort(op1->s | value2);
7264 exp->expType = op1->type;
7266 op1->type->refCount++;
7271 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7273 unsigned short value2 = op2->us;
7276 exp->string = PrintUShort(op1->us | value2);
7279 exp->expType = op1->type;
7281 op1->type->refCount++;
7286 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7288 char value2 = op2->c;
7291 exp->string = PrintChar(op1->c | value2);
7294 exp->expType = op1->type;
7296 op1->type->refCount++;
7301 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7303 unsigned char value2 = op2->uc;
7306 exp->string = PrintUChar(op1->uc | value2);
7309 exp->expType = op1->type;
7311 op1->type->refCount++;
7316 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7318 int value2 = op2->i;
7321 exp->string = PrintInt(op1->i ^ value2);
7324 exp->expType = op1->type;
7326 op1->type->refCount++;
7331 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7333 unsigned int value2 = op2->ui;
7336 exp->string = PrintUInt(op1->ui ^ value2);
7339 exp->expType = op1->type;
7341 op1->type->refCount++;
7346 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7348 short value2 = op2->s;
7351 exp->string = PrintShort(op1->s ^ value2);
7354 exp->expType = op1->type;
7356 op1->type->refCount++;
7361 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7363 unsigned short value2 = op2->us;
7366 exp->string = PrintUShort(op1->us ^ value2);
7369 exp->expType = op1->type;
7371 op1->type->refCount++;
7376 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7378 char value2 = op2->c;
7381 exp->string = PrintChar(op1->c ^ value2);
7384 exp->expType = op1->type;
7386 op1->type->refCount++;
7391 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7393 unsigned char value2 = op2->uc;
7396 exp->string = PrintUChar(op1->uc ^ value2);
7399 exp->expType = op1->type;
7401 op1->type->refCount++;
7406 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7408 int value2 = op2->i;
7411 exp->string = PrintInt(op1->i << value2);
7414 exp->expType = op1->type;
7416 op1->type->refCount++;
7421 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7423 unsigned int value2 = op2->ui;
7426 exp->string = PrintUInt(op1->ui << value2);
7429 exp->expType = op1->type;
7431 op1->type->refCount++;
7436 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7438 short value2 = op2->s;
7441 exp->string = PrintShort(op1->s << value2);
7444 exp->expType = op1->type;
7446 op1->type->refCount++;
7451 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7453 unsigned short value2 = op2->us;
7456 exp->string = PrintUShort(op1->us << value2);
7459 exp->expType = op1->type;
7461 op1->type->refCount++;
7466 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7468 char value2 = op2->c;
7471 exp->string = PrintChar(op1->c << value2);
7474 exp->expType = op1->type;
7476 op1->type->refCount++;
7481 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7483 unsigned char value2 = op2->uc;
7486 exp->string = PrintUChar(op1->uc << value2);
7489 exp->expType = op1->type;
7491 op1->type->refCount++;
7496 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7498 int value2 = op2->i;
7501 exp->string = PrintInt(op1->i >> value2);
7504 exp->expType = op1->type;
7506 op1->type->refCount++;
7511 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7513 unsigned int value2 = op2->ui;
7516 exp->string = PrintUInt(op1->ui >> value2);
7519 exp->expType = op1->type;
7521 op1->type->refCount++;
7526 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7528 short value2 = op2->s;
7531 exp->string = PrintShort(op1->s >> value2);
7534 exp->expType = op1->type;
7536 op1->type->refCount++;
7541 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7543 unsigned short value2 = op2->us;
7546 exp->string = PrintUShort(op1->us >> value2);
7549 exp->expType = op1->type;
7551 op1->type->refCount++;
7556 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7558 char value2 = op2->c;
7561 exp->string = PrintChar(op1->c >> value2);
7564 exp->expType = op1->type;
7566 op1->type->refCount++;
7571 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7573 unsigned char value2 = op2->uc;
7576 exp->string = PrintUChar(op1->uc >> value2);
7579 exp->expType = op1->type;
7581 op1->type->refCount++;
7586 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7589 exp->string = PrintInt(~op1->i);
7592 exp->expType = op1->type;
7594 op1->type->refCount++;
7599 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7602 exp->string = PrintUInt(~op1->ui);
7605 exp->expType = op1->type;
7607 op1->type->refCount++;
7612 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7615 exp->string = PrintShort(~op1->s);
7618 exp->expType = op1->type;
7620 op1->type->refCount++;
7625 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7628 exp->string = PrintUShort(~op1->us);
7631 exp->expType = op1->type;
7633 op1->type->refCount++;
7638 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7641 exp->string = PrintChar(~op1->c);
7644 exp->expType = op1->type;
7646 op1->type->refCount++;
7651 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7654 exp->string = PrintUChar(~op1->uc);
7657 exp->expType = op1->type;
7659 op1->type->refCount++;
7664 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7666 int value2 = op2->i;
7669 exp->string = PrintInt(op1->i &= value2);
7672 exp->expType = op1->type;
7674 op1->type->refCount++;
7679 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7681 unsigned int value2 = op2->ui;
7684 exp->string = PrintUInt(op1->ui &= value2);
7687 exp->expType = op1->type;
7689 op1->type->refCount++;
7694 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7696 short value2 = op2->s;
7699 exp->string = PrintShort(op1->s &= value2);
7702 exp->expType = op1->type;
7704 op1->type->refCount++;
7709 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7711 unsigned short value2 = op2->us;
7714 exp->string = PrintUShort(op1->us &= value2);
7717 exp->expType = op1->type;
7719 op1->type->refCount++;
7724 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7726 char value2 = op2->c;
7729 exp->string = PrintChar(op1->c &= value2);
7732 exp->expType = op1->type;
7734 op1->type->refCount++;
7739 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7741 unsigned char value2 = op2->uc;
7744 exp->string = PrintUChar(op1->uc &= value2);
7747 exp->expType = op1->type;
7749 op1->type->refCount++;
7754 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7756 int value2 = op2->i;
7759 exp->string = PrintInt(op1->i |= value2);
7762 exp->expType = op1->type;
7764 op1->type->refCount++;
7769 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7771 unsigned int value2 = op2->ui;
7774 exp->string = PrintUInt(op1->ui |= value2);
7777 exp->expType = op1->type;
7779 op1->type->refCount++;
7784 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7786 short value2 = op2->s;
7789 exp->string = PrintShort(op1->s |= value2);
7792 exp->expType = op1->type;
7794 op1->type->refCount++;
7799 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7801 unsigned short value2 = op2->us;
7804 exp->string = PrintUShort(op1->us |= value2);
7807 exp->expType = op1->type;
7809 op1->type->refCount++;
7814 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7816 char value2 = op2->c;
7819 exp->string = PrintChar(op1->c |= value2);
7822 exp->expType = op1->type;
7824 op1->type->refCount++;
7829 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7831 unsigned char value2 = op2->uc;
7834 exp->string = PrintUChar(op1->uc |= value2);
7837 exp->expType = op1->type;
7839 op1->type->refCount++;
7844 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7846 int value2 = op2->i;
7849 exp->string = PrintInt(op1->i ^= value2);
7852 exp->expType = op1->type;
7854 op1->type->refCount++;
7859 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7861 unsigned int value2 = op2->ui;
7864 exp->string = PrintUInt(op1->ui ^= value2);
7867 exp->expType = op1->type;
7869 op1->type->refCount++;
7874 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7876 short value2 = op2->s;
7879 exp->string = PrintShort(op1->s ^= value2);
7882 exp->expType = op1->type;
7884 op1->type->refCount++;
7889 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7891 unsigned short value2 = op2->us;
7894 exp->string = PrintUShort(op1->us ^= value2);
7897 exp->expType = op1->type;
7899 op1->type->refCount++;
7904 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7906 char value2 = op2->c;
7909 exp->string = PrintChar(op1->c ^= value2);
7912 exp->expType = op1->type;
7914 op1->type->refCount++;
7919 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7921 unsigned char value2 = op2->uc;
7924 exp->string = PrintUChar(op1->uc ^= value2);
7927 exp->expType = op1->type;
7929 op1->type->refCount++;
7934 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7936 int value2 = op2->i;
7939 exp->string = PrintInt(op1->i <<= value2);
7942 exp->expType = op1->type;
7944 op1->type->refCount++;
7949 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7951 unsigned int value2 = op2->ui;
7954 exp->string = PrintUInt(op1->ui <<= value2);
7957 exp->expType = op1->type;
7959 op1->type->refCount++;
7964 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7966 short value2 = op2->s;
7969 exp->string = PrintShort(op1->s <<= value2);
7972 exp->expType = op1->type;
7974 op1->type->refCount++;
7979 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7981 unsigned short value2 = op2->us;
7984 exp->string = PrintUShort(op1->us <<= value2);
7987 exp->expType = op1->type;
7989 op1->type->refCount++;
7994 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7996 char value2 = op2->c;
7999 exp->string = PrintChar(op1->c <<= value2);
8002 exp->expType = op1->type;
8004 op1->type->refCount++;
8009 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8011 unsigned char value2 = op2->uc;
8014 exp->string = PrintUChar(op1->uc <<= value2);
8017 exp->expType = op1->type;
8019 op1->type->refCount++;
8024 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8026 int value2 = op2->i;
8029 exp->string = PrintInt(op1->i >>= value2);
8032 exp->expType = op1->type;
8034 op1->type->refCount++;
8039 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8041 unsigned int value2 = op2->ui;
8044 exp->string = PrintUInt(op1->ui >>= value2);
8047 exp->expType = op1->type;
8049 op1->type->refCount++;
8054 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8056 short value2 = op2->s;
8059 exp->string = PrintShort(op1->s >>= value2);
8062 exp->expType = op1->type;
8064 op1->type->refCount++;
8069 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8071 unsigned short value2 = op2->us;
8074 exp->string = PrintUShort(op1->us >>= value2);
8077 exp->expType = op1->type;
8079 op1->type->refCount++;
8084 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8086 char value2 = op2->c;
8089 exp->string = PrintChar(op1->c >>= value2);
8092 exp->expType = op1->type;
8094 op1->type->refCount++;
8099 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8101 unsigned char value2 = op2->uc;
8104 exp->string = PrintUChar(op1->uc >>= value2);
8107 exp->expType = op1->type;
8109 op1->type->refCount++;
8114 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8117 exp->string = PrintInt(!op1->i);
8120 exp->expType = op1->type;
8122 op1->type->refCount++;
8127 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8130 exp->string = PrintUInt(!op1->ui);
8133 exp->expType = op1->type;
8135 op1->type->refCount++;
8140 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8143 exp->string = PrintShort(!op1->s);
8146 exp->expType = op1->type;
8148 op1->type->refCount++;
8153 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8156 exp->string = PrintUShort(!op1->us);
8159 exp->expType = op1->type;
8161 op1->type->refCount++;
8166 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8169 exp->string = PrintChar(!op1->c);
8172 exp->expType = op1->type;
8174 op1->type->refCount++;
8179 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8182 exp->string = PrintUChar(!op1->uc);
8185 exp->expType = op1->type;
8187 op1->type->refCount++;
8192 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8194 int value2 = op2->i;
8197 exp->string = PrintInt(op1->i == value2);
8200 exp->expType = op1->type;
8202 op1->type->refCount++;
8207 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8209 unsigned int value2 = op2->ui;
8212 exp->string = PrintUInt(op1->ui == value2);
8215 exp->expType = op1->type;
8217 op1->type->refCount++;
8222 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8224 short value2 = op2->s;
8227 exp->string = PrintShort(op1->s == value2);
8230 exp->expType = op1->type;
8232 op1->type->refCount++;
8237 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8239 unsigned short value2 = op2->us;
8242 exp->string = PrintUShort(op1->us == value2);
8245 exp->expType = op1->type;
8247 op1->type->refCount++;
8252 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8254 char value2 = op2->c;
8257 exp->string = PrintChar(op1->c == value2);
8260 exp->expType = op1->type;
8262 op1->type->refCount++;
8267 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8269 unsigned char value2 = op2->uc;
8272 exp->string = PrintUChar(op1->uc == value2);
8275 exp->expType = op1->type;
8277 op1->type->refCount++;
8282 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8284 float value2 = op2->f;
8287 exp->string = PrintFloat(op1->f == value2);
8290 exp->expType = op1->type;
8292 op1->type->refCount++;
8297 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8299 double value2 = op2->d;
8302 exp->string = PrintDouble(op1->d == value2);
8305 exp->expType = op1->type;
8307 op1->type->refCount++;
8312 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8314 int value2 = op2->i;
8317 exp->string = PrintInt(op1->i != value2);
8320 exp->expType = op1->type;
8322 op1->type->refCount++;
8327 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8329 unsigned int value2 = op2->ui;
8332 exp->string = PrintUInt(op1->ui != value2);
8335 exp->expType = op1->type;
8337 op1->type->refCount++;
8342 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8344 short value2 = op2->s;
8347 exp->string = PrintShort(op1->s != value2);
8350 exp->expType = op1->type;
8352 op1->type->refCount++;
8357 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8359 unsigned short value2 = op2->us;
8362 exp->string = PrintUShort(op1->us != value2);
8365 exp->expType = op1->type;
8367 op1->type->refCount++;
8372 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8374 char value2 = op2->c;
8377 exp->string = PrintChar(op1->c != value2);
8380 exp->expType = op1->type;
8382 op1->type->refCount++;
8387 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8389 unsigned char value2 = op2->uc;
8392 exp->string = PrintUChar(op1->uc != value2);
8395 exp->expType = op1->type;
8397 op1->type->refCount++;
8402 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8404 float value2 = op2->f;
8407 exp->string = PrintFloat(op1->f != value2);
8410 exp->expType = op1->type;
8412 op1->type->refCount++;
8417 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8419 double value2 = op2->d;
8422 exp->string = PrintDouble(op1->d != value2);
8425 exp->expType = op1->type;
8427 op1->type->refCount++;
8432 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8434 int value2 = op2->i;
8437 exp->string = PrintInt(op1->i && value2);
8440 exp->expType = op1->type;
8442 op1->type->refCount++;
8447 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8449 unsigned int value2 = op2->ui;
8452 exp->string = PrintUInt(op1->ui && value2);
8455 exp->expType = op1->type;
8457 op1->type->refCount++;
8462 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8464 short value2 = op2->s;
8467 exp->string = PrintShort(op1->s && value2);
8470 exp->expType = op1->type;
8472 op1->type->refCount++;
8477 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8479 unsigned short value2 = op2->us;
8482 exp->string = PrintUShort(op1->us && value2);
8485 exp->expType = op1->type;
8487 op1->type->refCount++;
8492 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8494 char value2 = op2->c;
8497 exp->string = PrintChar(op1->c && value2);
8500 exp->expType = op1->type;
8502 op1->type->refCount++;
8507 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8509 unsigned char value2 = op2->uc;
8512 exp->string = PrintUChar(op1->uc && value2);
8515 exp->expType = op1->type;
8517 op1->type->refCount++;
8522 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8524 float value2 = op2->f;
8527 exp->string = PrintFloat(op1->f && value2);
8530 exp->expType = op1->type;
8532 op1->type->refCount++;
8537 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8539 double value2 = op2->d;
8542 exp->string = PrintDouble(op1->d && value2);
8545 exp->expType = op1->type;
8547 op1->type->refCount++;
8552 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8554 int value2 = op2->i;
8557 exp->string = PrintInt(op1->i || value2);
8560 exp->expType = op1->type;
8562 op1->type->refCount++;
8567 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8569 unsigned int value2 = op2->ui;
8572 exp->string = PrintUInt(op1->ui || value2);
8575 exp->expType = op1->type;
8577 op1->type->refCount++;
8582 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8584 short value2 = op2->s;
8587 exp->string = PrintShort(op1->s || value2);
8590 exp->expType = op1->type;
8592 op1->type->refCount++;
8597 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8599 unsigned short value2 = op2->us;
8602 exp->string = PrintUShort(op1->us || value2);
8605 exp->expType = op1->type;
8607 op1->type->refCount++;
8612 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8614 char value2 = op2->c;
8617 exp->string = PrintChar(op1->c || value2);
8620 exp->expType = op1->type;
8622 op1->type->refCount++;
8627 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8629 unsigned char value2 = op2->uc;
8632 exp->string = PrintUChar(op1->uc || value2);
8635 exp->expType = op1->type;
8637 op1->type->refCount++;
8642 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8644 float value2 = op2->f;
8647 exp->string = PrintFloat(op1->f || value2);
8650 exp->expType = op1->type;
8652 op1->type->refCount++;
8657 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8659 double value2 = op2->d;
8662 exp->string = PrintDouble(op1->d || value2);
8665 exp->expType = op1->type;
8667 op1->type->refCount++;
8672 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8674 int value2 = op2->i;
8677 exp->string = PrintInt(op1->i > value2);
8680 exp->expType = op1->type;
8682 op1->type->refCount++;
8687 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8689 unsigned int value2 = op2->ui;
8692 exp->string = PrintUInt(op1->ui > value2);
8695 exp->expType = op1->type;
8697 op1->type->refCount++;
8702 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8704 short value2 = op2->s;
8707 exp->string = PrintShort(op1->s > value2);
8710 exp->expType = op1->type;
8712 op1->type->refCount++;
8717 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8719 unsigned short value2 = op2->us;
8722 exp->string = PrintUShort(op1->us > value2);
8725 exp->expType = op1->type;
8727 op1->type->refCount++;
8732 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8734 char value2 = op2->c;
8737 exp->string = PrintChar(op1->c > value2);
8740 exp->expType = op1->type;
8742 op1->type->refCount++;
8747 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8749 unsigned char value2 = op2->uc;
8752 exp->string = PrintUChar(op1->uc > value2);
8755 exp->expType = op1->type;
8757 op1->type->refCount++;
8762 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8764 float value2 = op2->f;
8767 exp->string = PrintFloat(op1->f > value2);
8770 exp->expType = op1->type;
8772 op1->type->refCount++;
8777 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8779 double value2 = op2->d;
8782 exp->string = PrintDouble(op1->d > value2);
8785 exp->expType = op1->type;
8787 op1->type->refCount++;
8792 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8794 int value2 = op2->i;
8797 exp->string = PrintInt(op1->i < value2);
8800 exp->expType = op1->type;
8802 op1->type->refCount++;
8807 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8809 unsigned int value2 = op2->ui;
8812 exp->string = PrintUInt(op1->ui < value2);
8815 exp->expType = op1->type;
8817 op1->type->refCount++;
8822 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8824 short value2 = op2->s;
8827 exp->string = PrintShort(op1->s < value2);
8830 exp->expType = op1->type;
8832 op1->type->refCount++;
8837 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8839 unsigned short value2 = op2->us;
8842 exp->string = PrintUShort(op1->us < value2);
8845 exp->expType = op1->type;
8847 op1->type->refCount++;
8852 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8854 char value2 = op2->c;
8857 exp->string = PrintChar(op1->c < value2);
8860 exp->expType = op1->type;
8862 op1->type->refCount++;
8867 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8869 unsigned char value2 = op2->uc;
8872 exp->string = PrintUChar(op1->uc < value2);
8875 exp->expType = op1->type;
8877 op1->type->refCount++;
8882 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8884 float value2 = op2->f;
8887 exp->string = PrintFloat(op1->f < value2);
8890 exp->expType = op1->type;
8892 op1->type->refCount++;
8897 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8899 double value2 = op2->d;
8902 exp->string = PrintDouble(op1->d < value2);
8905 exp->expType = op1->type;
8907 op1->type->refCount++;
8912 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8914 int value2 = op2->i;
8917 exp->string = PrintInt(op1->i >= value2);
8920 exp->expType = op1->type;
8922 op1->type->refCount++;
8927 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8929 unsigned int value2 = op2->ui;
8932 exp->string = PrintUInt(op1->ui >= value2);
8935 exp->expType = op1->type;
8937 op1->type->refCount++;
8942 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8944 short value2 = op2->s;
8947 exp->string = PrintShort(op1->s >= value2);
8950 exp->expType = op1->type;
8952 op1->type->refCount++;
8957 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8959 unsigned short value2 = op2->us;
8962 exp->string = PrintUShort(op1->us >= value2);
8965 exp->expType = op1->type;
8967 op1->type->refCount++;
8972 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8974 char value2 = op2->c;
8977 exp->string = PrintChar(op1->c >= value2);
8980 exp->expType = op1->type;
8982 op1->type->refCount++;
8987 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8989 unsigned char value2 = op2->uc;
8992 exp->string = PrintUChar(op1->uc >= value2);
8995 exp->expType = op1->type;
8997 op1->type->refCount++;
9002 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9004 float value2 = op2->f;
9007 exp->string = PrintFloat(op1->f >= value2);
9010 exp->expType = op1->type;
9012 op1->type->refCount++;
9017 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9019 double value2 = op2->d;
9022 exp->string = PrintDouble(op1->d >= value2);
9025 exp->expType = op1->type;
9027 op1->type->refCount++;
9032 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9034 int value2 = op2->i;
9037 exp->string = PrintInt(op1->i <= value2);
9040 exp->expType = op1->type;
9042 op1->type->refCount++;
9047 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9049 unsigned int value2 = op2->ui;
9052 exp->string = PrintUInt(op1->ui <= value2);
9055 exp->expType = op1->type;
9057 op1->type->refCount++;
9062 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9064 short value2 = op2->s;
9067 exp->string = PrintShort(op1->s <= value2);
9070 exp->expType = op1->type;
9072 op1->type->refCount++;
9077 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9079 unsigned short value2 = op2->us;
9082 exp->string = PrintUShort(op1->us <= value2);
9085 exp->expType = op1->type;
9087 op1->type->refCount++;
9092 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9094 char value2 = op2->c;
9097 exp->string = PrintChar(op1->c <= value2);
9100 exp->expType = op1->type;
9102 op1->type->refCount++;
9107 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9109 unsigned char value2 = op2->uc;
9112 exp->string = PrintUChar(op1->uc <= value2);
9115 exp->expType = op1->type;
9117 op1->type->refCount++;
9122 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9124 float value2 = op2->f;
9127 exp->string = PrintFloat(op1->f <= value2);
9130 exp->expType = op1->type;
9132 op1->type->refCount++;
9137 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9139 double value2 = op2->d;
9142 exp->string = PrintDouble(op1->d <= value2);
9145 exp->expType = op1->type;
9147 op1->type->refCount++;
9152 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9155 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9158 exp->expType = op1->type;
9160 op1->type->refCount++;
9165 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9168 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9171 exp->expType = op1->type;
9173 op1->type->refCount++;
9178 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9181 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9184 exp->expType = op1->type;
9186 op1->type->refCount++;
9191 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9194 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9197 exp->expType = op1->type;
9199 op1->type->refCount++;
9204 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9207 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9210 exp->expType = op1->type;
9212 op1->type->refCount++;
9217 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9220 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9223 exp->expType = op1->type;
9225 op1->type->refCount++;
9230 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9233 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9236 exp->expType = op1->type;
9238 op1->type->refCount++;
9243 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9246 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9249 exp->expType = op1->type;
9251 op1->type->refCount++;
9256 struct OpTable intOps =
9258 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
9261 struct OpTable uintOps =
9263 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
9266 struct OpTable shortOps =
9268 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
9271 struct OpTable ushortOps =
9273 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
9276 struct OpTable floatOps =
9278 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
9281 struct OpTable doubleOps =
9283 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
9286 struct OpTable charOps =
9288 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
9291 struct OpTable ucharOps =
9293 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
9296 void ReadString(char * output, char * string)
9298 int len = strlen(string);
9300 unsigned int quoted = 0x0, escaped = 0x0;
9302 for(c = 0; c < len; c++)
9304 char ch = string[c];
9360 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9362 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9364 extern double strtod(char * , char * * );
9366 struct Operand GetOperand(struct Expression * exp)
9372 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9375 struct Type * type = exp->expType;
9379 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9381 if(!type->_class->registered->dataType)
9382 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9383 type = type->_class->registered->dataType;
9385 op.kind = type->kind;
9386 op.type = exp->expType;
9387 if(exp->isConstant && exp->type == 2)
9393 if(exp->constant[0] == '\'')
9394 op.c = exp->constant[1];
9395 else if(type->isSigned)
9397 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9402 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9410 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9415 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9423 op.i = strtol(exp->constant, (((void *)0)), 0);
9428 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9436 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9441 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9449 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9454 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9462 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9467 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9473 op.f = (float)strtod(exp->constant, (((void *)0)));
9477 op.d = (double)strtod(exp->constant, (((void *)0)));
9483 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9493 int __ecereVMethodID_class_OnGetString;
9495 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9497 static void UnusedFunction()
9501 ((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);
9504 extern int __ecereVMethodID_class_OnGetString;
9506 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9508 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9510 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9512 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9513 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9516 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9517 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9519 void * ptr = inst->data + dataMember->offset + offset;
9520 char * result = (((void *)0));
9522 exp->loc = member->loc = inst->loc;
9523 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9524 if(!dataMember->dataType)
9525 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9526 type = dataMember->dataType;
9529 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9531 if(_class->type == 4)
9533 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9537 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9538 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9540 for(item = e->values.first; item; item = item->next)
9542 if((int)item->data == *(int *)ptr)
9544 result = item->name;
9550 exp->identifier = MkIdentifier(result);
9552 exp->destType = MkClassType(_class->fullName);
9553 ProcessExpressionType(exp);
9557 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9559 if(!_class->dataType)
9560 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9561 type = _class->dataType;
9570 FreeExpContents(exp);
9571 exp->constant = PrintFloat(*(float *)ptr);
9577 FreeExpContents(exp);
9578 exp->constant = PrintDouble(*(double *)ptr);
9584 FreeExpContents(exp);
9585 exp->constant = PrintInt(*(int *)ptr);
9591 FreeExpContents(exp);
9592 exp->constant = PrintInt64(*(long long *)ptr);
9598 FreeExpContents(exp);
9599 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9605 FreeExpContents(exp);
9606 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9611 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9614 ListAdd(memberList, member);
9616 if(parentDataMember->type == 1)
9621 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9623 void PopulateInstance(struct Instantiation * inst)
9625 struct Symbol * classSym = inst->_class->symbol;
9626 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9627 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9628 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9630 inst->members = MkListOne(MkMembersInitList(memberList));
9631 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9633 if(!dataMember->isProperty)
9635 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9636 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9639 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9640 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9642 void * ptr = inst->data + dataMember->offset;
9643 char * result = (((void *)0));
9645 exp->loc = member->loc = inst->loc;
9646 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9647 if(!dataMember->dataType)
9648 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9649 type = dataMember->dataType;
9652 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9654 if(_class->type == 4)
9656 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9660 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9661 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9663 for(item = e->values.first; item; item = item->next)
9665 if((int)item->data == *(int *)ptr)
9667 result = item->name;
9674 exp->identifier = MkIdentifier(result);
9676 exp->destType = MkClassType(_class->fullName);
9677 ProcessExpressionType(exp);
9680 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9682 if(!_class->dataType)
9683 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9684 type = _class->dataType;
9693 exp->constant = PrintFloat(*(float *)ptr);
9699 exp->constant = PrintDouble(*(double *)ptr);
9705 exp->constant = PrintInt(*(int *)ptr);
9711 exp->constant = PrintInt64(*(long long *)ptr);
9717 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9722 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9725 ListAdd(memberList, member);
9731 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);
9733 extern void FreeInstance(struct Instantiation * inst);
9735 void ComputeInstantiation(struct Expression * exp)
9737 struct Instantiation * inst = exp->instance;
9738 struct MembersInit * members;
9739 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9740 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9741 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9742 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9743 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9744 int subMemberStackPos = 0;
9747 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9751 if(_class->type == 0 || _class->type == 5)
9752 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9754 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9758 for(members = (*inst->members).first; members; members = members->next)
9760 switch(members->type)
9764 if(members->dataMembers)
9766 struct MemberInit * member;
9768 for(member = (*members->dataMembers).first; member; member = member->next)
9770 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9771 unsigned int found = 0x0;
9772 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9773 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9774 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9775 unsigned int dataMemberOffset;
9779 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9782 if(curMember->isProperty)
9783 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9786 dataMember = curMember;
9787 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9794 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9798 if(prop->memberAccess == 1)
9800 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9801 curClass = prop->_class;
9806 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9807 int _subMemberStackPos = 0;
9809 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9813 if(dataMember->memberAccess == 1)
9815 curMember = dataMember;
9816 curClass = dataMember->_class;
9817 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9818 subMemberStackPos = _subMemberStackPos;
9823 if(found && member->initializer && member->initializer->type == 0)
9825 struct Expression * value = member->initializer->exp;
9826 struct Type * type = (((void *)0));
9830 type = prop->dataType;
9834 if(!dataMember->dataType)
9835 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9836 type = dataMember->dataType;
9838 if(ident && ident->next)
9840 for(ident = ident->next; ident && type; ident = ident->next)
9844 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9846 type = prop->dataType;
9849 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9851 type = dataMember->dataType;
9854 else if(type->kind == 9 || type->kind == 10)
9856 struct Type * memberType;
9858 for(memberType = type->members.first; memberType; memberType = memberType->next)
9860 if(!strcmp(memberType->name, ident->string))
9871 FreeType(value->destType);
9872 value->destType = type;
9875 ComputeExpression(value);
9877 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9881 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9883 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9885 if(!_class->dataType)
9886 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9887 type = _class->dataType;
9892 void * ptr = inst->data + dataMemberOffset;
9894 if(value->type == 2)
9900 GetInt(value, (int *)ptr);
9905 GetInt64(value, (long long *)ptr);
9910 GetIntPtr(value, (intptr_t *)ptr);
9915 GetIntSize(value, (ssize_t *)ptr);
9920 GetFloat(value, (float *)ptr);
9925 GetDouble(value, (double *)ptr);
9930 else if(value->type == 1)
9934 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9936 if(_class->type == 1)
9938 ComputeTypeSize(type);
9939 if(value->instance->data)
9940 memcpy(ptr, value->instance->data, type->size);
9947 if(value->type == 1 && value->instance->data)
9949 void (* Set)(void *, void *) = (void *)prop->Set;
9951 Set(inst->data, value->instance->data);
9952 PopulateInstance(inst);
9954 else if(value->type == 2)
9960 void (* Set)(void *, double) = (void *)prop->Set;
9962 Set(inst->data, strtod(value->constant, (((void *)0))));
9967 void (* Set)(void *, float) = (void *)prop->Set;
9969 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9974 void (* Set)(void *, int) = (void *)prop->Set;
9976 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9981 void (* Set)(void *, long long) = (void *)prop->Set;
9983 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9988 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9990 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9995 void (* Set)(void *, ssize_t) = (void *)prop->Set;
9997 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10002 else if(value->type == 3)
10006 ReadString(temp, value->string);
10007 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10011 else if(_class->type == 3)
10015 if(value->type == 2)
10017 if(type->kind == 8)
10019 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10021 if(_class->type == 3)
10023 if(!_class->dataType)
10024 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10025 type = _class->dataType;
10033 float (* Set)(float) = (void *)prop->Set;
10035 GetFloat(member->initializer->exp, &fValue);
10036 exp->constant = PrintFloat(Set(fValue));
10043 double (* Set)(double) = (void *)prop->Set;
10045 GetDouble(member->initializer->exp, &dValue);
10046 exp->constant = PrintDouble(Set(dValue));
10054 else if(_class->type == 2)
10058 if(value->type == 1 && value->instance->data)
10060 unsigned int (* Set)(void *) = (void *)prop->Set;
10062 bits = Set(value->instance->data);
10064 else if(value->type == 2)
10068 else if(dataMember)
10070 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10071 struct Type * type;
10074 GetInt(value, &part);
10075 bits = (bits & ~bitMember->mask);
10076 if(!bitMember->dataType)
10077 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10078 type = bitMember->dataType;
10079 if(type->kind == 8 && type->_class && type->_class->registered)
10081 if(!type->_class->registered->dataType)
10082 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10083 type = type->_class->registered->dataType;
10089 bits |= ((char)part << bitMember->pos);
10091 bits |= ((unsigned char)part << bitMember->pos);
10095 bits |= ((short)part << bitMember->pos);
10097 bits |= ((unsigned short)part << bitMember->pos);
10102 bits |= (part << bitMember->pos);
10104 bits |= ((unsigned int)part << bitMember->pos);
10108 bits |= ((long long)part << bitMember->pos);
10110 bits |= ((uint64)part << bitMember->pos);
10115 bits |= ((intptr_t)part << bitMember->pos);
10119 bits |= ((uintptr_t)part << bitMember->pos);
10125 bits |= ((ssize_t)part << bitMember->pos);
10129 bits |= ((size_t)part << bitMember->pos);
10138 if(_class && _class->type == 3)
10140 ComputeExpression(member->initializer->exp);
10141 exp->constant = member->initializer->exp->constant;
10143 member->initializer->exp->constant = (((void *)0));
10153 if(_class && _class->type == 2)
10155 exp->constant = PrintHexUInt(bits);
10160 FreeInstance(inst);
10164 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10166 if(exp->op.op == SIZEOF)
10168 FreeExpContents(exp);
10170 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10180 struct Expression * exp2 = exp->op.exp2;
10182 exp->op.exp2 = (((void *)0));
10183 FreeExpContents(exp);
10184 FreeType(exp->expType);
10185 FreeType(exp->destType);
10187 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10193 FreeExpContents(exp);
10194 op1->ops.Neg(exp, op1);
10198 if(op1->ops.BitNot)
10200 FreeExpContents(exp);
10201 op1->ops.BitNot(exp, op1);
10207 FreeExpContents(exp);
10208 op1->ops.Not(exp, op1);
10220 FreeExpContents(exp);
10221 op1->ops.Add(exp, op1, op2);
10227 FreeExpContents(exp);
10228 op1->ops.Sub(exp, op1, op2);
10234 FreeExpContents(exp);
10235 op1->ops.Mul(exp, op1, op2);
10241 FreeExpContents(exp);
10242 op1->ops.Div(exp, op1, op2);
10248 FreeExpContents(exp);
10249 op1->ops.Mod(exp, op1, op2);
10255 if(op1->ops.BitAnd)
10257 FreeExpContents(exp);
10258 op1->ops.BitAnd(exp, op1, op2);
10265 FreeExpContents(exp);
10266 op1->ops.BitOr(exp, op1, op2);
10270 if(op1->ops.BitXor)
10272 FreeExpContents(exp);
10273 op1->ops.BitXor(exp, op1, op2);
10277 if(op1->ops.LShift)
10279 FreeExpContents(exp);
10280 op1->ops.LShift(exp, op1, op2);
10284 if(op1->ops.RShift)
10286 FreeExpContents(exp);
10287 op1->ops.RShift(exp, op1, op2);
10293 FreeExpContents(exp);
10294 op1->ops.Equ(exp, op1, op2);
10300 FreeExpContents(exp);
10301 op1->ops.Nqu(exp, op1, op2);
10307 FreeExpContents(exp);
10308 op1->ops.And(exp, op1, op2);
10314 FreeExpContents(exp);
10315 op1->ops.Or(exp, op1, op2);
10321 FreeExpContents(exp);
10322 op1->ops.Grt(exp, op1, op2);
10328 FreeExpContents(exp);
10329 op1->ops.Sma(exp, op1, op2);
10333 if(op1->ops.GrtEqu)
10335 FreeExpContents(exp);
10336 op1->ops.GrtEqu(exp, op1, op2);
10340 if(op1->ops.SmaEqu)
10342 FreeExpContents(exp);
10343 op1->ops.SmaEqu(exp, op1, op2);
10351 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10353 void ComputeExpression(struct Expression * exp)
10355 char expString[10240];
10357 expString[0] = '\0';
10362 ComputeInstantiation(exp);
10367 struct Expression * exp1, * exp2 = (((void *)0));
10368 struct Operand op1 =
10372 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10375 struct Operand op2 =
10379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10384 ComputeExpression(exp->op.exp2);
10387 ComputeExpression(exp->op.exp1);
10388 exp1 = exp->op.exp1;
10389 exp2 = exp->op.exp2;
10390 op1 = GetOperand(exp1);
10392 op1.type->refCount++;
10395 op2 = GetOperand(exp2);
10397 op2.type->refCount++;
10402 exp1 = exp->op.exp2;
10403 op1 = GetOperand(exp1);
10405 op1.type->refCount++;
10407 CallOperator(exp, exp1, exp2, &op1, &op2);
10409 FreeType(op1.type);
10411 FreeType(op2.type);
10417 struct Expression * e, * n;
10419 for(e = (*exp->list).first; e; e = n)
10424 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10426 ComputeExpression(e);
10427 FreeType(exp->expType);
10428 FreeType(exp->destType);
10430 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10431 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10442 struct Expression * memberExp = exp->member.exp;
10443 struct Identifier * memberID = exp->member.member;
10444 struct Type * type;
10446 ComputeExpression(exp->member.exp);
10447 type = exp->member.exp->expType;
10450 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)));
10451 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10452 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10453 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10455 if(type->kind == 19 && exp->member.exp->type == 26)
10456 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10460 struct Symbol * classSym;
10463 PrintType(type, string, 0x0, 0x1);
10464 classSym = FindClass(string);
10465 _class = classSym ? classSym->registered : (((void *)0));
10467 if(exp->member.member)
10469 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10471 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10473 if(!prop && !member && _class && exp->member.member)
10475 struct Symbol * classSym = FindClass(exp->member.member->string);
10477 convertTo = _class;
10478 _class = classSym ? classSym->registered : (((void *)0));
10479 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10485 struct Type * type = prop->dataType;
10487 if(_class->type == 3)
10489 if(type->kind == 8)
10491 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10493 if(_class->type == 3)
10495 if(!_class->dataType)
10496 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10497 type = _class->dataType;
10505 float (* Get)(float) = (void *)prop->Get;
10507 GetFloat(exp->member.exp, &value);
10508 exp->constant = PrintFloat(Get ? Get(value) : value);
10515 double (* Get)(double);
10517 GetDouble(exp->member.exp, &value);
10519 Get = (void *)prop->Set;
10521 Get = (void *)prop->Get;
10522 exp->constant = PrintDouble(Get ? Get(value) : value);
10532 struct Expression * value = exp->member.exp;
10533 struct Type * type;
10535 if(!prop->dataType)
10536 ProcessPropertyType(prop);
10537 type = prop->dataType;
10541 else if(_class->type == 1)
10547 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10549 if(propertyClass->type == 1 && value->type == 1)
10551 void (* Set)(void *, void *) = (void *)prop->Set;
10553 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10554 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10555 exp->instance->_class = MkSpecifierName(_class->fullName);
10556 exp->instance->loc = exp->loc;
10558 Set(exp->instance->data, value->instance->data);
10559 PopulateInstance(exp->instance);
10566 void (* Set)(void *, int) = (void *)prop->Set;
10568 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10569 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10570 exp->instance->_class = MkSpecifierName(_class->fullName);
10571 exp->instance->loc = exp->loc;
10573 GetInt(value, &intValue);
10574 Set(exp->instance->data, intValue);
10575 PopulateInstance(exp->instance);
10580 long long intValue;
10581 void (* Set)(void *, long long) = (void *)prop->Set;
10583 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10584 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10585 exp->instance->_class = MkSpecifierName(_class->fullName);
10586 exp->instance->loc = exp->loc;
10588 GetInt64(value, &intValue);
10589 Set(exp->instance->data, intValue);
10590 PopulateInstance(exp->instance);
10596 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10598 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10599 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10600 exp->instance->_class = MkSpecifierName(_class->fullName);
10601 exp->instance->loc = exp->loc;
10603 GetIntPtr(value, &intValue);
10604 Set(exp->instance->data, intValue);
10605 PopulateInstance(exp->instance);
10611 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10613 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10614 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10615 exp->instance->_class = MkSpecifierName(_class->fullName);
10616 exp->instance->loc = exp->loc;
10618 GetIntSize(value, &intValue);
10619 Set(exp->instance->data, intValue);
10620 PopulateInstance(exp->instance);
10625 double doubleValue;
10626 void (* Set)(void *, double) = (void *)prop->Set;
10628 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10629 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10630 exp->instance->_class = MkSpecifierName(_class->fullName);
10631 exp->instance->loc = exp->loc;
10633 GetDouble(value, &doubleValue);
10634 Set(exp->instance->data, doubleValue);
10635 PopulateInstance(exp->instance);
10640 else if(_class->type == 2)
10646 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10648 if(propertyClass->type == 1 && value->instance->data)
10650 unsigned int (* Set)(void *) = (void *)prop->Set;
10651 unsigned int bits = Set(value->instance->data);
10653 exp->constant = PrintHexUInt(bits);
10657 else if(_class->type == 2)
10659 unsigned int value;
10660 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10663 GetUInt(exp->member.exp, &value);
10665 exp->constant = PrintHexUInt(bits);
10674 if(_class->type == 2)
10676 unsigned int value;
10678 GetUInt(exp->member.exp, &value);
10683 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10685 if(_class->type == 1)
10687 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10689 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10690 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10691 exp->instance->_class = MkSpecifierName(_class->fullName);
10692 exp->instance->loc = exp->loc;
10694 Get(value, exp->instance->data);
10695 PopulateInstance(exp->instance);
10697 else if(_class->type == 2)
10699 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10700 uint64 bits = Get(value);
10702 exp->constant = PrintHexUInt64(bits);
10709 else if(_class->type == 1)
10711 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10717 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10719 if(_class->type == 1 && value)
10721 void (* Get)(void *, void *) = (void *)prop->Get;
10723 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10724 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10725 exp->instance->_class = MkSpecifierName(_class->fullName);
10726 exp->instance->loc = exp->loc;
10728 Get(value, exp->instance->data);
10729 PopulateInstance(exp->instance);
10740 exp->isConstant = 0x0;
10749 FreeExpression(memberExp);
10750 FreeIdentifier(memberID);
10756 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10758 FreeExpContents(exp);
10759 exp->constant = PrintUInt(ComputeTypeSize(type));
10766 struct Symbol * classSym = exp->_class->symbol;
10768 if(classSym && classSym->registered)
10770 if(classSym->registered->fixed)
10772 FreeSpecifier(exp->_class);
10773 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10778 char className[1024];
10780 strcpy(className, "__ecereClass_");
10781 FullClassNameCat(className, classSym->string, 0x1);
10782 MangleClassName(className);
10783 FreeExpContents(exp);
10785 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10786 exp->member.member = MkIdentifier("structSize");
10793 struct Type * type;
10794 struct Expression * e = exp;
10796 if(exp->type == 11)
10799 ComputeExpression(exp->cast.exp);
10802 if(e && exp->expType)
10804 type = exp->expType;
10805 if(type->kind == 8)
10807 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10809 if(_class && (_class->type == 3 || _class->type == 2))
10811 if(!_class->dataType)
10812 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10813 type = _class->dataType;
10823 GetChar(e, &value);
10824 FreeExpContents(exp);
10825 exp->constant = PrintChar(value);
10830 unsigned char value;
10832 GetUChar(e, &value);
10833 FreeExpContents(exp);
10834 exp->constant = PrintUChar(value);
10843 GetShort(e, &value);
10844 FreeExpContents(exp);
10845 exp->constant = PrintShort(value);
10850 unsigned short value;
10852 GetUShort(e, &value);
10853 FreeExpContents(exp);
10854 exp->constant = PrintUShort(value);
10864 FreeExpContents(exp);
10865 exp->constant = PrintInt(value);
10870 unsigned int value;
10872 GetUInt(e, &value);
10873 FreeExpContents(exp);
10874 exp->constant = PrintUInt(value);
10883 GetInt64(e, &value);
10884 FreeExpContents(exp);
10885 exp->constant = PrintInt64(value);
10892 GetUInt64(e, &value);
10893 FreeExpContents(exp);
10894 exp->constant = PrintUInt64(value);
10903 GetIntPtr(e, &value);
10904 FreeExpContents(exp);
10905 exp->constant = PrintInt64((long long)value);
10912 GetUIntPtr(e, &value);
10913 FreeExpContents(exp);
10914 exp->constant = PrintUInt64((uint64)value);
10923 GetIntSize(e, &value);
10924 FreeExpContents(exp);
10925 exp->constant = PrintInt64((long long)value);
10932 GetUIntSize(e, &value);
10933 FreeExpContents(exp);
10934 exp->constant = PrintUInt64((uint64)value);
10942 GetFloat(e, &value);
10943 FreeExpContents(exp);
10944 exp->constant = PrintFloat(value);
10952 GetDouble(e, &value);
10953 FreeExpContents(exp);
10954 exp->constant = PrintDouble(value);
10964 struct Operand op1 =
10968 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10971 struct Operand op2 =
10975 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10978 struct Operand op3 =
10982 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10987 ComputeExpression((*exp->cond.exp).last);
10988 if(exp->cond.elseExp)
10989 ComputeExpression(exp->cond.elseExp);
10991 ComputeExpression(exp->cond.cond);
10992 op1 = GetOperand(exp->cond.cond);
10994 op1.type->refCount++;
10995 op2 = GetOperand((*exp->cond.exp).last);
10997 op2.type->refCount++;
10998 op3 = GetOperand(exp->cond.elseExp);
11000 op3.type->refCount++;
11003 FreeExpContents(exp);
11004 op1.ops.Cond(exp, &op1, &op2, &op3);
11007 FreeType(op1.type);
11009 FreeType(op2.type);
11011 FreeType(op3.type);
11017 void ApplyAnyObjectLogic(struct Expression * e);
11019 extern void CopyTypeInto(struct Type * type, struct Type * src);
11021 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11023 unsigned int result = 0x1;
11027 struct __ecereNameSpace__ecere__sys__OldList converts =
11031 struct Conversion * convert;
11033 if(destType->kind == 0)
11035 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11039 for(convert = converts.first; convert; convert = convert->next)
11041 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11045 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11046 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11049 newExp->destType = (((void *)0));
11053 exp->addedThis = 0x1;
11054 exp->member.exp = newExp;
11055 FreeType(exp->member.exp->expType);
11056 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11057 exp->member.exp->expType->classObjectType = objectType;
11058 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11059 exp->member.memberType = 1;
11060 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11061 exp->needCast = 0x1;
11063 exp->expType->refCount++;
11064 ApplyAnyObjectLogic(exp->member.exp);
11070 exp->addedThis = 0x1;
11071 exp->member.exp = newExp;
11072 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11074 newExp->byReference = 0x1;
11076 FreeType(exp->member.exp->expType);
11077 exp->member.exp->expType = (((void *)0));
11078 if(convert->convert->dataType)
11080 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11081 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11082 exp->member.exp->expType->refCount = 1;
11083 exp->member.exp->expType->classObjectType = objectType;
11084 ApplyAnyObjectLogic(exp->member.exp);
11086 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11087 exp->member.memberType = 4;
11088 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11089 exp->needCast = 0x1;
11090 if(convert->resultType)
11091 convert->resultType->refCount++;
11097 FreeType(exp->expType);
11100 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11101 exp->needCast = 0x1;
11103 exp->expType->refCount++;
11107 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11108 exp->needCast = 0x1;
11109 if(convert->resultType)
11110 convert->resultType->refCount++;
11114 if(exp->isConstant && inCompiler)
11115 ComputeExpression(exp);
11116 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11118 if(!result && exp->expType && converts.count)
11120 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11122 if(!result && exp->expType && exp->destType)
11124 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))
11131 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11133 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11135 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11137 void CheckTemplateTypes(struct Expression * exp)
11139 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11141 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11142 struct Statement * compound;
11143 struct Context * context;
11147 exp->destType->refCount++;
11149 exp->expType->refCount++;
11150 newExp->prev = (((void *)0));
11151 newExp->next = (((void *)0));
11152 switch(exp->expType->kind)
11155 if(exp->destType->classObjectType)
11158 exp->destType->refCount--;
11160 exp->expType->refCount--;
11161 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11165 struct __ecereNameSpace__ecere__sys__OldList * specs;
11166 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11167 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11169 context = PushContext();
11170 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11171 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11172 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11174 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11175 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11176 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11177 exp->compound->compound.context = context;
11178 PopContext(context);
11183 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11184 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11188 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11190 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11191 struct Statement * compound;
11192 struct Context * context;
11196 exp->destType->refCount++;
11198 exp->expType->refCount++;
11199 newExp->prev = (((void *)0));
11200 newExp->next = (((void *)0));
11201 switch(exp->expType->kind)
11204 if(exp->destType->classObjectType)
11207 exp->destType->refCount--;
11209 exp->expType->refCount--;
11210 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11214 struct __ecereNameSpace__ecere__sys__OldList * specs;
11215 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11216 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11218 context = PushContext();
11219 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11220 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11221 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11223 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11224 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11225 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11226 exp->compound->compound.context = context;
11227 PopContext(context);
11232 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11235 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11236 ProcessExpressionType((*exp->list).first);
11242 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11243 newExp->needCast = 0x1;
11244 ProcessExpressionType((*exp->list).first);
11250 if(exp->expType->kind == 20)
11252 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11256 FreeType(exp->destType);
11257 FreeType(exp->expType);
11258 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11262 if(newExp->type == 8 && newExp->member.memberType == 3)
11266 exp->op.exp1 = (((void *)0));
11267 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11271 char typeString[1024];
11272 struct Declarator * decl;
11273 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11275 typeString[0] = '\0';
11276 PrintType(exp->expType, typeString, 0x0, 0x0);
11277 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11279 exp->cast.typeName = MkTypeName(specs, decl);
11280 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11281 exp->cast.exp->needCast = 0x1;
11289 extern int strncmp(const char * , const char * , size_t n);
11291 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11293 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11295 int nsLen = strlen(nameSpace);
11296 struct Symbol * symbol;
11298 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)))
11300 char * s = symbol->string;
11302 if(!strncmp(s, nameSpace, nsLen))
11307 for(c = strlen(s) - 1; c >= 0; c--)
11310 namePart = s + c + 1;
11311 if(!strcmp(namePart, name))
11319 return (((void *)0));
11322 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11325 char nameSpace[1024];
11327 unsigned int gotColon = 0x0;
11329 nameSpace[0] = '\0';
11330 for(c = strlen(name) - 1; c >= 0; c--)
11336 namePart = name + c + 1;
11337 while(c >= 0 && name[c] == ':')
11341 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11345 memcpy(nameSpace, name, c + 1);
11346 nameSpace[c + 1] = (char)0;
11347 return ScanWithNameSpace(tree, nameSpace, namePart);
11351 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11357 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11361 return ScanWithNameSpace(tree, "", namePart);
11363 return (((void *)0));
11366 static void ProcessDeclaration(struct Declaration * decl);
11368 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11370 struct Context * ctx;
11371 struct Symbol * symbol = (((void *)0));
11373 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11375 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11377 symbol = (((void *)0));
11380 char curName[1024];
11382 strcpy(curName, thisNameSpace);
11383 strcat(curName, "::");
11384 strcat(curName, name);
11385 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11388 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11391 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11392 if(symbol || ctx == endContext)
11395 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11397 if(symbol->pointerExternal->type == 0)
11399 struct FunctionDefinition * function = symbol->pointerExternal->function;
11400 struct Context * tmpContext = curContext;
11402 curContext = (((void *)0));
11403 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11404 curContext = tmpContext;
11405 symbol->pointerExternal->symbol = symbol;
11406 DeclareType(symbol->type, 0x1, 0x1);
11407 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11408 symbol->id = curExternal->symbol->idCode;
11410 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11412 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11413 symbol->id = curExternal->symbol->idCode;
11419 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11421 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11422 ListAdd(specs, MkSpecifier(UNSIGNED));
11427 if(type->_class->registered)
11429 if(!type->_class->registered->dataType)
11430 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11431 GetTypeSpecs(type->_class->registered->dataType, specs);
11436 ListAdd(specs, MkSpecifier(DOUBLE));
11439 ListAdd(specs, MkSpecifier(FLOAT));
11442 ListAdd(specs, MkSpecifier(CHAR));
11445 ListAdd(specs, MkSpecifier(SHORT));
11448 ListAdd(specs, MkSpecifier(INT64));
11451 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11454 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11458 ListAdd(specs, MkSpecifier(INT));
11463 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11465 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11472 if(type->_class && type->_class->string)
11474 if(type->classObjectType == 2)
11475 strcat(string, "typed_object");
11477 strcat(string, type->_class->string);
11480 if(type->_class->registered)
11481 strcat(string, type->_class->registered->name);
11483 strcat(string, type->_class->string);
11490 _PrintType(type->type, string, 0x0, printFunction, fullName);
11491 strcat(string, " *");
11496 strcat(string, "void");
11499 strcat(string, type->isSigned ? "int" : "uint");
11502 strcat(string, type->isSigned ? "int64" : "uint64");
11505 strcat(string, type->isSigned ? "intptr" : "uintptr");
11508 strcat(string, type->isSigned ? "intsize" : "uintsize");
11511 strcat(string, type->isSigned ? "char" : "byte");
11514 strcat(string, type->isSigned ? "short" : "uint16");
11517 strcat(string, "float");
11520 strcat(string, "double");
11525 strcat(string, "struct ");
11526 strcat(string, type->enumName);
11528 else if(type->typeName)
11530 strcat(string, type->typeName);
11534 struct Type * member;
11536 strcat(string, "struct {");
11537 for(member = type->members.first; member; member = member->next)
11539 PrintType(member, string, 0x1, fullName);
11540 strcat(string, "; ");
11542 strcat(string, "}");
11548 strcat(string, "union ");
11549 strcat(string, type->enumName);
11551 else if(type->typeName)
11553 strcat(string, type->typeName);
11557 strcat(string, "union ");
11558 strcat(string, "(unnamed)");
11564 strcat(string, "enum ");
11565 strcat(string, type->enumName);
11567 else if(type->typeName)
11569 strcat(string, type->typeName);
11572 strcat(string, "enum");
11578 if(type->dllExport)
11579 strcat(string, "dllexport ");
11580 PrintType(type->returnType, string, 0x0, fullName);
11581 strcat(string, " ");
11588 strcat(string, type->name);
11591 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11597 strcat(string, name);
11603 struct Type * param;
11605 strcat(string, "(");
11606 for(param = type->params.first; param; param = param->next)
11608 PrintType(param, string, 0x1, fullName);
11610 strcat(string, ", ");
11612 strcat(string, ")");
11619 char baseType[1024], size[256];
11620 struct Type * arrayType = type;
11622 baseType[0] = '\0';
11624 while(arrayType->kind == 12)
11627 if(arrayType->enumClass)
11628 strcat(size, arrayType->enumClass->string);
11629 else if(arrayType->arraySizeExp)
11630 PrintExpression(arrayType->arraySizeExp, size);
11632 arrayType = arrayType->arrayType;
11634 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11635 strcat(string, baseType);
11636 strcat(string, size);
11642 strcat(string, "...");
11645 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11648 strcat(string, "subclass(");
11649 strcat(string, type->_class ? type->_class->string : "int");
11650 strcat(string, ")");
11653 strcat(string, type->templateParameter->identifier->string);
11656 strcat(string, "thisclass");
11659 strcat(string, "__builtin_va_list");
11662 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11664 strcat(string, " ");
11665 strcat(string, type->name);
11670 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11672 struct Type * funcType;
11674 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11676 if(funcType && funcType->kind == 11 && type != funcType)
11678 char typeString[1024];
11679 struct Type * param;
11681 PrintType(funcType->returnType, string, 0x0, fullName);
11682 strcat(string, "(");
11683 _PrintType(type, string, printName, 0x0, fullName);
11684 strcat(string, ")");
11685 strcat(string, "(");
11686 for(param = funcType->params.first; param; param = param->next)
11688 PrintType(param, string, 0x1, fullName);
11690 strcat(string, ", ");
11692 strcat(string, ")");
11695 _PrintType(type, string, printName, 0x1, fullName);
11696 if(type->bitFieldCount)
11700 sprintf(count, ":%d", type->bitFieldCount);
11701 strcat(string, count);
11705 static struct Type * FindMember(struct Type * type, char * string)
11707 struct Type * memberType;
11709 for(memberType = type->members.first; memberType; memberType = memberType->next)
11711 if(!memberType->name)
11713 struct Type * subType = FindMember(memberType, string);
11718 else if(!strcmp(memberType->name, string))
11721 return (((void *)0));
11724 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11726 struct Type * memberType;
11728 for(memberType = type->members.first; memberType; memberType = memberType->next)
11730 if(!memberType->name)
11732 struct Type * subType = FindMember(memberType, string);
11736 *offset += memberType->offset;
11740 else if(!strcmp(memberType->name, string))
11742 *offset += memberType->offset;
11746 return (((void *)0));
11749 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11751 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11753 struct Expression * ParseExpressionString(char * expression)
11755 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11756 ((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));
11757 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11759 parsedExpression = (((void *)0));
11761 expression_yyparse();
11762 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11763 return parsedExpression;
11766 extern char * QMkString(char * source);
11768 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11770 void * __ecereTemp1;
11771 struct Identifier * id = exp->identifier;
11772 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11773 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11774 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11775 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11777 if(_class && _class->type == 4)
11779 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11780 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11784 struct __ecereNameSpace__ecere__com__Class * baseClass;
11786 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11788 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11790 for(value = e->values.first; value; value = value->next)
11792 if(!strcmp(value->name, id->string))
11797 char constant[256];
11799 FreeExpContents(exp);
11801 exp->isConstant = 0x1;
11802 if(!strcmp(baseClass->dataTypeString, "int"))
11803 sprintf(constant, "%d", value->data);
11805 sprintf(constant, "0x%X", value->data);
11806 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11807 exp->expType = MkClassType(baseClass->fullName);
11815 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11817 ProcessMethodType(method);
11818 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));
11821 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11823 if(!prop->dataType)
11824 ProcessPropertyType(prop);
11825 exp->expType = prop->dataType;
11827 prop->dataType->refCount++;
11830 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11832 if(!member->dataType)
11833 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11834 exp->expType = member->dataType;
11835 if(member->dataType)
11836 member->dataType->refCount++;
11839 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11841 if(!classProp->dataType)
11842 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11843 if(classProp->constant)
11845 FreeExpContents(exp);
11846 exp->isConstant = 0x1;
11847 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11850 exp->constant = QMkString((char *)classProp->Get(_class));
11854 char constant[256];
11857 sprintf(constant, "%d", (int)classProp->Get(_class));
11858 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11864 exp->expType = classProp->dataType;
11865 if(classProp->dataType)
11866 classProp->dataType->refCount++;
11872 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11874 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11875 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11876 struct __ecereNameSpace__ecere__com__NameSpace * child;
11880 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)))
11882 data = ScanGlobalData(child, name);
11890 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11892 extern char * strncpy(char * , const char * , size_t n);
11894 static struct GlobalData * FindGlobalData(char * name)
11897 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11899 nameSpace = globalData;
11900 for(c = 0; name[c]; c++)
11902 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11904 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11905 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11907 strncpy(spaceName, name + start, c - start);
11908 spaceName[c - start] = '\0';
11909 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11910 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11912 return (((void *)0));
11913 nameSpace = newSpace;
11921 return ScanGlobalData(nameSpace, name + start);
11923 return (((void *)0));
11926 static int definedExpStackPos;
11928 static void * definedExpStack[512];
11930 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11932 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11934 FreeExpContents(checkedExp);
11935 FreeType(checkedExp->expType);
11936 FreeType(checkedExp->destType);
11937 *checkedExp = *newExp;
11938 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11939 checkedExp->prev = prev;
11940 checkedExp->next = next;
11943 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11945 extern int printf(char * , ...);
11947 void __ecereMethod_Expression_Clear();
11949 void ApplyAnyObjectLogic(struct Expression * e)
11951 struct Type * destType = e->destType;
11953 if(destType && (destType->classObjectType == 3))
11955 if(e && e->expType)
11957 struct Type * type = e->expType;
11958 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11960 if(type->kind == 8 && type->_class && type->_class->registered)
11962 _class = type->_class->registered;
11964 else if(type->kind == 19)
11966 _class = FindClass("ecere::com::Class")->registered;
11970 char string[1024] = "";
11971 struct Symbol * classSym;
11973 PrintType(type, string, 0x0, 0x1);
11974 classSym = FindClass(string);
11976 _class = classSym->registered;
11978 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)))
11980 if(!_class || strcmp(_class->fullName, "char *"))
11982 struct Expression * checkedExp = e, * newExp;
11984 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11986 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11988 if(checkedExp->type == 25)
11990 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
11993 checkedExp = (*checkedExp->list).last;
11995 else if(checkedExp->type == 11)
11996 checkedExp = checkedExp->cast.exp;
11998 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12000 newExp = checkedExp->op.exp2;
12001 checkedExp->op.exp2 = (((void *)0));
12002 FreeExpContents(checkedExp);
12003 if(e->expType && e->expType->passAsTemplate)
12007 ComputeTypeSize(e->expType);
12008 sprintf(size, "%d", e->expType->size);
12009 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))))));
12011 ReplaceExpContents(checkedExp, newExp);
12012 e->byReference = 0x1;
12014 else if(!e->byReference || (_class && _class->type == 5))
12016 struct Expression * checkedExp, * newExp;
12019 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;
12021 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12023 struct Context * context = PushContext();
12024 struct Declarator * decl;
12025 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12026 char typeString[1024];
12027 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12029 typeString[0] = '\0';
12031 newExp->prev = (((void *)0));
12032 newExp->next = (((void *)0));
12033 newExp->expType = (((void *)0));
12034 PrintType(e->expType, typeString, 0x0, 0x1);
12035 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12036 newExp->destType = ProcessType(specs, decl);
12037 curContext = context;
12042 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12044 sprintf(name, "__internalValue%03X", internalValueCounter++);
12045 if(!curCompound->compound.declarations)
12046 curCompound->compound.declarations = MkList();
12047 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12048 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12049 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12050 e->compound = MkCompoundStmt((((void *)0)), stmts);
12053 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12055 struct Type * type = e->destType;
12057 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12058 CopyTypeInto(e->destType, type);
12059 e->destType->refCount = 1;
12060 e->destType->classObjectType = 0;
12063 e->compound->compound.context = context;
12064 PopContext(context);
12065 curContext = context->parent;
12069 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12071 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12073 if(checkedExp->type == 25)
12075 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12078 checkedExp = (*checkedExp->list).last;
12080 else if(checkedExp->type == 11)
12081 checkedExp = checkedExp->cast.exp;
12084 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12086 *operand = *checkedExp;
12087 checkedExp->destType = (((void *)0));
12088 checkedExp->expType = (((void *)0));
12089 __ecereMethod_Expression_Clear(checkedExp);
12090 checkedExp->type = 4;
12091 checkedExp->op.op = '&';
12092 checkedExp->op.exp1 = (((void *)0));
12093 checkedExp->op.exp2 = operand;
12102 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))))
12104 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
12110 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12113 thisExp->prev = (((void *)0));
12114 thisExp->next = (((void *)0));
12115 __ecereMethod_Expression_Clear(e);
12117 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
12118 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12119 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12121 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12122 CopyTypeInto(e->expType, thisExp->expType);
12123 e->expType->byReference = 0x0;
12124 e->expType->refCount = 1;
12125 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))
12127 e->expType->classObjectType = 0;
12132 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12134 if(destType->kind == 14)
12136 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12138 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12140 unsigned int byReference = e->expType->byReference;
12141 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12142 struct Declarator * decl;
12143 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12144 char typeString[1024];
12145 struct Type * type;
12146 int backupClassObjectType;
12148 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12152 backupClassObjectType = type->classObjectType;
12153 type->classObjectType = 0;
12154 typeString[0] = '\0';
12155 PrintType(type, typeString, 0x0, 0x1);
12156 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12157 type->classObjectType = backupClassObjectType;
12159 thisExp->prev = (((void *)0));
12160 thisExp->next = (((void *)0));
12161 __ecereMethod_Expression_Clear(e);
12162 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)))
12166 e->op.exp1 = (((void *)0));
12167 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12172 e->cast.typeName = MkTypeName(specs, decl);
12173 e->cast.exp = thisExp;
12174 e->byReference = 0x1;
12177 e->destType = destType;
12179 destType->refCount++;
12184 extern char * strstr(const char * , const char * );
12186 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12188 struct __ecereNameSpace__ecere__com__DefinedExpression
12190 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12191 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12194 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12195 } __attribute__ ((gcc_struct));
12197 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12199 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12201 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12203 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12205 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12207 extern struct Expression * CopyExpression(struct Expression * exp);
12209 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12211 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12213 static void ProcessStatement(struct Statement * stmt);
12215 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12217 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12219 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12221 extern char * sourceFile;
12223 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12225 void ProcessExpressionType(struct Expression * exp)
12227 void * __ecereTemp2;
12228 void * __ecereTemp1;
12229 unsigned int unresolved = 0x0;
12230 struct Location oldyylloc = yylloc;
12231 unsigned int notByReference = 0x0;
12233 if(!exp || exp->expType)
12240 struct Identifier * id = exp->identifier;
12244 if(id->_class && id->_class->name)
12246 id->classSym = id->_class->symbol;
12248 if(strstr(id->string, "__ecereClass") == id->string)
12250 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12253 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12255 ReplaceClassMembers(exp, thisClass);
12258 ProcessExpressionType(exp);
12261 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12266 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12270 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12276 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12279 ProcessExpressionType(exp);
12283 else if(currentClass && !id->_class)
12285 if(ResolveIdWithClass(exp, currentClass, 0x1))
12288 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12293 struct Type * type = symbol->type;
12294 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12296 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12298 struct Context * context = SetupTemplatesContext(_class);
12300 type = ReplaceThisClassType(_class);
12301 FinishTemplatesContext(context);
12303 type->refCount = 0;
12305 FreeSpecifier(id->_class);
12306 id->_class = (((void *)0));
12307 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12308 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12309 id->classSym = (((void *)0));
12310 exp->expType = type;
12313 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12314 exp->isConstant = 0x1;
12315 if(symbol->isParam || !strcmp(id->string, "this"))
12317 if(_class && _class->type == 1)
12318 exp->byReference = 0x1;
12320 if(symbol->isIterator)
12322 if(symbol->isIterator == 3)
12325 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12326 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12327 exp->expType = (((void *)0));
12328 ProcessExpressionType(exp);
12330 else if(symbol->isIterator != 4)
12333 exp->member.exp = MkExpIdentifier(exp->identifier);
12334 exp->member.exp->expType = exp->expType;
12335 exp->member.member = MkIdentifier("data");
12336 exp->expType = (((void *)0));
12337 ProcessExpressionType(exp);
12344 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12346 if(thisNameSpace && !(id->_class && !id->_class->name))
12350 strcpy(name, thisNameSpace);
12351 strcat(name, "::");
12352 strcat(name, id->string);
12353 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12356 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12361 for(c = 0; c < definedExpStackPos; c++)
12362 if(definedExpStack[c] == definedExp)
12364 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12366 struct Location backupYylloc = yylloc;
12368 definedExpStack[definedExpStackPos++] = definedExp;
12369 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12370 ((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));
12371 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12373 parsedExpression = (((void *)0));
12375 expression_yyparse();
12376 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12377 yylloc = backupYylloc;
12378 if(parsedExpression)
12380 FreeIdentifier(id);
12382 exp->list = MkListOne(parsedExpression);
12383 parsedExpression->loc = yylloc;
12384 ProcessExpressionType(exp);
12385 definedExpStackPos--;
12388 definedExpStackPos--;
12394 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12400 struct GlobalData * data = (((void *)0));
12402 if(thisNameSpace && !(id->_class && !id->_class->name))
12406 strcpy(name, thisNameSpace);
12407 strcat(name, "::");
12408 strcat(name, id->string);
12409 data = FindGlobalData(name);
12412 data = FindGlobalData(id->string);
12415 DeclareGlobalData(data);
12416 exp->expType = data->dataType;
12418 data->dataType->refCount++;
12419 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12420 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12421 FreeSpecifier(id->_class);
12422 id->_class = (((void *)0));
12427 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12429 if(thisNameSpace && !(id->_class && !id->_class->name))
12433 strcpy(name, thisNameSpace);
12434 strcat(name, "::");
12435 strcat(name, id->string);
12436 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12439 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12444 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12445 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12447 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12448 strcpy(name, "__ecereFunction_");
12449 FullClassNameCat(name, id->string, 0x0);
12450 if(DeclareFunction(function, name))
12452 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12453 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12455 exp->expType = function->dataType;
12456 if(function->dataType)
12457 function->dataType->refCount++;
12458 FreeSpecifier(id->_class);
12459 id->_class = (((void *)0));
12471 struct __ecereNameSpace__ecere__com__Class * _class;
12473 if(!exp->instance->_class)
12475 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12477 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12480 ProcessInstantiationType(exp->instance);
12481 exp->isConstant = exp->instance->isConstant;
12482 if(exp->instance->_class)
12484 exp->expType = MkClassType(exp->instance->_class->name);
12492 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12494 exp->expType = type;
12495 if(exp->constant[0] == '\'')
12497 if((int)((unsigned char *)exp->constant)[1] > 127)
12500 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12503 ch = exp->constant[1];
12504 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12505 exp->constant = PrintUInt(ch);
12507 type->_class = FindClass("unichar");
12508 type->isSigned = 0x0;
12513 type->isSigned = 0x1;
12516 else if(strchr(exp->constant, '.'))
12518 char ch = exp->constant[strlen(exp->constant) - 1];
12524 type->isSigned = 0x1;
12528 if(exp->constant[0] == '0' && exp->constant[1])
12529 type->isSigned = 0x0;
12530 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12531 type->isSigned = 0x0;
12532 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12533 type->isSigned = 0x0;
12535 type->isSigned = 0x1;
12538 exp->isConstant = 0x1;
12544 exp->isConstant = 0x1;
12545 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));
12550 ProcessExpressionType(exp->_new.size);
12551 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));
12552 DeclareType(exp->expType->type, 0x0, 0x0);
12556 ProcessExpressionType(exp->_renew.size);
12557 ProcessExpressionType(exp->_renew.exp);
12558 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));
12559 DeclareType(exp->expType->type, 0x0, 0x0);
12563 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12564 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12565 unsigned int useDestType = 0x0, useSideType = 0x0;
12566 struct Location oldyylloc = yylloc;
12567 unsigned int useSideUnit = 0x0;
12568 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12610 if(exp->op.op != '*' || exp->op.exp1)
12617 if(exp->op.op == '&')
12619 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12621 struct Identifier * id = exp->op.exp2->identifier;
12622 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12624 if(symbol && symbol->isIterator == 2)
12627 exp->member.exp = exp->op.exp2;
12628 exp->member.member = MkIdentifier("key");
12629 exp->expType = (((void *)0));
12630 exp->op.exp2->expType = symbol->type;
12631 symbol->type->refCount++;
12632 ProcessExpressionType(exp);
12640 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))
12642 if(exp->op.exp1->destType)
12643 FreeType(exp->op.exp1->destType);
12644 exp->op.exp1->destType = exp->destType;
12646 exp->destType->refCount++;
12650 if(exp->op.exp1->destType)
12651 FreeType(exp->op.exp1->destType);
12652 exp->op.exp1->destType = dummy;
12655 if(exp->op.exp1->destType && exp->op.op != '=')
12656 exp->op.exp1->destType->count++;
12657 ProcessExpressionType(exp->op.exp1);
12658 if(exp->op.exp1->destType && exp->op.op != '=')
12659 exp->op.exp1->destType->count--;
12660 if(exp->op.exp1->destType == dummy)
12663 exp->op.exp1->destType = (((void *)0));
12665 type1 = exp->op.exp1->expType;
12669 char expString[10240];
12671 expString[0] = '\0';
12672 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12676 exp->op.exp2->destType = exp->op.exp1->expType;
12677 if(exp->op.exp1->expType)
12678 exp->op.exp1->expType->refCount++;
12682 exp->op.exp2->destType = exp->destType;
12684 exp->destType->refCount++;
12688 exp->expType = type1;
12693 PrintExpression(exp->op.exp2, expString);
12694 if(type1 && type1->kind == 13)
12696 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)
12697 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12698 else if(exp->op.op == '=')
12700 if(exp->op.exp2->destType)
12701 FreeType(exp->op.exp2->destType);
12702 exp->op.exp2->destType = type1;
12709 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)
12713 if(exp->op.exp2->destType)
12714 FreeType(exp->op.exp2->destType);
12715 exp->op.exp2->destType = type1;
12722 exp->expType = type1;
12724 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)))
12726 if(exp->op.exp2->destType)
12727 FreeType(exp->op.exp2->destType);
12728 exp->op.exp2->destType = exp->destType;
12730 exp->destType->refCount++;
12734 if(exp->op.exp2->destType)
12735 FreeType(exp->op.exp2->destType);
12736 exp->op.exp2->destType = dummy;
12739 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12741 FreeType(exp->op.exp2->destType);
12742 exp->op.exp2->destType = type1;
12745 if(exp->op.exp2->destType && exp->op.op != '=')
12746 exp->op.exp2->destType->count++;
12747 ProcessExpressionType(exp->op.exp2);
12748 if(exp->op.exp2->destType && exp->op.op != '=')
12749 exp->op.exp2->destType->count--;
12750 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12752 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)
12754 if(exp->op.op != '=' && type1->type->kind == 0)
12755 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12757 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)))
12759 if(exp->op.op == ADD_ASSIGN)
12760 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12762 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))
12764 if(exp->op.op == ADD_ASSIGN)
12765 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12767 else if(inCompiler)
12769 char type1String[1024];
12770 char type2String[1024];
12772 type1String[0] = '\0';
12773 type2String[0] = '\0';
12774 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12775 PrintType(type1, type2String, 0x0, 0x1);
12776 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12777 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12780 if(exp->op.exp2->destType == dummy)
12783 exp->op.exp2->destType = (((void *)0));
12785 type2 = exp->op.exp2->expType;
12788 if(exp->op.op == SIZEOF)
12790 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12791 exp->isConstant = 0x1;
12793 else if(exp->op.op == '*' && !exp->op.exp1)
12795 exp->expType = Dereference(type2);
12796 if(type2 && type2->kind == 8)
12797 notByReference = 0x1;
12799 else if(exp->op.op == '&' && !exp->op.exp1)
12800 exp->expType = Reference(type2);
12807 if(exp->op.exp1->destType)
12808 FreeType(exp->op.exp1->destType);
12809 exp->op.exp1->destType = MkClassType("bool");
12810 exp->op.exp1->destType->truth = 0x1;
12811 if(!exp->op.exp1->expType)
12812 ProcessExpressionType(exp->op.exp1);
12814 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12815 FreeType(exp->op.exp1->expType);
12816 exp->op.exp1->expType = MkClassType("bool");
12817 exp->op.exp1->expType->truth = 0x1;
12821 if(exp->op.exp2->destType)
12822 FreeType(exp->op.exp2->destType);
12823 exp->op.exp2->destType = MkClassType("bool");
12824 exp->op.exp2->destType->truth = 0x1;
12825 if(!exp->op.exp2->expType)
12826 ProcessExpressionType(exp->op.exp2);
12828 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12829 FreeType(exp->op.exp2->expType);
12830 exp->op.exp2->expType = MkClassType("bool");
12831 exp->op.exp2->expType->truth = 0x1;
12834 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")))))
12836 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12838 if(exp->op.exp2->destType)
12839 FreeType(exp->op.exp2->destType);
12840 exp->op.exp2->destType = type1;
12842 if(exp->op.exp1->destType)
12843 FreeType(exp->op.exp1->destType);
12844 exp->op.exp1->destType = type2;
12846 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)
12847 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);
12848 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12850 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12854 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12856 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12857 ProcessExpressionType(exp->op.exp1);
12858 if(type2->kind != 13)
12860 ProcessExpressionType(classExp);
12861 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"))))))));
12862 if(!exp->op.exp2->expType)
12863 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12864 ProcessExpressionType(exp->op.exp2);
12868 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)))
12870 if(type1->kind != 8 && type1->type->kind == 0)
12871 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12872 exp->expType = type1;
12876 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)))
12878 if(type2->kind != 8 && type2->type->kind == 0)
12879 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12880 exp->expType = type2;
12884 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))
12886 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12890 unsigned int success = 0x0;
12892 if(type1->kind == 13 && type2->kind == 13)
12894 if(exp->op.op == '+')
12895 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12896 else if(exp->op.op == '-')
12898 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12900 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12902 if(type1->type->kind == 20)
12904 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12908 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12910 ProcessExpressionType(classExp);
12912 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")))))));
12913 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12921 if(!success && exp->op.exp1->type == 2)
12923 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12926 FreeType(exp->expType);
12927 exp->expType = exp->op.exp1->destType;
12928 if(exp->op.exp1->destType)
12929 exp->op.exp1->destType->refCount++;
12932 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12935 FreeType(exp->expType);
12936 exp->expType = exp->op.exp2->destType;
12937 if(exp->op.exp2->destType)
12938 exp->op.exp2->destType->refCount++;
12944 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12947 FreeType(exp->expType);
12948 exp->expType = exp->op.exp2->destType;
12949 if(exp->op.exp2->destType)
12950 exp->op.exp2->destType->refCount++;
12953 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12956 FreeType(exp->expType);
12957 exp->expType = exp->op.exp1->destType;
12958 if(exp->op.exp1->destType)
12959 exp->op.exp1->destType->refCount++;
12965 char expString1[10240];
12966 char expString2[10240];
12970 expString1[0] = '\0';
12971 expString2[0] = '\0';
12976 PrintExpression(exp->op.exp1, expString1);
12977 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12978 PrintExpression(exp->op.exp2, expString2);
12979 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12980 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12981 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12983 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12987 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12989 if(exp->op.exp1->destType)
12990 FreeType(exp->op.exp1->destType);
12991 exp->op.exp1->destType = type2->_class->registered->dataType;
12992 if(type2->_class->registered->dataType)
12993 type2->_class->registered->dataType->refCount++;
12994 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12995 exp->expType = type2;
12999 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13001 if(exp->op.exp2->destType)
13002 FreeType(exp->op.exp2->destType);
13003 exp->op.exp2->destType = type1->_class->registered->dataType;
13004 if(type1->_class->registered->dataType)
13005 type1->_class->registered->dataType->refCount++;
13006 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13007 exp->expType = type1;
13013 unsigned int valid = 0x0;
13015 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13017 if(exp->op.exp2->destType)
13018 FreeType(exp->op.exp2->destType);
13019 if(!type1->_class->registered->dataType)
13020 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13021 exp->op.exp2->destType = type1->_class->registered->dataType;
13022 exp->op.exp2->destType->refCount++;
13023 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13024 type2 = exp->op.exp2->destType;
13025 exp->expType = type2;
13028 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13030 if(exp->op.exp1->destType)
13031 FreeType(exp->op.exp1->destType);
13032 if(!type2->_class->registered->dataType)
13033 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13034 exp->op.exp1->destType = type2->_class->registered->dataType;
13035 exp->op.exp1->destType->refCount++;
13036 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13037 type1 = exp->op.exp1->destType;
13038 exp->expType = type1;
13041 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13043 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13045 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13048 FreeType(exp->expType);
13049 exp->expType = exp->op.exp1->expType;
13050 if(exp->op.exp2->expType)
13051 exp->op.exp1->expType->refCount++;
13055 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13057 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13060 FreeType(exp->expType);
13061 exp->expType = exp->op.exp2->expType;
13062 if(exp->op.exp2->expType)
13063 exp->op.exp2->expType->refCount++;
13070 if(exp->op.exp2->destType)
13071 FreeType(exp->op.exp2->destType);
13072 exp->op.exp2->destType = type1;
13074 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13077 FreeType(exp->expType);
13078 exp->expType = exp->op.exp2->destType;
13079 if(exp->op.exp2->destType)
13080 exp->op.exp2->destType->refCount++;
13082 else if(type1 && type2)
13084 char expString1[10240];
13085 char expString2[10240];
13086 char type1String[1024];
13087 char type2String[1024];
13089 expString1[0] = '\0';
13090 expString2[0] = '\0';
13091 type1String[0] = '\0';
13092 type2String[0] = '\0';
13095 PrintExpression(exp->op.exp1, expString1);
13096 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13097 PrintExpression(exp->op.exp2, expString2);
13098 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13099 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13100 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13102 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13103 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13105 exp->expType = exp->op.exp1->expType;
13106 if(exp->op.exp1->expType)
13107 exp->op.exp1->expType->refCount++;
13109 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13111 exp->expType = exp->op.exp2->expType;
13112 if(exp->op.exp2->expType)
13113 exp->op.exp2->expType->refCount++;
13120 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13122 struct Type * oldType = exp->op.exp1->expType;
13124 exp->op.exp1->expType = (((void *)0));
13125 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13128 exp->op.exp1->expType = oldType;
13130 if(exp->op.exp1->destType)
13131 FreeType(exp->op.exp1->destType);
13132 exp->op.exp1->destType = type2;
13134 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13137 FreeType(exp->expType);
13138 exp->expType = exp->op.exp1->destType;
13139 if(exp->op.exp1->destType)
13140 exp->op.exp1->destType->refCount++;
13144 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13146 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13148 if(exp->op.exp1->destType)
13149 FreeType(exp->op.exp1->destType);
13150 exp->op.exp1->destType = type2->_class->registered->dataType;
13151 if(type2->_class->registered->dataType)
13152 type2->_class->registered->dataType->refCount++;
13153 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13155 if(exp->op.op == '!')
13157 exp->expType = MkClassType("bool");
13158 exp->expType->truth = 0x1;
13162 exp->expType = type2;
13167 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13169 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13171 if(exp->op.exp2->destType)
13172 FreeType(exp->op.exp2->destType);
13173 exp->op.exp2->destType = type1->_class->registered->dataType;
13174 if(type1->_class->registered->dataType)
13175 type1->_class->registered->dataType->refCount++;
13176 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13178 exp->expType = type1;
13184 if(exp->op.exp1 && !exp->op.exp1->expType)
13186 char expString[10000];
13188 expString[0] = '\0';
13191 PrintExpression(exp->op.exp1, expString);
13192 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13195 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13197 if(exp->op.exp2 && !exp->op.exp2->expType)
13199 char expString[10240];
13201 expString[0] = '\0';
13204 PrintExpression(exp->op.exp2, expString);
13205 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13208 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13212 FreeType(exp->expType);
13213 exp->expType = MkClassType("bool");
13214 exp->expType->truth = 0x1;
13216 if(exp->op.op != SIZEOF)
13217 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13218 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13220 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13222 yylloc = oldyylloc;
13229 struct Expression * e;
13231 exp->isConstant = 0x1;
13232 for(e = (*exp->list).first; e; e = e->next)
13234 unsigned int inced = 0x0;
13238 FreeType(e->destType);
13239 e->destType = exp->destType;
13242 exp->destType->refCount++;
13243 e->destType->count++;
13247 ProcessExpressionType(e);
13249 exp->destType->count--;
13250 if(!exp->expType && !e->next)
13252 exp->expType = e->expType;
13254 e->expType->refCount++;
13257 exp->isConstant = 0x0;
13259 e = (*exp->list).first;
13260 if(!e->next && e->type == 8)
13262 struct Expression * next = exp->next, * prev = exp->prev;
13264 FreeType(exp->expType);
13265 FreeType(exp->destType);
13266 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13270 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13271 ProcessExpressionType(exp);
13277 struct Expression * e;
13279 exp->isConstant = 0x1;
13280 ProcessExpressionType(exp->index.exp);
13281 if(!exp->index.exp->isConstant)
13282 exp->isConstant = 0x0;
13283 if(exp->index.exp->expType)
13285 struct Type * source = exp->index.exp->expType;
13287 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)
13289 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13291 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13292 if(exp->index.index && (*exp->index.index).last)
13294 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13298 for(e = (*exp->index.index).first; e; e = e->next)
13300 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13303 FreeType(e->destType);
13304 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13306 ProcessExpressionType(e);
13311 exp->isConstant = 0x0;
13314 exp->expType = Dereference(exp->index.exp->expType);
13316 DeclareType(exp->expType, 0x0, 0x0);
13321 struct Expression * e;
13322 struct Type * functionType;
13323 struct Type * methodType = (((void *)0));
13329 PrintExpression(exp->call.exp, name);
13330 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13332 PrintExpression(exp->call.exp, name);
13335 if(exp->call.exp->type == 0)
13337 struct Expression * idExp = exp->call.exp;
13338 struct Identifier * id = idExp->identifier;
13340 if(!strcmp(id->string, "__builtin_frame_address"))
13342 exp->expType = ProcessTypeString("void *", 0x1);
13343 if(exp->call.arguments && (*exp->call.arguments).first)
13344 ProcessExpressionType((*exp->call.arguments).first);
13347 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13349 exp->expType = ProcessTypeString("int", 0x1);
13350 if(exp->call.arguments && (*exp->call.arguments).first)
13351 ProcessExpressionType((*exp->call.arguments).first);
13354 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13356 struct Expression * a = (((void *)0));
13357 struct Expression * b = (((void *)0));
13358 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13360 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13362 a = (*exp->call.arguments).first;
13363 b = (*exp->call.arguments).last;
13367 else if((*exp->call.arguments).count == 1)
13369 a = (*exp->call.arguments).first;
13374 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13375 idExp->identifier = (((void *)0));
13376 FreeExpContents(exp);
13377 ProcessExpressionType(a);
13379 ProcessExpressionType(b);
13381 exp->list = MkList();
13382 if(a->expType && (!b || b->expType))
13384 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13388 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13389 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13390 struct Declaration * decl;
13391 char temp1[1024], temp2[1024];
13393 GetTypeSpecs(a->expType, specs);
13394 if(a && !a->isConstant && a->type != 0)
13396 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13397 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13398 tempExp1 = QMkExpId(temp1);
13399 tempExp1->expType = a->expType;
13401 a->expType->refCount++;
13402 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13404 if(b && !b->isConstant && b->type != 0)
13406 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13407 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13408 tempExp2 = QMkExpId(temp2);
13409 tempExp2->expType = b->expType;
13411 b->expType->refCount++;
13412 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13414 decl = MkDeclaration(specs, decls);
13415 if(!curCompound->compound.declarations)
13416 curCompound->compound.declarations = MkList();
13417 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13421 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13423 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13425 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13426 exp->expType = a->expType;
13428 a->expType->refCount++;
13430 else if(!strcmp(id->string, "Abs"))
13432 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13433 exp->expType = a->expType;
13435 a->expType->refCount++;
13437 else if(!strcmp(id->string, "Sgn"))
13439 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"))))));
13440 exp->expType = ProcessTypeString("int", 0x0);
13442 FreeExpression(tempExp1);
13444 FreeExpression(tempExp2);
13445 FreeIdentifier(id);
13451 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13453 if(!exp->call.exp->destType)
13455 exp->call.exp->destType = dummy;
13458 ProcessExpressionType(exp->call.exp);
13459 if(exp->call.exp->destType == dummy)
13462 exp->call.exp->destType = (((void *)0));
13466 functionType = exp->call.exp->expType;
13467 if(functionType && functionType->kind == 16)
13469 methodType = functionType;
13470 functionType = methodType->method->dataType;
13471 if(exp->call.exp->expType->usedClass)
13473 char typeString[1024];
13475 typeString[0] = '\0';
13476 PrintType(functionType, typeString, 0x1, 0x1);
13477 if(strstr(typeString, "thisclass"))
13479 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13480 struct Declarator * decl;
13483 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13485 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13486 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13487 thisClassParams = 0x0;
13488 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13490 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13492 thisClass = exp->call.exp->expType->usedClass;
13493 ProcessDeclarator(decl);
13494 thisClass = backupThisClass;
13496 thisClassParams = 0x1;
13497 functionType = ProcessType(specs, decl);
13498 functionType->refCount = 0;
13499 FinishTemplatesContext(context);
13501 FreeList(specs, FreeSpecifier);
13502 FreeDeclarator(decl);
13506 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13508 struct Type * type = functionType->type;
13510 if(!functionType->refCount)
13512 functionType->type = (((void *)0));
13513 FreeType(functionType);
13515 functionType = type;
13517 if(functionType && functionType->kind != 11)
13519 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13521 else if(functionType)
13523 unsigned int emptyParams = 0x0, noParams = 0x0;
13524 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13525 struct Type * type = functionType->params.first;
13526 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13528 struct Location oldyylloc = yylloc;
13532 if(functionType->extraParam && e && functionType->thisClass)
13534 e->destType = MkClassType(functionType->thisClass->string);
13537 if(!functionType->staticMethod)
13539 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13541 type = MkClassType(memberExp->member.exp->expType->_class->string);
13544 e->destType = type;
13546 type = functionType->params.first;
13549 type->refCount = 0;
13551 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13553 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13556 e->destType = type;
13558 type = functionType->params.first;
13561 type->refCount = 0;
13564 if(type && type->kind == 0)
13567 if(!type->refCount)
13569 type = (((void *)0));
13571 for(; e; e = e->next)
13573 if(!type && !emptyParams)
13576 if(methodType && methodType->methodClass)
13577 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);
13579 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);
13582 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13584 struct Type * templatedType = (((void *)0));
13585 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13586 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13589 if(_class && _class->templateArgs)
13591 struct __ecereNameSpace__ecere__com__Class * sClass;
13593 for(sClass = _class; sClass; sClass = sClass->base)
13595 if(sClass->templateClass)
13596 sClass = sClass->templateClass;
13598 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13600 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13602 struct __ecereNameSpace__ecere__com__Class * nextClass;
13604 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13606 if(nextClass->templateClass)
13607 nextClass = nextClass->templateClass;
13608 id += nextClass->templateParams.count;
13618 if(curParam && _class->templateArgs[id].dataTypeString)
13620 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13623 struct Context * context = SetupTemplatesContext(_class);
13625 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13626 FinishTemplatesContext(context);
13628 e->destType = templatedType;
13631 templatedType->passAsTemplate = 0x1;
13636 e->destType = type;
13643 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13645 e->destType = type->prev;
13646 e->destType->refCount++;
13650 e->destType = type;
13655 if(type && type->kind != 14)
13657 struct Type * next = type->next;
13659 if(!type->refCount)
13664 if(type && type->kind != 14)
13666 if(methodType && methodType->methodClass)
13667 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);
13669 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);
13671 yylloc = oldyylloc;
13672 if(type && !type->refCount)
13677 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13678 if(exp->call.exp->type == 0)
13680 char * string = exp->call.exp->identifier->string;
13684 struct Symbol * symbol;
13685 struct Location oldyylloc = yylloc;
13687 yylloc = exp->call.exp->identifier->loc;
13688 if(strstr(string, "__builtin_") == string)
13691 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13692 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));
13693 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13694 if(strstr(symbol->string, "::"))
13695 globalContext->hasNameSpace = 0x1;
13696 yylloc = oldyylloc;
13699 else if(exp->call.exp->type == 8)
13703 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13704 if(!functionType->returnType)
13706 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13709 if(functionType && functionType->kind == 11)
13711 exp->expType = functionType->returnType;
13712 if(functionType->returnType)
13713 functionType->returnType->refCount++;
13714 if(!functionType->refCount)
13715 FreeType(functionType);
13717 if(exp->call.arguments)
13719 for(e = (*exp->call.arguments).first; e; e = e->next)
13721 struct Type * destType = e->destType;
13723 ProcessExpressionType(e);
13730 struct Type * type;
13731 struct Location oldyylloc = yylloc;
13732 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13734 exp->thisPtr = thisPtr;
13735 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13737 exp->member.member->classSym = exp->member.member->_class->symbol;
13739 ProcessExpressionType(exp->member.exp);
13740 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)
13742 exp->isConstant = 0x0;
13745 exp->isConstant = exp->member.exp->isConstant;
13746 type = exp->member.exp->expType;
13748 if(type && (type->kind == 20))
13750 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13751 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13755 for(param = _class->templateParams.first; param; param = param->next)
13757 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13761 if(param && param->defaultArg.member)
13763 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13767 struct Expression * expMember = exp->member.exp;
13768 struct Declarator * decl;
13769 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13770 char thisClassTypeString[1024];
13772 FreeIdentifier(exp->member.member);
13773 ProcessExpressionType(argExp);
13775 char * colon = strstr(param->defaultArg.memberString, "::");
13779 char className[1024];
13780 struct __ecereNameSpace__ecere__com__Class * sClass;
13782 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13783 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13786 strcpy(thisClassTypeString, _class->fullName);
13788 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13789 exp->expType = ProcessType(specs, decl);
13790 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13792 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13793 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13795 int paramCount = 0;
13796 int lastParam = -1;
13797 char templateString[1024];
13798 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13800 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13801 for(cClass = expClass; cClass; cClass = cClass->base)
13805 for(param = cClass->templateParams.first; param; param = param->next)
13808 struct __ecereNameSpace__ecere__com__Class * sClass;
13809 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13811 for(sClass = cClass->base; sClass; sClass = sClass->base)
13812 id += sClass->templateParams.count;
13813 arg = expClass->templateArgs[id];
13814 for(sClass = _class; sClass; sClass = sClass->base)
13816 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13818 struct __ecereNameSpace__ecere__com__Class * nextClass;
13820 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13821 p += nextClass->templateParams.count;
13822 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13824 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13826 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13828 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13829 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13836 char argument[256];
13838 argument[0] = '\0';
13839 switch(param->type)
13843 char expString[1024];
13844 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13845 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13846 struct Expression * exp;
13847 char * string = PrintHexUInt64(arg.expression.ui64);
13849 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13850 ProcessExpressionType(exp);
13851 ComputeExpression(exp);
13852 expString[0] = '\0';
13853 PrintExpression(exp, expString);
13854 strcat(argument, expString);
13855 FreeExpression(exp);
13860 strcat(argument, arg.member->name);
13865 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13867 if(!strcmp(arg.dataTypeString, "thisclass"))
13868 strcat(argument, thisClassTypeString);
13870 strcat(argument, arg.dataTypeString);
13878 strcat(templateString, ", ");
13879 if(lastParam != p - 1)
13881 strcat(templateString, param->name);
13882 strcat(templateString, " = ");
13884 strcat(templateString, argument);
13893 int len = strlen(templateString);
13895 if(templateString[len - 1] == '>')
13896 templateString[len++] = ' ';
13897 templateString[len++] = '>';
13898 templateString[len++] = '\0';
13901 struct Context * context = SetupTemplatesContext(_class);
13903 FreeType(exp->expType);
13904 exp->expType = ProcessTypeString(templateString, 0x0);
13905 FinishTemplatesContext(context);
13909 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")))))))));
13912 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13914 type = ProcessTemplateParameterType(type->templateParameter);
13917 if(type && (type->kind == 20))
13919 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13921 struct Identifier * id = exp->member.member;
13922 int typeKind = type->kind;
13923 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));
13925 if(typeKind == 19 && exp->member.exp->type == 26)
13927 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13930 if(id && (typeKind == 3 || typeKind == 15))
13931 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13934 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13935 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13936 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13937 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13938 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13940 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13941 exp->member.memberType = 1;
13942 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13943 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13946 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13948 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13949 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13951 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13953 member = (((void *)0));
13955 if(!member && !prop)
13956 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13957 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13958 exp->member.thisPtr = 0x1;
13964 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13965 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13966 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13968 if(!prop && !member)
13970 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13973 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13974 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13975 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13980 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13981 prop = (((void *)0));
13983 member = (((void *)0));
13987 if(!prop && !member)
13988 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13989 if(!prop && !member && !method)
13993 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
13996 exp->member.memberType = 5;
13997 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14001 char structName[1024];
14002 struct Identifier * id = exp->member.member;
14003 struct Expression * classExp = exp->member.exp;
14006 FreeType(classExp->expType);
14007 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14008 strcpy(structName, "__ecereClassData_");
14009 FullClassNameCat(structName, type->_class->string, 0x0);
14011 exp->member.member = id;
14012 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"))))))));
14014 ProcessExpressionType(exp);
14020 struct Symbol * classSym = FindClass(id->string);
14024 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14027 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14033 exp->member.memberType = 1;
14034 if(!prop->dataType)
14035 ProcessPropertyType(prop);
14036 exp->expType = prop->dataType;
14038 prop->dataType->refCount++;
14042 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14044 FreeExpContents(exp);
14046 exp->identifier = MkIdentifier("class");
14047 ProcessExpressionType(exp);
14050 exp->member.memberType = 3;
14051 DeclareStruct(_class->fullName, 0x0);
14052 if(!member->dataType)
14054 struct Context * context = SetupTemplatesContext(_class);
14056 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14057 FinishTemplatesContext(context);
14059 exp->expType = member->dataType;
14060 if(member->dataType)
14061 member->dataType->refCount++;
14063 else if(revConvert)
14065 exp->member.memberType = 4;
14066 exp->expType = MkClassType(revConvert->_class->fullName);
14072 exp->member.memberType = 2;
14074 if(!method->dataType)
14075 ProcessMethodType(method);
14076 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));
14077 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14078 exp->expType->usedClass = _class;
14080 else if(!classProp)
14082 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14084 FreeExpContents(exp);
14086 exp->identifier = MkIdentifier("class");
14087 ProcessExpressionType(exp);
14090 yylloc = exp->member.member->loc;
14091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14093 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14095 if(_class && exp->expType)
14097 struct __ecereNameSpace__ecere__com__Class * tClass;
14100 while(tClass && !tClass->templateClass)
14101 tClass = tClass->base;
14102 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14105 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14106 struct __ecereNameSpace__ecere__com__Class * sClass;
14108 for(sClass = tClass; sClass; sClass = sClass->base)
14111 if(sClass->templateClass)
14112 sClass = sClass->templateClass;
14113 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14115 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14117 for(sClass = sClass->base; sClass; sClass = sClass->base)
14118 id += sClass->templateParams.count;
14126 if(curParam && tClass->templateArgs[id].dataTypeString)
14128 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14129 struct Context * context = SetupTemplatesContext(tClass);
14131 FreeType(exp->expType);
14132 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14135 if(exp->expType->kind == 21)
14137 FreeType(exp->expType);
14138 exp->expType = ReplaceThisClassType(_class);
14140 if(tClass->templateClass)
14141 exp->expType->passAsTemplate = 0x1;
14144 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14145 if(exp->destType->kind == 21)
14147 FreeType(exp->destType);
14148 exp->destType = ReplaceThisClassType(_class);
14152 FinishTemplatesContext(context);
14155 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14158 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14159 struct __ecereNameSpace__ecere__com__Class * sClass;
14161 for(sClass = tClass; sClass; sClass = sClass->base)
14164 if(sClass->templateClass)
14165 sClass = sClass->templateClass;
14166 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14168 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14170 for(sClass = sClass->base; sClass; sClass = sClass->base)
14171 id += sClass->templateParams.count;
14181 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14182 struct Context * context = SetupTemplatesContext(tClass);
14183 struct Type * basicType;
14185 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14188 if(basicType->kind == 21)
14190 FreeType(basicType);
14191 basicType = ReplaceThisClassType(_class);
14193 FreeType(exp->expType);
14194 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));
14197 exp->destType = exp->expType;
14198 exp->destType->refCount++;
14201 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14202 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14203 struct Declarator * decl;
14205 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14208 exp->destType->refCount++;
14210 exp->expType->refCount++;
14212 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14213 exp->cast.exp = newExp;
14216 FinishTemplatesContext(context);
14219 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14221 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14225 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14228 int paramCount = 0;
14229 int lastParam = -1;
14230 char templateString[1024];
14231 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14233 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14234 while(cClass != expClass)
14236 struct __ecereNameSpace__ecere__com__Class * sClass;
14238 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14241 for(param = cClass->templateParams.first; param; param = param->next)
14243 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14246 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14247 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14249 while(cClassCur != tClass && !paramCur)
14251 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14253 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14255 cClassCur = sClassCur;
14256 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14258 if(!strcmp(paramCur->name, param->name))
14265 if(paramCur && paramCur->type == 0)
14266 arg = tClass->templateArgs[cp];
14268 arg = expClass->templateArgs[p];
14270 char argument[256];
14272 argument[0] = '\0';
14273 switch(param->type)
14277 char expString[1024];
14278 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14279 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14280 struct Expression * exp;
14281 char * string = PrintHexUInt64(arg.expression.ui64);
14283 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14284 ProcessExpressionType(exp);
14285 ComputeExpression(exp);
14286 expString[0] = '\0';
14287 PrintExpression(exp, expString);
14288 strcat(argument, expString);
14289 FreeExpression(exp);
14294 strcat(argument, arg.member->name);
14299 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14300 strcat(argument, arg.dataTypeString);
14307 strcat(templateString, ", ");
14308 if(lastParam != p - 1)
14310 strcat(templateString, param->name);
14311 strcat(templateString, " = ");
14313 strcat(templateString, argument);
14322 int len = strlen(templateString);
14324 if(templateString[len - 1] == '>')
14325 templateString[len++] = ' ';
14326 templateString[len++] = '>';
14327 templateString[len++] = '\0';
14329 FreeType(exp->expType);
14331 struct Context * context = SetupTemplatesContext(tClass);
14333 exp->expType = ProcessTypeString(templateString, 0x0);
14334 FinishTemplatesContext(context);
14341 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)");
14343 else if(type && (type->kind == 9 || type->kind == 10))
14345 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14349 exp->expType = memberType;
14351 memberType->refCount++;
14356 char expString[10240];
14358 expString[0] = '\0';
14361 PrintExpression(exp, expString);
14362 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14364 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14366 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14368 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14370 struct Identifier * id = exp->member.member;
14371 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));
14375 FreeType(exp->expType);
14376 exp->expType = ReplaceThisClassType(_class);
14380 yylloc = oldyylloc;
14385 struct Type * destType = exp->destType;
14387 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14389 exp->member.member->classSym = exp->member.member->_class->symbol;
14391 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14395 ProcessExpressionType(exp);
14402 struct Symbol * classSym = exp->_class->symbol;
14404 if(classSym && classSym->registered)
14406 if(classSym->registered->type == 5)
14411 DeclareStruct(classSym->string, 0x0);
14412 FreeSpecifier(exp->_class);
14414 FullClassNameCat(name, classSym->string, 0x0);
14415 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14419 if(classSym->registered->fixed)
14421 FreeSpecifier(exp->_class);
14422 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14427 char className[1024];
14429 strcpy(className, "__ecereClass_");
14430 FullClassNameCat(className, classSym->string, 0x1);
14431 MangleClassName(className);
14432 DeclareClass(classSym, className);
14433 FreeExpContents(exp);
14435 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14436 exp->member.member = MkIdentifier("structSize");
14440 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14445 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14447 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14448 exp->isConstant = 0x1;
14449 DeclareType(type, 0x0, 0x0);
14455 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14457 type->count = (unsigned int)1;
14458 FreeType(exp->cast.exp->destType);
14459 exp->cast.exp->destType = type;
14461 ProcessExpressionType(exp->cast.exp);
14462 type->count = (unsigned int)0;
14463 exp->expType = type;
14464 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14466 void * prev = exp->prev, * next = exp->next;
14467 struct Type * expType = exp->cast.exp->destType;
14468 struct Expression * castExp = exp->cast.exp;
14469 struct Type * destType = exp->destType;
14472 expType->refCount++;
14473 FreeType(exp->expType);
14474 FreeTypeName(exp->cast.typeName);
14476 FreeType(exp->expType);
14477 FreeType(exp->destType);
14478 exp->expType = expType;
14479 exp->destType = destType;
14480 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14486 exp->isConstant = exp->cast.exp->isConstant;
14492 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14495 exp->expType = type;
14500 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14502 ProcessExpressionType(exp->vaArg.exp);
14504 exp->expType = type;
14509 struct Expression * e;
14511 exp->isConstant = 0x1;
14512 FreeType(exp->cond.cond->destType);
14513 exp->cond.cond->destType = MkClassType("bool");
14514 exp->cond.cond->destType->truth = 0x1;
14515 ProcessExpressionType(exp->cond.cond);
14516 if(!exp->cond.cond->isConstant)
14517 exp->isConstant = 0x0;
14518 for(e = (*exp->cond.exp).first; e; e = e->next)
14522 FreeType(e->destType);
14523 e->destType = exp->destType;
14525 e->destType->refCount++;
14527 ProcessExpressionType(e);
14530 exp->expType = e->expType;
14532 e->expType->refCount++;
14535 exp->isConstant = 0x0;
14537 FreeType(exp->cond.elseExp->destType);
14538 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14539 if(exp->cond.elseExp->destType)
14540 exp->cond.elseExp->destType->refCount++;
14541 ProcessExpressionType(exp->cond.elseExp);
14542 if(!exp->cond.elseExp->isConstant)
14543 exp->isConstant = 0x0;
14548 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14550 struct Statement * last = (*exp->compound->compound.statements).last;
14552 if(last->type == 3 && last->expressions && (*last->expressions).last)
14554 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14556 exp->destType->refCount++;
14558 ProcessStatement(exp->compound);
14559 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14560 if(((struct Expression *)(*last->expressions).last)->expType)
14561 exp->expType->refCount++;
14567 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14569 if(spec && spec->type == 1)
14571 exp->expType = MkClassType(spec->name);
14572 exp->expType->kind = 19;
14573 exp->byReference = 0x1;
14577 exp->expType = MkClassType("ecere::com::Class");
14578 exp->byReference = 0x1;
14584 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14588 struct Identifier * id = exp->classData.id;
14589 char structName[1024];
14590 struct Expression * classExp;
14592 strcpy(structName, "__ecereClassData_");
14593 FullClassNameCat(structName, _class->fullName, 0x0);
14595 exp->member.member = id;
14596 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14597 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14599 classExp = MkExpIdentifier(MkIdentifier("class"));
14600 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"))))))));
14601 ProcessExpressionType(exp);
14608 struct Type * type = (((void *)0));
14609 char * typeString = (((void *)0));
14610 char typeStringBuf[1024];
14612 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))
14614 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14616 typeString = templateClass->templateArgs[2].dataTypeString;
14620 struct Expression * e;
14622 for(e = (*exp->list).first; e; e = e->next)
14624 ProcessExpressionType(e);
14634 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14638 e->expType = (((void *)0));
14639 e = (*exp->list).first;
14640 ProcessExpressionType(e);
14643 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14645 FreeType(e->expType);
14646 e->expType = (((void *)0));
14648 type = (((void *)0));
14656 FreeType(e->expType);
14657 e->expType = (((void *)0));
14663 typeStringBuf[0] = '\0';
14664 PrintType(type, typeStringBuf, 0x0, 0x1);
14665 typeString = typeStringBuf;
14667 type = (((void *)0));
14672 char templateString[1024];
14673 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14674 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14675 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14676 struct Expression * expExt;
14677 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14679 sprintf(templateString, "Container<%s>", typeString);
14682 struct Expression * e;
14684 type = ProcessTypeString(typeString, 0x0);
14685 while(e = (*exp->list).first)
14687 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14688 e->destType = type;
14690 ProcessExpressionType(e);
14691 ListAdd(initializers, MkInitializerAssignment(e));
14694 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14696 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14697 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14698 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14699 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14700 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14701 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14702 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14703 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14704 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14705 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))));
14706 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14707 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14708 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14709 exp->expType = ProcessTypeString(templateString, 0x0);
14711 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14712 ProcessExpressionType(expExt);
14716 exp->expType = ProcessTypeString("Container", 0x0);
14717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14722 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14724 FreeType(exp->expType);
14725 exp->expType = ReplaceThisClassType(thisClass);
14727 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14729 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14733 if(exp->expType->kind != 15)
14735 struct Type * member;
14736 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14738 FreeType(exp->expType);
14739 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14740 exp->expType->kind = symbol->type->kind;
14741 exp->expType->refCount++;
14742 exp->expType->enumName = enumName;
14743 exp->expType->members = symbol->type->members;
14744 for(member = symbol->type->members.first; member; member = member->next)
14745 member->refCount++;
14749 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14751 for(member = symbol->type->members.first; member; member = member->next)
14753 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14755 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14761 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14763 else if(exp->destType && !exp->destType->keepCast)
14765 if(!CheckExpressionType(exp, exp->destType, 0x0))
14767 if(!exp->destType->count || unresolved)
14772 if(exp->destType->kind != 14)
14779 char expString[10240];
14781 expString[0] = '\0';
14782 PrintType(exp->destType, type2, 0x0, 0x1);
14785 PrintExpression(exp, expString);
14786 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14789 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14790 else if(exp->type != 16)
14791 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14796 char expString[10240];
14798 expString[0] = '\0';
14801 PrintExpression(exp, expString);
14802 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14805 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14806 else if(exp->type != 16)
14807 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14819 PrintType(exp->expType, type1, 0x0, 0x1);
14820 PrintType(exp->destType, type2, 0x0, 0x1);
14822 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)))
14826 char expString[10240];
14828 expString[0] = '\0';
14831 PrintExpression(exp, expString);
14832 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14834 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14835 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14836 FreeType(exp->expType);
14837 exp->destType->refCount++;
14838 exp->expType = exp->destType;
14843 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14845 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14846 char typeString[1024];
14847 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14848 struct Declarator * decl;
14850 typeString[0] = '\0';
14853 exp->expType->refCount++;
14855 exp->expType->refCount++;
14857 newExp->destType = exp->expType;
14858 PrintType(exp->expType, typeString, 0x0, 0x0);
14859 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14860 exp->cast.typeName = MkTypeName(specs, decl);
14861 exp->cast.exp = newExp;
14864 else if(unresolved)
14866 if(exp->identifier->_class && exp->identifier->_class->name)
14867 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14868 else if(exp->identifier->string && exp->identifier->string[0])
14869 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14871 else if(!exp->expType && exp->type != 16)
14873 char expString[10240];
14875 expString[0] = '\0';
14878 PrintExpression(exp, expString);
14879 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14881 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14883 ApplyAnyObjectLogic(exp);
14884 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14886 exp->byReference = 0x1;
14888 yylloc = oldyylloc;
14891 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)
14895 *curMember = (*curMember)->next;
14896 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14898 *curMember = subMemberStack[--(*subMemberStackPos)];
14899 *curMember = (*curMember)->next;
14901 while((*curMember) && (*curMember)->isProperty)
14902 *curMember = (*curMember)->next;
14903 if(subMemberStackPos)
14905 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14907 subMemberStack[(*subMemberStackPos)++] = *curMember;
14908 *curMember = (*curMember)->members.first;
14909 while(*curMember && (*curMember)->isProperty)
14910 *curMember = (*curMember)->next;
14918 if(subMemberStackPos && *subMemberStackPos)
14920 *curMember = subMemberStack[--(*subMemberStackPos)];
14921 *curMember = (*curMember)->next;
14925 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14927 if(*curClass == _class)
14929 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14931 *curMember = (*curClass)->membersAndProperties.first;
14933 while((*curMember) && (*curMember)->isProperty)
14934 *curMember = (*curMember)->next;
14935 if(subMemberStackPos)
14937 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14939 subMemberStack[(*subMemberStackPos)++] = *curMember;
14940 *curMember = (*curMember)->members.first;
14941 while(*curMember && (*curMember)->isProperty)
14942 *curMember = (*curMember)->next;
14949 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14954 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14956 if(init->exp && !init->exp->destType)
14958 FreeType(init->exp->destType);
14959 init->exp->destType = type;
14965 ProcessExpressionType(init->exp);
14966 init->isConstant = init->exp->isConstant;
14972 struct Expression * exp = init->exp;
14973 struct Instantiation * inst = exp->instance;
14974 struct MembersInit * members;
14977 init->list = MkList();
14980 for(members = (*inst->members).first; members; members = members->next)
14982 if(members->type == 0)
14984 struct MemberInit * member;
14986 for(member = (*members->dataMembers).first; member; member = member->next)
14988 ListAdd(init->list, member->initializer);
14989 member->initializer = (((void *)0));
14994 FreeExpression(exp);
14998 struct Initializer * i;
14999 struct Type * initializerType = (((void *)0));
15000 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15001 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15002 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15003 int subMemberStackPos = 0;
15005 if(type && type->kind == 12)
15006 initializerType = Dereference(type);
15007 else if(type && (type->kind == 9 || type->kind == 10))
15008 initializerType = type->members.first;
15009 for(i = (*init->list).first; i; i = i->next)
15011 if(type && type->kind == 8 && type->_class && type->_class->registered)
15013 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15016 if(!curMember->dataType)
15017 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15018 initializerType = curMember->dataType;
15021 ProcessInitializer(i, initializerType);
15022 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15023 initializerType = initializerType->next;
15025 init->isConstant = 0x0;
15027 if(type && type->kind == 12)
15028 FreeType(initializerType);
15029 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15031 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15038 extern struct Symbol * FindType(struct Context * ctx, char * name);
15040 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15042 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15048 if(spec->specifier == THISCLASS)
15053 spec->name = ReplaceThisClass(thisClass);
15054 spec->symbol = FindClass(spec->name);
15055 ProcessSpecifier(spec, declareStruct);
15062 struct Symbol * symbol = FindType(curContext, spec->name);
15065 DeclareType(symbol->type, 0x1, 0x1);
15066 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15067 DeclareStruct(spec->name, 0x0);
15072 struct Enumerator * e;
15076 for(e = (*spec->list).first; e; e = e->next)
15079 ProcessExpressionType(e->exp);
15087 if(spec->definitions)
15089 struct ClassDef * def;
15090 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15092 ProcessClass(spec->definitions, symbol);
15099 static void ProcessDeclarator(struct Declarator * decl)
15104 if(decl->identifier->classSym)
15106 FreeSpecifier(decl->identifier->_class);
15107 decl->identifier->_class = (((void *)0));
15111 if(decl->array.exp)
15112 ProcessExpressionType(decl->array.exp);
15119 if(decl->declarator)
15120 ProcessDeclarator(decl->declarator);
15121 if(decl->type == 4)
15123 struct Identifier * id = GetDeclId(decl);
15125 if(id && id->_class)
15127 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15129 if(!decl->function.parameters)
15130 decl->function.parameters = MkList();
15131 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15132 id->_class = (((void *)0));
15134 if(decl->function.parameters)
15136 struct TypeName * param;
15138 for(param = (*decl->function.parameters).first; param; param = param->next)
15140 if(param->qualifiers && (*param->qualifiers).first)
15142 struct Specifier * spec = (*param->qualifiers).first;
15144 if(spec && spec->specifier == TYPED_OBJECT)
15146 struct Declarator * d = param->declarator;
15147 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);
15149 FreeList(param->qualifiers, FreeSpecifier);
15150 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15151 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15152 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15155 else if(spec && spec->specifier == ANY_OBJECT)
15157 struct Declarator * d = param->declarator;
15159 FreeList(param->qualifiers, FreeSpecifier);
15160 param->qualifiers = MkListOne(MkSpecifier(VOID));
15161 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15163 else if(spec->specifier == THISCLASS)
15168 spec->name = ReplaceThisClass(thisClass);
15169 spec->symbol = FindClass(spec->name);
15170 ProcessSpecifier(spec, 0x0);
15174 if(param->declarator)
15175 ProcessDeclarator(param->declarator);
15183 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15185 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15187 static void ProcessDeclaration(struct Declaration * decl)
15189 yylloc = decl->loc;
15194 unsigned int declareStruct = 0x0;
15196 if(decl->declarators)
15198 struct InitDeclarator * d;
15200 for(d = (*decl->declarators).first; d; d = d->next)
15202 struct Type * type, * subType;
15204 ProcessDeclarator(d->declarator);
15205 type = ProcessType(decl->specifiers, d->declarator);
15208 ProcessInitializer(d->initializer, type);
15209 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15211 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15213 struct Instantiation * inst = d->initializer->exp->instance;
15215 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15216 d->initializer->exp->instance = (((void *)0));
15217 if(decl->specifiers)
15218 FreeList(decl->specifiers, FreeSpecifier);
15219 FreeList(decl->declarators, FreeInitDeclarator);
15226 for(subType = type; subType; )
15228 if(subType->kind == 8)
15230 declareStruct = 0x1;
15233 else if(subType->kind == 13)
15235 else if(subType->kind == 12)
15236 subType = subType->arrayType;
15245 if(decl->specifiers)
15247 struct Specifier * s;
15249 for(s = (*decl->specifiers).first; s; s = s->next)
15251 ProcessSpecifier(s, declareStruct);
15258 ProcessInstantiationType(decl->inst);
15263 struct Specifier * spec;
15264 struct Declarator * d;
15265 unsigned int declareStruct = 0x0;
15267 if(decl->declarators)
15269 for(d = (*decl->declarators).first; d; d = d->next)
15271 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15272 struct Type * subType;
15274 ProcessDeclarator(d);
15275 for(subType = type; subType; )
15277 if(subType->kind == 8)
15279 declareStruct = 0x1;
15282 else if(subType->kind == 13)
15284 else if(subType->kind == 12)
15285 subType = subType->arrayType;
15292 if(decl->specifiers)
15294 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15295 ProcessSpecifier(spec, declareStruct);
15302 static struct FunctionDefinition * curFunction;
15304 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15306 char propName[1024], propNameM[1024];
15307 char getName[1024], setName[1024];
15308 struct __ecereNameSpace__ecere__sys__OldList * args;
15310 DeclareProperty(prop, setName, getName);
15311 strcpy(propName, "__ecereProp_");
15312 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15313 strcat(propName, "_");
15314 FullClassNameCat(propName, prop->name, 0x1);
15315 MangleClassName(propName);
15316 strcpy(propNameM, "__ecerePropM_");
15317 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15318 strcat(propNameM, "_");
15319 FullClassNameCat(propNameM, prop->name, 0x1);
15320 MangleClassName(propNameM);
15321 if(prop->isWatchable)
15324 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15325 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15326 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15328 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15329 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15330 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15334 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15335 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15336 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15338 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15339 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15340 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15342 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15343 curFunction->propSet->fireWatchersDone = 0x1;
15346 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15348 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15350 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15352 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15354 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15356 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15358 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15360 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15362 static void ProcessStatement(struct Statement * stmt)
15364 yylloc = stmt->loc;
15368 ProcessStatement(stmt->labeled.stmt);
15371 if(stmt->caseStmt.exp)
15373 FreeType(stmt->caseStmt.exp->destType);
15374 stmt->caseStmt.exp->destType = curSwitchType;
15376 curSwitchType->refCount++;
15377 ProcessExpressionType(stmt->caseStmt.exp);
15378 ComputeExpression(stmt->caseStmt.exp);
15380 if(stmt->caseStmt.stmt)
15381 ProcessStatement(stmt->caseStmt.stmt);
15385 if(stmt->compound.context)
15387 struct Declaration * decl;
15388 struct Statement * s;
15389 struct Statement * prevCompound = curCompound;
15390 struct Context * prevContext = curContext;
15392 if(!stmt->compound.isSwitch)
15394 curCompound = stmt;
15395 curContext = stmt->compound.context;
15397 if(stmt->compound.declarations)
15399 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15400 ProcessDeclaration(decl);
15402 if(stmt->compound.statements)
15404 for(s = (*stmt->compound.statements).first; s; s = s->next)
15405 ProcessStatement(s);
15407 curContext = prevContext;
15408 curCompound = prevCompound;
15414 struct Expression * exp;
15416 if(stmt->expressions)
15418 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15419 ProcessExpressionType(exp);
15425 struct Expression * exp;
15427 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15428 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15429 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15430 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15432 ProcessExpressionType(exp);
15434 if(stmt->ifStmt.stmt)
15435 ProcessStatement(stmt->ifStmt.stmt);
15436 if(stmt->ifStmt.elseStmt)
15437 ProcessStatement(stmt->ifStmt.elseStmt);
15442 struct Type * oldSwitchType = curSwitchType;
15444 if(stmt->switchStmt.exp)
15446 struct Expression * exp;
15448 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15452 ProcessExpressionType(exp);
15455 curSwitchType = exp->expType;
15458 ProcessStatement(stmt->switchStmt.stmt);
15459 curSwitchType = oldSwitchType;
15464 if(stmt->whileStmt.exp)
15466 struct Expression * exp;
15468 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15469 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15470 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15471 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15473 ProcessExpressionType(exp);
15476 if(stmt->whileStmt.stmt)
15477 ProcessStatement(stmt->whileStmt.stmt);
15482 if(stmt->doWhile.exp)
15484 struct Expression * exp;
15486 if((*stmt->doWhile.exp).last)
15488 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15489 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15490 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15492 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15494 ProcessExpressionType(exp);
15497 if(stmt->doWhile.stmt)
15498 ProcessStatement(stmt->doWhile.stmt);
15503 struct Expression * exp;
15505 if(stmt->forStmt.init)
15506 ProcessStatement(stmt->forStmt.init);
15507 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15509 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15510 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15511 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15513 if(stmt->forStmt.check)
15514 ProcessStatement(stmt->forStmt.check);
15515 if(stmt->forStmt.increment)
15517 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15518 ProcessExpressionType(exp);
15520 if(stmt->forStmt.stmt)
15521 ProcessStatement(stmt->forStmt.stmt);
15526 struct Identifier * id = stmt->forEachStmt.id;
15527 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15528 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15529 struct Statement * block = stmt->forEachStmt.stmt;
15530 char iteratorType[1024];
15531 struct Type * source;
15532 struct Expression * e;
15533 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));
15534 struct Expression * arrayExp;
15535 char * typeString = (((void *)0));
15536 int builtinCount = 0;
15538 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15542 FreeType(e->destType);
15543 e->destType = ProcessTypeString("Container", 0x0);
15545 if(!isBuiltin || e->next)
15546 ProcessExpressionType(e);
15548 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15549 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15551 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15552 struct Symbol * symbol;
15553 struct Expression * expIt = (((void *)0));
15554 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15555 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15556 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15557 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15560 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15561 stmt->compound.context->parent = curContext;
15562 curContext = stmt->compound.context;
15563 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15565 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15566 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15568 isCustomAVLTree = 0x1;
15569 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15571 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15574 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15576 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15578 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15581 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15585 struct Declarator * decl;
15586 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15588 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15589 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15590 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15594 struct Type * type = (((void *)0));
15595 char typeStringBuf[1024];
15597 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15598 if(((struct Expression *)(*exp).last)->type == 11)
15600 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15603 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15605 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)
15607 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15609 typeString = templateClass->templateArgs[2].dataTypeString;
15611 else if(arrayExp->list)
15613 struct Expression * e;
15615 for(e = (*arrayExp->list).first; e; e = e->next)
15617 ProcessExpressionType(e);
15627 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15631 e->expType = (((void *)0));
15632 e = (*arrayExp->list).first;
15633 ProcessExpressionType(e);
15636 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15638 FreeType(e->expType);
15639 e->expType = (((void *)0));
15641 type = (((void *)0));
15649 FreeType(e->expType);
15650 e->expType = (((void *)0));
15656 typeStringBuf[0] = '\0';
15657 PrintType(type, typeStringBuf, 0x0, 0x1);
15658 typeString = typeStringBuf;
15664 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15665 struct Declarator * decl;
15666 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15670 struct Expression * e;
15672 builtinCount = (*arrayExp->list).count;
15673 type = ProcessTypeString(typeString, 0x0);
15674 while(e = (*arrayExp->list).first)
15676 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15677 e->destType = type;
15679 ProcessExpressionType(e);
15680 ListAdd(initializers, MkInitializerAssignment(e));
15683 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15685 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15686 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15687 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15688 FreeList(exp, FreeExpression);
15692 arrayExp->expType = ProcessTypeString("Container", 0x0);
15693 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15696 else if(isLinkList && !isList)
15698 struct Declarator * decl;
15699 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15701 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15702 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15703 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15705 else if(_class->templateArgs)
15708 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15710 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15711 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15713 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15714 if(block && block->type == 2 && block->compound.context)
15716 block->compound.context->parent = stmt->compound.context;
15720 block = MkIfStmt(filter, block, (((void *)0)));
15724 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));
15725 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15726 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15727 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15733 sprintf(count, "%d", builtinCount);
15734 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));
15735 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15736 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15737 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15739 else if(isLinkList && !isList)
15741 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15742 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15744 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15746 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));
15750 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15751 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15753 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));
15755 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15756 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15757 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15761 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15763 ProcessExpressionType(expIt);
15764 if((*stmt->compound.declarations).first)
15765 ProcessDeclaration((*stmt->compound.declarations).first);
15767 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15768 ProcessStatement(stmt);
15769 curContext = stmt->compound.context->parent;
15774 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15786 struct Expression * exp;
15788 if(stmt->expressions)
15790 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15794 if(curFunction && !curFunction->type)
15795 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15796 FreeType(exp->destType);
15797 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15799 exp->destType->refCount++;
15801 ProcessExpressionType(exp);
15808 ProcessDeclaration(stmt->decl);
15813 struct AsmField * field;
15815 if(stmt->asmStmt.inputFields)
15817 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15818 if(field->expression)
15819 ProcessExpressionType(field->expression);
15821 if(stmt->asmStmt.outputFields)
15823 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15824 if(field->expression)
15825 ProcessExpressionType(field->expression);
15827 if(stmt->asmStmt.clobberedFields)
15829 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15831 if(field->expression)
15832 ProcessExpressionType(field->expression);
15839 struct PropertyWatch * propWatch;
15840 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15841 struct Expression * object = stmt->_watch.object;
15842 struct Expression * watcher = stmt->_watch.watcher;
15845 ProcessExpressionType(watcher);
15847 ProcessExpressionType(object);
15850 if(watcher || thisClass)
15852 struct External * external = curExternal;
15853 struct Context * context = curContext;
15856 stmt->expressions = MkList();
15857 curExternal = external->prev;
15858 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15860 struct ClassFunction * func;
15861 char watcherName[1024];
15862 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15863 struct External * createdExternal;
15864 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15866 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15867 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15868 if(propWatch->deleteWatch)
15869 strcat(watcherName, "_delete");
15872 struct Identifier * propID;
15874 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15876 strcat(watcherName, "_");
15877 strcat(watcherName, propID->string);
15880 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15882 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15883 ProcessClassFunctionBody(func, propWatch->compound);
15884 propWatch->compound = (((void *)0));
15885 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15886 createdExternal->symbol->idCode = external->symbol->idCode;
15887 curExternal = createdExternal;
15888 ProcessFunction(createdExternal->function);
15890 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15892 externalDecl->declaration = decl;
15893 if(decl->symbol && !decl->symbol->pointerExternal)
15894 decl->symbol->pointerExternal = externalDecl;
15896 if(propWatch->deleteWatch)
15898 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15900 ListAdd(args, CopyExpression(object));
15901 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15902 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15903 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15907 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15908 struct Identifier * propID;
15910 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15912 char propName[1024];
15913 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15917 char getName[1024], setName[1024];
15918 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15920 DeclareProperty(prop, setName, getName);
15921 strcpy(propName, "__ecereProp_");
15922 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15923 strcat(propName, "_");
15924 FullClassNameCat(propName, prop->name, 0x1);
15925 ListAdd(args, CopyExpression(object));
15926 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15927 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15928 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15929 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15937 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15939 curExternal = external;
15940 curContext = context;
15942 FreeExpression(watcher);
15944 FreeExpression(object);
15945 FreeList(watches, FreePropertyWatch);
15948 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15952 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15954 ProcessStatement(propWatch->compound);
15961 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15962 struct Expression * object = stmt->_watch.object;
15963 struct __ecereNameSpace__ecere__com__Class * _class;
15966 ProcessExpressionType(object);
15969 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15972 struct Identifier * propID;
15975 stmt->expressions = MkList();
15976 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15978 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15985 for(propID = (*watches).first; propID; propID = propID->next)
15987 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15991 CreateFireWatcher(prop, object, stmt);
15994 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
15999 struct __ecereNameSpace__ecere__com__Property * prop;
16000 struct __ecereNameSpace__ecere__com__Class * base;
16002 for(base = _class; base; base = base->base)
16004 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16006 if(prop->isProperty && prop->isWatchable)
16008 CreateFireWatcher(prop, object, stmt);
16014 FreeExpression(object);
16015 FreeList(watches, FreeIdentifier);
16018 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16024 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16025 struct Expression * object = stmt->_watch.object;
16026 struct Expression * watcher = stmt->_watch.watcher;
16027 struct __ecereNameSpace__ecere__com__Class * _class;
16030 ProcessExpressionType(object);
16032 ProcessExpressionType(watcher);
16035 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16036 if(watcher || thisClass)
16040 struct Identifier * propID;
16043 stmt->expressions = MkList();
16046 struct __ecereNameSpace__ecere__sys__OldList * args;
16049 ListAdd(args, CopyExpression(object));
16050 ListAdd(args, MkExpConstant("0"));
16051 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16052 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16056 for(propID = (*watches).first; propID; propID = propID->next)
16058 char propName[1024];
16059 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16063 char getName[1024], setName[1024];
16064 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16066 DeclareProperty(prop, setName, getName);
16067 strcpy(propName, "__ecereProp_");
16068 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16069 strcat(propName, "_");
16070 FullClassNameCat(propName, prop->name, 0x1);
16071 MangleClassName(propName);
16072 ListAdd(args, CopyExpression(object));
16073 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16074 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16075 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16078 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16082 FreeExpression(object);
16084 FreeExpression(watcher);
16085 FreeList(watches, FreeIdentifier);
16088 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16098 extern struct Expression * QBrackets(struct Expression * exp);
16100 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16102 extern struct Declarator * QMkPtrDecl(char * id);
16104 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16106 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16108 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16110 static void ProcessFunction(struct FunctionDefinition * function)
16112 void * __ecereTemp2;
16113 void * __ecereTemp1;
16114 struct Identifier * id = GetDeclId(function->declarator);
16115 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16116 struct Type * type = symbol ? symbol->type : (((void *)0));
16117 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16118 struct Context * oldTopContext = topContext;
16120 yylloc = function->loc;
16121 if(type && type->thisClass)
16123 struct Symbol * classSym = type->thisClass;
16124 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16125 char className[1024];
16126 char structName[1024];
16127 struct Declarator * funcDecl;
16128 struct Symbol * thisSymbol;
16129 unsigned int typedObject = 0x0;
16131 if(_class && !_class->base)
16133 _class = currentClass;
16134 if(_class && !_class->symbol)
16135 _class->symbol = FindClass(_class->fullName);
16136 classSym = _class ? _class->symbol : (((void *)0));
16139 thisClass = _class;
16140 if(inCompiler && _class)
16142 if(type->kind == 11)
16144 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16146 struct Type * param = symbol->type->params.first;
16148 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16151 if(type->classObjectType != 1)
16153 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16154 symbol->type->staticMethod = 0x1;
16155 symbol->type->thisClass = (((void *)0));
16156 symbol->type->extraParam = 0x0;
16159 strcpy(className, "__ecereClass_");
16160 FullClassNameCat(className, _class->fullName, 0x1);
16161 MangleClassName(className);
16162 structName[0] = (char)0;
16163 FullClassNameCat(structName, _class->fullName, 0x0);
16164 funcDecl = GetFuncDecl(function->declarator);
16167 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16169 struct TypeName * param = (*funcDecl->function.parameters).first;
16171 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16173 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16174 FreeTypeName(param);
16177 if(!function->propertyNoThis)
16179 struct TypeName * thisParam;
16181 if(type->classObjectType != 1)
16183 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16184 if(!funcDecl->function.parameters)
16185 funcDecl->function.parameters = MkList();
16186 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16190 if(type->classObjectType != 1)
16192 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16193 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16195 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));
16196 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16200 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16202 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16204 funcDecl = GetFuncDecl(initDecl->declarator);
16207 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16209 struct TypeName * param = (*funcDecl->function.parameters).first;
16211 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16213 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16214 FreeTypeName(param);
16217 if(type->classObjectType != 1)
16219 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16221 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16223 if(!funcDecl->function.parameters)
16224 funcDecl->function.parameters = MkList();
16225 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16233 if(type->classObjectType != 1)
16235 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));
16236 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16237 if(typedObject && thisSymbol->type)
16239 thisSymbol->type->classObjectType = 2;
16240 thisSymbol->type->byReference = type->byReference;
16244 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16246 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16249 struct __ecereNameSpace__ecere__com__Class * base;
16251 for(base = _class; base && base->type != 1000; base = base->next)
16253 for(member = base->membersAndProperties.first; member; member = member->next)
16254 if(!member->isProperty)
16260 for(member = _class->membersAndProperties.first; member; member = member->next)
16261 if(!member->isProperty)
16265 char pointerName[1024];
16266 struct Declaration * decl;
16267 struct Initializer * initializer;
16268 struct Expression * exp, * bytePtr;
16270 strcpy(pointerName, "__ecerePointer_");
16271 FullClassNameCat(pointerName, _class->fullName, 0x0);
16273 char className[1024];
16275 strcpy(className, "__ecereClass_");
16276 FullClassNameCat(className, classSym->string, 0x1);
16277 MangleClassName(className);
16278 DeclareClass(classSym, className);
16280 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16285 sprintf(string, "%d", _class->offset);
16286 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16290 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16292 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16293 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));
16296 yylloc = function->body->loc;
16297 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16299 struct Context * prevContext = curContext;
16301 curContext = function->body->compound.context;
16302 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16303 curContext = prevContext;
16305 decl->symbol = (((void *)0));
16306 if(!function->body->compound.declarations)
16307 function->body->compound.declarations = MkList();
16308 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16314 thisClass = (((void *)0));
16317 FreeSpecifier(id->_class);
16318 id->_class = (((void *)0));
16319 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16321 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16323 id = GetDeclId(initDecl->declarator);
16324 FreeSpecifier(id->_class);
16325 id->_class = (((void *)0));
16329 topContext = function->body->compound.context;
16331 struct FunctionDefinition * oldFunction = curFunction;
16333 curFunction = function;
16335 ProcessStatement(function->body);
16336 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16338 struct Statement * prevCompound = curCompound;
16339 struct Context * prevContext = curContext;
16340 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16342 if(!function->body->compound.statements)
16343 function->body->compound.statements = MkList();
16344 ListAdd(function->body->compound.statements, fireWatchers);
16345 curCompound = function->body;
16346 curContext = function->body->compound.context;
16347 ProcessStatement(fireWatchers);
16348 curContext = prevContext;
16349 curCompound = prevCompound;
16351 curFunction = oldFunction;
16353 if(function->declarator)
16355 ProcessDeclarator(function->declarator);
16357 topContext = oldTopContext;
16358 thisClass = oldThisClass;
16361 extern void FreeSymbol(struct Symbol * symbol);
16363 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16365 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16367 struct ClassDef * def;
16368 struct External * external = curExternal;
16369 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16371 for(def = definitions->first; def; def = def->next)
16375 if(def->function->declarator)
16376 curExternal = def->function->declarator->symbol->pointerExternal;
16378 curExternal = external;
16379 ProcessFunction((struct FunctionDefinition *)def->function);
16381 else if(def->type == 2)
16383 if(def->decl->type == 2)
16385 thisClass = regClass;
16386 ProcessInstantiationType(def->decl->inst);
16387 thisClass = (((void *)0));
16391 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16394 thisClass = regClass;
16395 ProcessDeclaration(def->decl);
16396 thisClass = backThisClass;
16399 else if(def->type == 1 && def->defProperties)
16401 struct MemberInit * defProperty;
16402 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);
16404 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16405 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16407 thisClass = regClass;
16408 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16409 thisClass = (((void *)0));
16411 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16412 FreeSymbol(thisSymbol);
16414 else if(def->type == 3 && def->propertyDef)
16416 struct PropertyDef * prop = def->propertyDef;
16418 thisClass = regClass;
16423 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16425 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16427 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16428 ProcessStatement(prop->setStmt);
16434 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16436 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16438 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16439 ProcessStatement(prop->getStmt);
16441 if(prop->issetStmt)
16445 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16447 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16449 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16450 ProcessStatement(prop->issetStmt);
16452 thisClass = (((void *)0));
16454 else if(def->type == 4 && def->propertyWatch)
16456 struct PropertyWatch * propertyWatch = def->propertyWatch;
16458 thisClass = regClass;
16459 if(propertyWatch->compound)
16461 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);
16463 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16464 curExternal = (((void *)0));
16465 ProcessStatement(propertyWatch->compound);
16467 thisClass = (((void *)0));
16472 void DeclareFunctionUtil(char * s)
16474 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16481 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16482 strcpy(name, "__ecereFunction_");
16483 FullClassNameCat(name, s, 0x0);
16484 DeclareFunction(function, name);
16488 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16490 void ComputeDataTypes()
16492 void * __ecereTemp1;
16493 struct External * external;
16494 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16495 struct External * after = (((void *)0));
16497 currentClass = (((void *)0));
16498 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16499 for(external = (*ast).first; external; external = external->next)
16501 if(external->type == 1)
16503 struct Declaration * decl = external->declaration;
16507 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16511 struct InitDeclarator * initDecl = (*decls).first;
16515 struct Declarator * declarator = initDecl->declarator;
16517 if(declarator && declarator->type == 1)
16519 struct Identifier * id = declarator->identifier;
16521 if(id && id->string)
16523 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16525 external->symbol->id = -1001, external->symbol->idCode = -1001;
16535 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16536 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16537 curExternal = temp;
16538 DeclareFunctionUtil("eSystem_New");
16539 DeclareFunctionUtil("eSystem_New0");
16540 DeclareFunctionUtil("eSystem_Renew");
16541 DeclareFunctionUtil("eSystem_Renew0");
16542 DeclareFunctionUtil("eClass_GetProperty");
16543 DeclareStruct("ecere::com::Class", 0x0);
16544 DeclareStruct("ecere::com::Instance", 0x0);
16545 DeclareStruct("ecere::com::Property", 0x0);
16546 DeclareStruct("ecere::com::DataMember", 0x0);
16547 DeclareStruct("ecere::com::Method", 0x0);
16548 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16549 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16550 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16551 for(external = (*ast).first; external; external = external->next)
16553 afterExternal = curExternal = external;
16554 if(external->type == 0)
16556 currentClass = external->function->_class;
16557 ProcessFunction(external->function);
16559 else if(external->type == 1)
16561 currentClass = (((void *)0));
16562 ProcessDeclaration(external->declaration);
16564 else if(external->type == 2)
16566 struct ClassDefinition * _class = external->_class;
16568 currentClass = external->symbol->registered;
16569 if(_class->definitions)
16571 ProcessClass(_class->definitions, _class->symbol);
16575 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16576 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16579 else if(external->type == 4)
16581 thisNameSpace = external->id->string;
16584 currentClass = (((void *)0));
16585 thisNameSpace = (((void *)0));
16586 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16587 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16590 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);
16592 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);
16594 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16596 struct __ecereNameSpace__ecere__com__Class * class;
16598 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16599 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16600 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16601 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16602 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16603 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16604 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16605 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16607 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16608 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16610 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16611 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16612 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16613 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16614 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16615 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16616 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16617 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16619 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16620 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16621 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16623 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16626 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16627 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16633 __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);
16634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16637 __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);
16638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16639 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16640 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16641 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16642 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16644 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16647 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16648 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16649 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16650 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16651 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16652 __ecereClass_Conversion = class;
16653 __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);
16654 __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);
16655 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16656 __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);
16657 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16658 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16659 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16660 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16661 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16662 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16663 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16664 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16665 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16668 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16669 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16676 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)