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)));
2780 unsigned int baseSize = _class->base->templateClass ? _class->base->templateClass->structSize : _class->base->structSize;
2782 if(maxSize > baseSize)
2783 maxSize -= baseSize;
2789 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2791 if(!member->isProperty)
2793 switch(member->type)
2797 if(member->dataTypeString)
2799 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * decls = MkList();
2800 struct Declarator * decl;
2802 decl = SpecDeclFromString(member->dataTypeString, specs, MkDeclaratorIdentifier(MkIdentifier(member->name)));
2803 ListAdd(decls, MkStructDeclarator(decl, (((void *)0))));
2804 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, decls, (((void *)0)))));
2805 if(!member->dataType)
2806 member->dataType = ProcessType(specs, decl);
2807 ReplaceThisClassSpecifiers(specs, topClass);
2809 struct Type * type = ProcessType(specs, decl);
2811 DeclareType(member->dataType, 0x0, 0x0);
2814 ComputeTypeSize(member->dataType);
2815 size = member->dataType->size;
2816 alignment = member->dataType->alignment;
2819 if(totalSize % alignment)
2820 totalSize += alignment - (totalSize % alignment);
2829 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * list = MkList();
2832 AddMembers(list, (struct __ecereNameSpace__ecere__com__Class *)member, 0x1, &size, topClass, (((void *)0)));
2833 ListAdd(specs, MkStructOrUnion((member->type == 1) ? 4 : 3, (((void *)0)), list));
2834 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(specs, (((void *)0)), (((void *)0)))));
2835 alignment = member->structAlignment;
2838 if(totalSize % alignment)
2839 totalSize += alignment - (totalSize % alignment);
2849 unsigned int __simpleStruct0;
2851 if(topMember && topMember->type == 1)
2852 *retSize = (__simpleStruct0 = *retSize, (__simpleStruct0 > totalSize) ? __simpleStruct0 : totalSize);
2854 *retSize += totalSize;
2856 else if(totalSize < maxSize && _class->type != 1000)
2858 int autoPadding = 0;
2860 if(!isMember && _class->structAlignment && totalSize % _class->structAlignment)
2861 autoPadding = _class->structAlignment - (totalSize % _class->structAlignment);
2862 if(totalSize + autoPadding < maxSize)
2864 char sizeString[50];
2866 sprintf(sizeString, "%d", maxSize - totalSize);
2867 ListAdd(declarations, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(CHAR)), MkListOne(MkDeclaratorArray(MkDeclaratorIdentifier(MkIdentifier("__ecere_padding")), MkExpConstant(sizeString))), (((void *)0)))));
2869 *addedPadding = 0x1;
2873 FinishTemplatesContext(context);
2874 return topMember ? topMember->memberID : _class->memberID;
2877 static int DeclareMembers(struct __ecereNameSpace__ecere__com__Class * _class, unsigned int isMember)
2879 struct __ecereNameSpace__ecere__com__DataMember * topMember = isMember ? (struct __ecereNameSpace__ecere__com__DataMember *)_class : (((void *)0));
2880 unsigned int totalSize = 0;
2881 struct __ecereNameSpace__ecere__com__DataMember * member;
2882 struct Context * context = isMember ? (((void *)0)) : SetupTemplatesContext(_class);
2884 if(!isMember && (_class->type == 1 || _class->type == 5) && _class->base->type != 1000)
2885 DeclareMembers(_class->base, 0x0);
2886 for(member = isMember ? topMember->members.first : _class->membersAndProperties.first; member; member = member->next)
2888 if(!member->isProperty)
2890 switch(member->type)
2894 if(!member->dataType && member->dataTypeString)
2895 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
2896 if(member->dataType)
2897 DeclareType(member->dataType, 0x0, 0x0);
2903 DeclareMembers((struct __ecereNameSpace__ecere__com__Class *)member, 0x1);
2910 FinishTemplatesContext(context);
2911 return topMember ? topMember->memberID : _class->memberID;
2914 extern struct Symbol * FindClass(char * name);
2916 extern char * strchr(const char * , int);
2918 extern void FullClassNameCat(char * output, char * className, unsigned int includeTemplateParams);
2920 extern void FreeList(struct __ecereNameSpace__ecere__sys__OldList * list, void (* )(void * ));
2922 extern void FreeClassDef(struct ClassDef * def);
2924 extern struct External * MkExternalDeclaration(struct Declaration * declaration);
2926 extern struct Declaration * MkDeclaration(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct __ecereNameSpace__ecere__sys__OldList * initDeclarators);
2928 extern char * strcpy(char * , const char * );
2930 extern void MangleClassName(char * className);
2932 extern void DeclareClass(struct Symbol * classSym, char * className);
2934 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move(struct __ecereNameSpace__ecere__sys__OldList * this, void * item, void * prevItem);
2936 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(struct __ecereNameSpace__ecere__sys__OldList * this, void * prevItem, void * item);
2938 void DeclareStruct(char * name, unsigned int skipNoHead)
2940 struct External * external = (((void *)0));
2941 struct Symbol * classSym = FindClass(name);
2943 if(!inCompiler || !classSym)
2945 if(classSym->registered && (classSym->registered->type == 2 || classSym->registered->type == 3 || classSym->registered->type == 4))
2947 if(classSym->registered && classSym->imported && !classSym->declaredStructSym)
2949 struct Declaration * decl;
2950 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
2951 struct __ecereNameSpace__ecere__sys__OldList * declarations = (((void *)0));
2952 char structName[1024];
2954 external = (classSym->registered && classSym->registered->type == 1) ? classSym->pointerExternal : classSym->structExternal;
2955 classSym->declaring++;
2956 if(strchr(classSym->string, '<'))
2958 if(classSym->registered->templateClass)
2960 DeclareStruct(classSym->registered->templateClass->fullName, skipNoHead);
2961 classSym->declaring--;
2965 DeclareMembers(classSym->registered, 0x0);
2966 structName[0] = (char)0;
2967 FullClassNameCat(structName, name, 0x0);
2970 unsigned int addedPadding = 0x0;
2972 classSym->declaredStructSym = 0x1;
2973 declarations = MkList();
2974 AddMembers(declarations, classSym->registered, 0x0, (((void *)0)), classSym->registered, &addedPadding);
2975 if(!(*declarations).count || ((*declarations).count == 1 && addedPadding))
2977 FreeList(declarations, FreeClassDef);
2978 declarations = (((void *)0));
2981 if(skipNoHead || declarations)
2983 if(external && external->declaration)
2985 ((struct Specifier *)(*external->declaration->specifiers).first)->definitions = declarations;
2986 if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
2988 if(classSym->structExternal)
2989 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
2990 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
2991 classSym->id = curExternal->symbol->idCode;
2992 classSym->idCode = curExternal->symbol->idCode;
2998 external = MkExternalDeclaration((((void *)0)));
2999 specifiers = MkList();
3000 declarators = MkList();
3001 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
3002 external->declaration = decl = MkDeclaration(specifiers, declarators);
3003 if(decl->symbol && !decl->symbol->pointerExternal)
3004 decl->symbol->pointerExternal = external;
3005 if(classSym->registered && classSym->registered->type == 1)
3007 char className[1024];
3009 strcpy(className, "__ecereClass_");
3010 FullClassNameCat(className, classSym->string, 0x1);
3011 MangleClassName(className);
3012 DeclareClass(classSym, className);
3013 external->symbol = classSym;
3014 classSym->pointerExternal = external;
3015 classSym->id = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3016 classSym->idCode = (curExternal && curExternal->symbol) ? curExternal->symbol->idCode : 0;
3020 char className[1024];
3022 strcpy(className, "__ecereClass_");
3023 FullClassNameCat(className, classSym->string, 0x1);
3024 MangleClassName(className);
3025 classSym->structExternal = external;
3026 DeclareClass(classSym, className);
3027 external->symbol = classSym;
3029 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
3032 classSym->declaring--;
3034 else if(curExternal && curExternal->symbol && curExternal->symbol->idCode < classSym->id)
3036 classSym->declaring++;
3038 if(classSym->registered)
3039 DeclareMembers(classSym->registered, 0x0);
3041 if(classSym->registered && (classSym->registered->type == 1 || classSym->registered->type == 5))
3043 if(classSym->structExternal)
3044 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->structExternal, curExternal->prev);
3045 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), classSym->pointerExternal, curExternal->prev);
3046 classSym->id = curExternal->symbol->idCode;
3047 classSym->idCode = curExternal->symbol->idCode;
3049 classSym->declaring--;
3053 extern char * strcat(char * , const char * );
3055 extern struct ModuleImport * FindModule(struct __ecereNameSpace__ecere__com__Instance * moduleToFind);
3057 extern struct ModuleImport * mainModule;
3059 extern struct Specifier * MkSpecifierName(char * name);
3061 extern struct Declarator * MkDeclaratorBrackets(struct Declarator * declarator);
3063 extern struct Declarator * PlugDeclarator(struct Declarator * decl, struct Declarator * baseDecl);
3065 extern struct Declarator * MkDeclaratorFunction(struct Declarator * declarator, struct __ecereNameSpace__ecere__sys__OldList * parameters);
3067 extern struct InitDeclarator * MkInitDeclarator(struct Declarator * declarator, struct Initializer * initializer);
3069 extern void FreeDeclarator(struct Declarator * decl);
3071 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_PropertyImport;
3073 struct PropertyImport
3075 struct PropertyImport * prev;
3076 struct PropertyImport * next;
3078 unsigned int isVirtual;
3079 unsigned int hasSet;
3080 unsigned int hasGet;
3081 } __attribute__ ((gcc_struct));
3083 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
3085 void DeclareProperty(struct __ecereNameSpace__ecere__com__Property * prop, char * setName, char * getName)
3087 void * __ecereTemp1;
3088 struct Symbol * symbol = prop->symbol;
3089 char propName[1024];
3091 strcpy(setName, "__ecereProp_");
3092 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3093 strcat(setName, "_Set_");
3094 FullClassNameCat(setName, prop->name, 0x1);
3095 strcpy(getName, "__ecereProp_");
3096 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3097 strcat(getName, "_Get_");
3098 FullClassNameCat(getName, prop->name, 0x1);
3099 strcpy(propName, "__ecereProp_");
3100 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3101 strcat(propName, "_");
3102 FullClassNameCat(propName, prop->name, 0x1);
3103 MangleClassName(getName);
3104 MangleClassName(setName);
3105 MangleClassName(propName);
3106 if(prop->_class->type == 1)
3107 DeclareStruct(prop->_class->fullName, 0x0);
3108 if(!symbol || curExternal->symbol->idCode < symbol->id)
3110 unsigned int imported = 0x0;
3111 unsigned int dllImport = 0x0;
3113 if(!symbol || symbol->_import)
3117 struct Symbol * classSym;
3119 if(!prop->_class->symbol)
3120 prop->_class->symbol = FindClass(prop->_class->fullName);
3121 classSym = prop->_class->symbol;
3122 if(classSym && !classSym->_import)
3124 struct ModuleImport * module;
3126 if(prop->_class->module)
3127 module = FindModule(prop->_class->module);
3129 module = mainModule;
3130 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));
3131 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3133 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3134 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));
3136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3139 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3144 struct Context * context = SetupTemplatesContext(prop->_class);
3146 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3147 FinishTemplatesContext(context);
3151 if(!symbol->externalGet || symbol->externalGet->type == 0)
3153 struct Declaration * decl;
3154 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3155 struct Declarator * d;
3156 struct __ecereNameSpace__ecere__sys__OldList * params;
3157 struct Specifier * spec;
3158 struct External * external;
3159 struct Declarator * typeDecl;
3160 unsigned int simple = 0x0;
3162 specifiers = MkList();
3163 declarators = MkList();
3165 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3166 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3168 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3170 struct Context * context = SetupTemplatesContext(prop->_class);
3172 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3173 FinishTemplatesContext(context);
3175 for(spec = (*specifiers).first; spec; spec = spec->next)
3179 if((!typeDecl || typeDecl->type == 1))
3181 struct Symbol * classSym = spec->symbol;
3183 symbol->_class = classSym->registered;
3184 if(classSym->registered && classSym->registered->type == 1)
3186 DeclareStruct(spec->name, 0x0);
3193 d = PlugDeclarator(typeDecl, d);
3196 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3197 specifiers = MkList();
3199 d = MkDeclaratorFunction(d, params);
3201 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3202 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3205 ListAdd(specifiers, MkSpecifier(VOID));
3206 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3207 decl = MkDeclaration(specifiers, declarators);
3208 external = MkExternalDeclaration(decl);
3209 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3210 external->symbol = symbol;
3211 symbol->externalGet = external;
3212 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3214 FreeDeclarator(typeDecl);
3218 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3223 if(!symbol->externalSet || symbol->externalSet->type == 0)
3225 struct Declaration * decl;
3226 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3227 struct Declarator * d;
3228 struct __ecereNameSpace__ecere__sys__OldList * params;
3229 struct Specifier * spec;
3230 struct External * external;
3231 struct Declarator * typeDecl;
3233 declarators = MkList();
3235 if(!prop->conversion || prop->_class->type == 1)
3237 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3239 specifiers = MkList();
3241 struct Context * context = SetupTemplatesContext(prop->_class);
3243 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3244 FinishTemplatesContext(context);
3246 ListAdd(params, MkTypeName(specifiers, d));
3247 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3249 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3250 d = MkDeclaratorFunction(d, params);
3251 for(spec = (*specifiers).first; spec; spec = spec->next)
3255 if((!typeDecl || typeDecl->type == 1))
3257 struct Symbol * classSym = spec->symbol;
3259 symbol->_class = classSym->registered;
3260 if(classSym->registered && classSym->registered->type == 1)
3261 DeclareStruct(spec->name, 0x0);
3265 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3266 specifiers = MkList();
3268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3269 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3270 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3271 if(!prop->conversion || prop->_class->type == 1)
3272 ListAdd(specifiers, MkSpecifier(VOID));
3274 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3275 decl = MkDeclaration(specifiers, declarators);
3276 external = MkExternalDeclaration(decl);
3277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3278 external->symbol = symbol;
3279 symbol->externalSet = external;
3280 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3284 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3287 if(!symbol->externalPtr)
3289 struct Declaration * decl;
3290 struct External * external;
3291 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3294 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3296 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3297 ListAdd(specifiers, MkSpecifierName("Property"));
3299 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3301 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3304 strcpy(propName, "__ecerePropM_");
3305 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3306 strcat(propName, "_");
3307 FullClassNameCat(propName, prop->name, 0x1);
3308 MangleClassName(propName);
3309 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3311 decl = MkDeclaration(specifiers, list);
3313 external = MkExternalDeclaration(decl);
3314 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3315 external->symbol = symbol;
3316 symbol->externalPtr = external;
3320 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3322 symbol->id = curExternal->symbol->idCode;
3326 struct Type * Dereference(struct Type * source)
3328 void * __ecereTemp1;
3329 struct Type * type = (((void *)0));
3333 if(source->kind == 13 || source->kind == 12)
3335 type = source->type;
3336 source->type->refCount++;
3338 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3340 type = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 1, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
3342 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3348 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3353 static struct Type * Reference(struct Type * source)
3355 void * __ecereTemp1;
3356 struct Type * type = (((void *)0));
3360 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));
3366 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);
3368 extern void * memcpy(void * , const void * , size_t size);
3370 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3372 extern void FreeExpression(struct Expression * exp);
3374 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3376 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);
3378 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3380 extern struct Type * MkClassType(char * name);
3382 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);
3384 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)
3386 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3387 unsigned int found = 0x0;
3388 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3389 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3390 unsigned int freeType = 0x0;
3392 yylloc = member->loc;
3397 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3401 dataMember = *curMember;
3407 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3408 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3409 int _subMemberStackPos = 0;
3412 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3415 dataMember = thisMember;
3416 if(curMember && thisMember->memberAccess == 1)
3418 *curMember = thisMember;
3419 *curClass = thisMember->_class;
3420 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3421 *subMemberStackPos = _subMemberStackPos;
3427 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3428 if(method && method->type == 1)
3431 method = (((void *)0));
3436 struct Type * type = (((void *)0));
3440 if(!dataMember->dataType && dataMember->dataTypeString)
3442 struct Context * context = SetupTemplatesContext(_class);
3444 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3445 FinishTemplatesContext(context);
3447 type = dataMember->dataType;
3451 if(!method->dataType)
3452 ProcessMethodType(method);
3453 type = method->dataType;
3455 if(ident && ident->next)
3457 for(ident = ident->next; ident && type; ident = ident->next)
3461 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3463 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3465 type = dataMember->dataType;
3467 else if(type->kind == 9 || type->kind == 10)
3469 struct Type * memberType;
3471 for(memberType = type->members.first; memberType; memberType = memberType->next)
3473 if(!strcmp(memberType->name, ident->string))
3482 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3485 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3486 struct __ecereNameSpace__ecere__com__Class * sClass;
3488 for(sClass = _class; sClass; sClass = sClass->base)
3491 if(sClass->templateClass)
3492 sClass = sClass->templateClass;
3493 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3495 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3497 for(sClass = sClass->base; sClass; sClass = sClass->base)
3499 if(sClass->templateClass)
3500 sClass = sClass->templateClass;
3501 id += sClass->templateParams.count;
3512 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3514 if(arg.dataTypeString)
3516 type = ProcessTypeString(arg.dataTypeString, 0x0);
3518 if(type && _class->templateClass)
3519 type->passAsTemplate = 0x1;
3526 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3528 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3529 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3533 char templateString[1024];
3534 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3536 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3537 for(cClass = expClass; cClass; cClass = cClass->base)
3541 if(cClass->templateClass)
3542 cClass = cClass->templateClass;
3543 for(param = cClass->templateParams.first; param; param = param->next)
3546 struct __ecereNameSpace__ecere__com__Class * sClass;
3547 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3549 for(sClass = cClass->base; sClass; sClass = sClass->base)
3551 if(sClass->templateClass)
3552 sClass = sClass->templateClass;
3553 id += sClass->templateParams.count;
3555 arg = expClass->templateArgs[id];
3556 for(sClass = _class; sClass; sClass = sClass->base)
3558 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3560 struct __ecereNameSpace__ecere__com__Class * nextClass;
3562 if(sClass->templateClass)
3563 sClass = sClass->templateClass;
3564 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3566 if(nextClass->templateClass)
3567 nextClass = nextClass->templateClass;
3568 p += nextClass->templateParams.count;
3570 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3572 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3574 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3576 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3577 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3591 char expString[1024];
3592 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3593 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3594 struct Expression * exp;
3595 char * string = PrintHexUInt64(arg.expression.ui64);
3597 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3598 ProcessExpressionType(exp);
3599 ComputeExpression(exp);
3600 expString[0] = '\0';
3601 PrintExpression(exp, expString);
3602 strcat(argument, expString);
3603 FreeExpression(exp);
3608 strcat(argument, arg.member->name);
3613 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3614 strcat(argument, arg.dataTypeString);
3621 strcat(templateString, ", ");
3622 if(lastParam != p - 1)
3624 strcat(templateString, param->name);
3625 strcat(templateString, " = ");
3627 strcat(templateString, argument);
3636 int len = strlen(templateString);
3638 if(templateString[len - 1] == '<')
3642 if(templateString[len - 1] == '>')
3643 templateString[len++] = ' ';
3644 templateString[len++] = '>';
3646 templateString[len++] = '\0';
3649 struct Context * context = SetupTemplatesContext(_class);
3653 type = ProcessTypeString(templateString, 0x0);
3655 FinishTemplatesContext(context);
3658 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3660 ProcessExpressionType(member->initializer->exp);
3661 if(!member->initializer->exp->expType)
3665 char expString[10240];
3667 expString[0] = '\0';
3668 PrintExpression(member->initializer->exp, expString);
3669 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3670 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3673 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3675 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3678 else if(member->initializer)
3680 ProcessInitializer(member->initializer, type);
3687 if(_class && _class->type == 3)
3689 if(member->initializer)
3691 struct Type * type = MkClassType(_class->fullName);
3693 ProcessInitializer(member->initializer, type);
3699 if(member->initializer)
3701 ProcessInitializer(member->initializer, (((void *)0)));
3707 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3711 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3713 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3717 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3722 extern struct Identifier * GetDeclId(struct Declarator * decl);
3724 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);
3726 extern void FreeSpecifier(struct Specifier * spec);
3728 static void ProcessFunction(struct FunctionDefinition * function);
3730 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3732 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3734 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3736 extern void FreeClassFunction(struct ClassFunction * func);
3738 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3740 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3742 void ProcessInstantiationType(struct Instantiation * inst)
3747 struct MembersInit * members;
3748 struct Symbol * classSym;
3749 struct __ecereNameSpace__ecere__com__Class * _class;
3751 classSym = inst->_class->symbol;
3752 _class = classSym ? classSym->registered : (((void *)0));
3753 if(!_class || _class->type != 5)
3754 DeclareStruct(inst->_class->name, 0x0);
3755 afterExternal = afterExternal ? afterExternal : curExternal;
3757 ProcessExpressionType(inst->exp);
3758 inst->isConstant = 0x1;
3761 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3762 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3763 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3764 int subMemberStackPos = 0;
3766 for(members = (*inst->members).first; members; members = members->next)
3768 switch(members->type)
3773 static unsigned int instMethodID = 0;
3774 struct External * external = curExternal;
3775 struct Context * context = curContext;
3776 struct Declarator * declarator = members->function->declarator;
3777 struct Identifier * nameID = GetDeclId(declarator);
3778 char * unmangled = nameID ? nameID->string : (((void *)0));
3779 struct Expression * exp;
3780 struct External * createdExternal = (((void *)0));
3786 strcpy(name, "__ecereInstMeth_");
3787 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3789 strcat(name, nameID->string);
3791 sprintf(number, "_%08d", instMethodID++);
3792 strcat(name, number);
3793 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3797 struct Symbol * symbol = declarator->symbol;
3798 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3800 if(method && method->type == 1)
3802 symbol->method = method;
3803 ProcessMethodType(method);
3804 if(!symbol->type->thisClass)
3806 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3808 if(!currentClass->symbol)
3809 currentClass->symbol = FindClass(currentClass->fullName);
3810 symbol->type->thisClass = currentClass->symbol;
3815 _class->symbol = FindClass(_class->fullName);
3816 symbol->type->thisClass = _class->symbol;
3819 DeclareType(symbol->type, 0x1, 0x1);
3823 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3826 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3829 FreeSpecifier(nameID->_class);
3830 nameID->_class = (((void *)0));
3834 struct Type * type = declarator->symbol->type;
3835 struct External * oldExternal = curExternal;
3837 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3839 struct External * externalDecl;
3841 externalDecl = MkExternalDeclaration((((void *)0)));
3842 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3843 if(createdExternal->function)
3845 ProcessFunction(createdExternal->function);
3847 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3849 externalDecl->declaration = decl;
3850 if(decl->symbol && !decl->symbol->pointerExternal)
3851 decl->symbol->pointerExternal = externalDecl;
3852 declarator->symbol->pointerExternal = externalDecl;
3859 curExternal = declarator->symbol->pointerExternal;
3860 ProcessFunction((struct FunctionDefinition *)members->function);
3862 curExternal = external;
3863 curContext = context;
3866 FreeClassFunction(members->function);
3867 exp = QMkExpId(name);
3869 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3870 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3876 if(members->dataMembers && classSym)
3878 struct MemberInit * member;
3879 struct Location oldyyloc = yylloc;
3881 for(member = (*members->dataMembers).first; member; member = member->next)
3883 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3884 if(member->initializer && !member->initializer->isConstant)
3885 inst->isConstant = 0x0;
3897 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3901 if(type->kind == 11)
3903 struct Type * param;
3907 for(param = type->params.first; param; param = param->next)
3908 DeclareType(param, declarePointers, 0x1);
3910 DeclareType(type->returnType, declarePointers, 0x1);
3912 else if(type->kind == 13 && declarePointers)
3913 DeclareType(type->type, declarePointers, 0x0);
3914 else if(type->kind == 8)
3916 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3917 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3919 else if(type->kind == 9 || type->kind == 10)
3921 struct Type * member;
3923 for(member = type->members.first; member; member = member->next)
3924 DeclareType(member, 0x0, 0x0);
3926 else if(type->kind == 12)
3927 DeclareType(type->arrayType, declarePointers, 0x0);
3931 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3933 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3935 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3937 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3938 struct __ecereNameSpace__ecere__com__Class * sClass;
3940 for(sClass = _class; sClass; sClass = sClass->base)
3943 if(sClass->templateClass)
3944 sClass = sClass->templateClass;
3945 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3947 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3949 for(sClass = sClass->base; sClass; sClass = sClass->base)
3951 if(sClass->templateClass)
3952 sClass = sClass->templateClass;
3953 id += sClass->templateParams.count;
3964 arg = &_class->templateArgs[id];
3965 if(arg && param->type == 0)
3966 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3971 extern struct Context * PushContext(void);
3973 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3975 struct TemplatedType
3978 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3979 struct __ecereNameSpace__ecere__sys__BTNode * left;
3980 struct __ecereNameSpace__ecere__sys__BTNode * right;
3982 struct TemplateParameter * param;
3983 } __attribute__ ((gcc_struct));
3985 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
3987 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
3989 void * __ecereTemp1;
3990 struct Context * context = PushContext();
3992 context->templateTypesOnly = 0x1;
3993 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
3995 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
3997 for(; param; param = param->next)
3999 if(param->type == 0 && param->identifier)
4001 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4003 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4009 struct __ecereNameSpace__ecere__com__Class * sClass;
4011 for(sClass = _class; sClass; sClass = sClass->base)
4013 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4015 for(p = sClass->templateParams.first; p; p = p->next)
4019 struct TemplateParameter * param = p->param;
4020 struct TemplatedType * type;
4024 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));
4026 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));
4027 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4035 extern void PopContext(struct Context * ctx);
4037 extern void FreeContext(struct Context * context);
4039 void FinishTemplatesContext(struct Context * context)
4041 PopContext(context);
4042 FreeContext(context);
4043 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4046 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4048 if(!method->dataType)
4050 struct Context * context = SetupTemplatesContext(method->_class);
4052 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4053 FinishTemplatesContext(context);
4054 if(method->type != 1 && method->dataType)
4056 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4058 if(!method->_class->symbol)
4059 method->_class->symbol = FindClass(method->_class->fullName);
4060 method->dataType->thisClass = method->_class->symbol;
4066 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4070 struct Context * context = SetupTemplatesContext(prop->_class);
4072 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4073 FinishTemplatesContext(context);
4077 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4079 extern void FreeTypeName(struct TypeName * typeName);
4081 static void ProcessDeclarator(struct Declarator * decl);
4083 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4085 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4089 struct MethodImport * prev;
4090 struct MethodImport * next;
4092 unsigned int isVirtual;
4093 } __attribute__ ((gcc_struct));
4095 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4097 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4099 void * __ecereTemp1;
4100 struct Symbol * symbol = method->symbol;
4102 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4104 unsigned int imported = 0x0;
4105 unsigned int dllImport = 0x0;
4107 if(!method->dataType)
4108 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4109 if(!symbol || symbol->_import || method->type == 1)
4111 if(!symbol || method->type == 1)
4113 struct Symbol * classSym;
4115 if(!method->_class->symbol)
4116 method->_class->symbol = FindClass(method->_class->fullName);
4117 classSym = method->_class->symbol;
4118 if(!classSym->_import)
4120 struct ModuleImport * module;
4122 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4123 module = FindModule(method->_class->module);
4125 module = mainModule;
4126 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));
4127 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4131 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4133 if(!symbol->_import)
4135 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));
4136 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4140 symbol->type = method->dataType;
4142 symbol->type->refCount++;
4145 if(!method->dataType->dllExport)
4148 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4152 if(method->type != 1 && method->dataType)
4153 DeclareType(method->dataType, 0x1, 0x1);
4154 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4156 struct Declaration * decl;
4157 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4158 struct Declarator * d;
4159 struct Declarator * funcDecl;
4160 struct External * external;
4162 specifiers = MkList();
4163 declarators = MkList();
4165 ListAdd(specifiers, MkSpecifier(EXTERN));
4166 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4167 ListAdd(specifiers, MkSpecifier(STATIC));
4168 if(method->type == 1)
4170 ListAdd(specifiers, MkSpecifier(INT));
4171 d = MkDeclaratorIdentifier(MkIdentifier(name));
4175 d = MkDeclaratorIdentifier(MkIdentifier(name));
4177 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4179 struct Context * context = SetupTemplatesContext(method->_class);
4181 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4182 FinishTemplatesContext(context);
4184 funcDecl = GetFuncDecl(d);
4187 struct Specifier * spec, * next;
4189 for(spec = (*specifiers).first; spec; spec = next)
4194 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4195 FreeSpecifier(spec);
4199 if(method->dataType && !method->dataType->staticMethod)
4201 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4203 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4204 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")));
4205 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4206 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4208 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4210 struct TypeName * param = (*funcDecl->function.parameters).first;
4212 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4213 FreeTypeName(param);
4215 if(!funcDecl->function.parameters)
4216 funcDecl->function.parameters = MkList();
4217 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4221 ProcessDeclarator(d);
4222 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4223 decl = MkDeclaration(specifiers, declarators);
4224 ReplaceThisClassSpecifiers(specifiers, method->_class);
4225 if(symbol->pointerExternal)
4227 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4230 *functionSymbol = *symbol;
4231 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4232 if(functionSymbol->type)
4233 functionSymbol->type->refCount++;
4235 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4236 symbol->pointerExternal->symbol = functionSymbol;
4238 external = MkExternalDeclaration(decl);
4240 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4241 external->symbol = symbol;
4242 symbol->pointerExternal = external;
4246 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4248 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4252 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4254 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4256 unsigned int first = 0x1;
4258 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4260 char className[1024];
4262 strcpy(className, _class->fullName);
4263 for(param = _class->templateParams.first; param; param = param->next)
4267 strcat(className, "<");
4269 strcat(className, ", ");
4270 if(lastParam + 1 != p)
4272 strcat(className, param->name);
4273 strcat(className, " = ");
4275 strcat(className, param->name);
4283 int len = strlen(className);
4285 if(className[len - 1] == '>')
4286 className[len++] = ' ';
4287 className[len++] = '>';
4288 className[len++] = '\0';
4290 return __ecereNameSpace__ecere__sys__CopyString(className);
4293 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4296 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4298 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4300 unsigned int first = 0x1;
4302 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4304 char className[1024];
4306 strcpy(className, _class->fullName);
4307 for(param = _class->templateParams.first; param; param = param->next)
4311 strcat(className, "<");
4313 strcat(className, ", ");
4314 if(lastParam + 1 != p)
4316 strcat(className, param->name);
4317 strcat(className, " = ");
4319 strcat(className, param->name);
4327 int len = strlen(className);
4329 if(className[len - 1] == '>')
4330 className[len++] = ' ';
4331 className[len++] = '>';
4332 className[len++] = '\0';
4334 return MkClassType(className);
4338 return MkClassType(_class->fullName);
4342 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4344 if(specs != (((void *)0)) && _class)
4346 struct Specifier * spec;
4348 for(spec = specs->first; spec; spec = spec->next)
4350 if(spec->type == 0 && spec->specifier == THISCLASS)
4353 spec->name = ReplaceThisClass(_class);
4354 spec->symbol = FindClass(spec->name);
4360 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4362 struct __ecereNameSpace__ecere__com__GlobalFunction
4364 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4365 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4368 struct __ecereNameSpace__ecere__com__Instance * module;
4369 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4370 char * dataTypeString;
4371 struct Type * dataType;
4373 } __attribute__ ((gcc_struct));
4375 extern struct Context * globalContext;
4377 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4379 struct FunctionImport
4381 struct FunctionImport * prev;
4382 struct FunctionImport * next;
4384 } __attribute__ ((gcc_struct));
4386 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4388 void * __ecereTemp1;
4389 struct Symbol * symbol = function->symbol;
4391 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4393 unsigned int imported = 0x0;
4394 unsigned int dllImport = 0x0;
4396 if(!function->dataType)
4398 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4399 if(!function->dataType->thisClass)
4400 function->dataType->staticMethod = 0x1;
4406 struct ModuleImport * module = FindModule(function->module);
4408 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4411 if(!function->dataType->dllExport)
4413 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));
4414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4418 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4419 if(!symbol->type->thisClass)
4420 symbol->type->staticMethod = 0x1;
4423 imported = symbol->_import ? 0x1 : 0x0;
4424 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4427 DeclareType(function->dataType, 0x1, 0x1);
4430 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4432 struct Declaration * decl;
4433 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4434 struct Declarator * d;
4435 struct Declarator * funcDecl;
4436 struct External * external;
4438 specifiers = MkList();
4439 declarators = MkList();
4440 ListAdd(specifiers, MkSpecifier(EXTERN));
4441 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4443 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4444 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4445 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4447 struct Specifier * spec;
4449 for(spec = (*specifiers).first; spec; spec = spec->next)
4450 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4453 FreeSpecifier(spec);
4457 funcDecl = GetFuncDecl(d);
4458 if(funcDecl && !funcDecl->function.parameters)
4460 funcDecl->function.parameters = MkList();
4461 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4463 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4465 struct Context * oldCtx = curContext;
4467 curContext = globalContext;
4468 decl = MkDeclaration(specifiers, declarators);
4469 curContext = oldCtx;
4471 if(symbol->pointerExternal)
4473 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4476 *functionSymbol = *symbol;
4477 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4478 if(functionSymbol->type)
4479 functionSymbol->type->refCount++;
4481 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4482 symbol->pointerExternal->symbol = functionSymbol;
4484 external = MkExternalDeclaration(decl);
4486 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4487 external->symbol = symbol;
4488 symbol->pointerExternal = external;
4492 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4495 symbol->id = curExternal->symbol->idCode;
4498 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4501 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4506 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4507 struct __ecereNameSpace__ecere__sys__BTNode * left;
4508 struct __ecereNameSpace__ecere__sys__BTNode * right;
4510 struct __ecereNameSpace__ecere__com__Instance * module;
4511 char * dataTypeString;
4512 struct Type * dataType;
4515 } __attribute__ ((gcc_struct));
4517 void DeclareGlobalData(struct GlobalData * data)
4519 struct Symbol * symbol = data->symbol;
4521 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4526 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4529 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4530 DeclareType(data->dataType, 0x1, 0x1);
4533 if(!symbol->pointerExternal)
4535 struct Declaration * decl;
4536 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4537 struct Declarator * d;
4538 struct External * external;
4540 specifiers = MkList();
4541 declarators = MkList();
4542 ListAdd(specifiers, MkSpecifier(EXTERN));
4543 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4544 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4545 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4546 decl = MkDeclaration(specifiers, declarators);
4547 external = MkExternalDeclaration(decl);
4549 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4550 external->symbol = symbol;
4551 symbol->pointerExternal = external;
4555 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4558 symbol->id = curExternal->symbol->idCode;
4565 struct Conversion * prev, * next;
4566 struct __ecereNameSpace__ecere__com__Property * convert;
4568 struct Type * resultType;
4569 } __attribute__ ((gcc_struct));
4571 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4573 extern void Compiler_Warning(char * format, ...);
4575 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4577 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)
4581 if(source->kind == 20 && dest->kind != 20)
4583 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4588 if(dest->kind == 20 && source->kind != 20)
4590 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4595 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4599 if(source->classObjectType == 3 && dest->classObjectType != 2)
4603 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4605 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4608 if(dest->kind == 14 && source->kind != 0)
4610 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))
4612 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))
4614 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4616 if(source->_class->registered && source->_class->registered->type == 3)
4618 if(conversions != (((void *)0)))
4620 if(source->_class->registered == dest->_class->registered)
4625 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4627 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4629 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4631 if(sourceBase == destBase)
4635 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))
4639 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4641 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4648 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4652 if(source->kind == 8)
4654 struct __ecereNameSpace__ecere__com__Class * _class;
4656 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4658 struct __ecereNameSpace__ecere__com__Property * convert;
4660 for(convert = _class->conversions.first; convert; convert = convert->next)
4662 if(convert->memberAccess == 1 || _class->module == privateModule)
4664 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4666 if(!convert->dataType)
4667 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4668 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4670 if(!conversions && !convert->Get)
4672 else if(conversions != (((void *)0)))
4674 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))
4678 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4680 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4691 struct __ecereNameSpace__ecere__com__Class * _class;
4693 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4695 struct __ecereNameSpace__ecere__com__Property * convert;
4697 for(convert = _class->conversions.first; convert; convert = convert->next)
4699 if(convert->memberAccess == 1 || _class->module == privateModule)
4701 if(!convert->dataType)
4702 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4703 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4705 if(!conversions && !convert->Set)
4707 else if(conversions != (((void *)0)))
4709 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))
4713 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4715 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4723 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4725 if(!dest->_class->registered->dataType)
4726 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4727 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4729 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4736 if(source->kind == 8)
4738 struct __ecereNameSpace__ecere__com__Class * _class;
4740 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4742 struct __ecereNameSpace__ecere__com__Property * convert;
4744 for(convert = _class->conversions.first; convert; convert = convert->next)
4746 if(convert->memberAccess == 1 || _class->module == privateModule)
4748 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4750 if(!convert->dataType)
4751 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4752 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4754 if(!conversions && !convert->Get)
4756 else if(conversions != (((void *)0)))
4758 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))
4762 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4764 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4772 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4774 if(!source->_class->registered->dataType)
4775 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4776 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4783 if(source->kind == 8 || source->kind == 19)
4785 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4787 else if(dest->kind == 7 && source->kind == 6)
4789 else if(dest->kind == 2 && source->kind == 1)
4791 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4793 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4795 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4797 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4799 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))
4801 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))
4803 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)))
4805 struct Type * paramSource, * paramDest;
4807 if(dest->kind == 16)
4808 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4809 if(source->kind == 16)
4810 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4811 if(dest->kind == 13 && dest->type->kind == 11)
4813 if(source->kind == 13 && source->type->kind == 11)
4814 source = source->type;
4815 if(dest->kind == 16)
4816 dest = dest->method->dataType;
4817 if(source->kind == 16)
4818 source = source->method->dataType;
4819 paramSource = source->params.first;
4820 if(paramSource && paramSource->kind == 0)
4821 paramSource = (((void *)0));
4822 paramDest = dest->params.first;
4823 if(paramDest && paramDest->kind == 0)
4824 paramDest = (((void *)0));
4825 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4827 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))))
4829 if(paramDest && paramDest->kind == 8)
4830 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4832 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4835 paramDest = paramDest->next;
4837 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4839 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4843 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4845 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4851 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4854 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4856 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4860 paramSource = paramSource->next;
4866 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4868 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4874 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4882 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4884 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4887 for(; paramDest; paramDest = paramDest->next)
4891 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4895 struct Type * paramDestType = paramDest;
4896 struct Type * paramSourceType = paramSource;
4897 struct Type * type = paramDestType;
4899 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4902 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4903 struct __ecereNameSpace__ecere__com__Class * sClass;
4905 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4908 if(sClass->templateClass)
4909 sClass = sClass->templateClass;
4910 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4912 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4914 for(sClass = sClass->base; sClass; sClass = sClass->base)
4916 if(sClass->templateClass)
4917 sClass = sClass->templateClass;
4918 id += sClass->templateParams.count;
4929 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4931 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4934 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)))
4939 PrintType(paramDest, type, 0x0, 0x1);
4940 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4941 if(paramDestType != paramDest)
4942 FreeType(paramDestType);
4945 if(paramDestType != paramDest)
4946 FreeType(paramDestType);
4948 paramSource = paramSource->next;
4952 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4957 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4961 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4963 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4970 static void FreeConvert(struct Conversion * convert)
4972 if(convert->resultType)
4973 FreeType(convert->resultType);
4976 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
4978 struct __ecereNameSpace__ecere__com__BTNamedLink
4981 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
4982 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
4983 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
4986 } __attribute__ ((gcc_struct));
4988 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
4990 struct __ecereNameSpace__ecere__com__EnumClassData
4992 struct __ecereNameSpace__ecere__sys__OldList values;
4994 } __attribute__ ((gcc_struct));
4996 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
4998 struct __ecereNameSpace__ecere__sys__NamedLink
5000 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5001 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5004 } __attribute__ ((gcc_struct));
5006 extern void FreeExpContents(struct Expression * exp);
5008 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5010 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5012 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5014 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5016 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5018 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5020 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5022 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)))
5024 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5026 if(_class->type == 4)
5028 struct __ecereNameSpace__ecere__sys__OldList converts =
5032 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5036 _class->symbol = FindClass(_class->fullName);
5037 type->_class = _class->symbol;
5038 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5040 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5041 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5045 struct __ecereNameSpace__ecere__com__Class * baseClass;
5047 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5049 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5051 for(value = e->values.first; value; value = value->next)
5053 if(!strcmp(value->name, string))
5058 FreeExpContents(sourceExp);
5059 FreeType(sourceExp->expType);
5060 sourceExp->isConstant = 0x1;
5061 sourceExp->expType = MkClassType(baseClass->fullName);
5065 sourceExp->type = 2;
5066 if(!strcmp(baseClass->dataTypeString, "int"))
5067 sprintf(constant, "%d", value->data);
5069 sprintf(constant, "0x%X", value->data);
5070 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5072 while(converts.first)
5074 struct Conversion * convert = converts.first;
5076 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5077 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5079 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5086 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5087 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5090 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)))
5091 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5096 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5098 struct __ecereNameSpace__ecere__com__SubModule
5100 struct __ecereNameSpace__ecere__com__SubModule * prev;
5101 struct __ecereNameSpace__ecere__com__SubModule * next;
5102 struct __ecereNameSpace__ecere__com__Instance * module;
5104 } __attribute__ ((gcc_struct));
5106 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5108 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5110 if(searchFor == searchIn)
5112 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5114 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5116 if(ModuleVisibility(subModule->module, searchFor))
5123 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5125 struct __ecereNameSpace__ecere__com__Application
5130 unsigned int isGUIApp;
5131 struct __ecereNameSpace__ecere__sys__OldList allModules;
5132 char * parsedCommand;
5133 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5134 } __attribute__ ((gcc_struct));
5136 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5138 struct __ecereNameSpace__ecere__com__Instance * module;
5140 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))
5142 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))
5144 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))
5146 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)
5148 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5154 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5156 void ReadString(char * output, char * string);
5158 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5160 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5162 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5164 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5166 void * __ecereTemp1;
5167 struct Type * source = sourceExp->expType;
5168 struct Type * realDest = dest;
5169 struct Type * backupSourceExpType = (((void *)0));
5171 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5173 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5175 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5177 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5179 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5181 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5183 if(sourceBase == destBase)
5189 struct __ecereNameSpace__ecere__sys__OldList * specs;
5190 unsigned int flag = 0x0;
5191 long long value = (((int)0x7fffffff));
5195 if(sourceExp->type == 2)
5197 if(source->isSigned)
5198 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5200 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5202 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5204 if(source->isSigned)
5205 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5207 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5209 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5212 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));
5216 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5218 if(_class && _class->type == 3)
5220 if(source->kind != 8)
5222 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5223 struct Type * tempDest, * tempSource;
5225 for(; _class->base->type != 1000; _class = _class->base)
5228 tempDest = tempType;
5231 _class->symbol = FindClass(_class->fullName);
5232 tempType->_class = _class->symbol;
5233 tempType->truth = dest->truth;
5234 if(tempType->_class)
5235 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5236 backupSourceExpType = sourceExp->expType;
5237 sourceExp->expType = dest;
5240 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5243 if(_class && _class->type == 2 && source->kind != 8)
5245 if(!dest->_class->registered->dataType)
5246 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5247 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5250 FreeType(sourceExp->expType);
5251 source = sourceExp->expType = MkClassType(dest->_class->string);
5255 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5257 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5258 struct Declarator * decl;
5261 ReadString(string, sourceExp->string);
5262 decl = SpecDeclFromString(string, specs, (((void *)0)));
5263 FreeExpContents(sourceExp);
5264 FreeType(sourceExp->expType);
5265 sourceExp->type = 26;
5266 sourceExp->_classExp.specifiers = specs;
5267 sourceExp->_classExp.decl = decl;
5268 sourceExp->expType = dest;
5272 if(backupSourceExpType)
5273 FreeType(backupSourceExpType);
5277 else if(source->kind == 8)
5279 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5281 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5285 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5286 struct Type * tempDest, * tempSource;
5288 if(!source->_class->registered->dataType)
5289 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5290 for(; _class->base->type != 1000; _class = _class->base)
5293 tempSource = tempType;
5295 tempType->_class = FindClass(_class->fullName);
5296 tempType->truth = source->truth;
5297 tempType->classObjectType = source->classObjectType;
5298 if(tempType->_class)
5299 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5300 if(conversions->last)
5302 ((struct Conversion *)conversions->last)->resultType = dest;
5305 FreeType(sourceExp->expType);
5306 sourceExp->expType = MkClassType(_class->fullName);
5307 sourceExp->expType->truth = source->truth;
5308 sourceExp->expType->classObjectType = source->classObjectType;
5309 if(!sourceExp->destType)
5311 FreeType(sourceExp->destType);
5312 sourceExp->destType = sourceExp->expType;
5313 if(sourceExp->expType)
5314 sourceExp->expType->refCount++;
5316 if(!_class->dataType)
5317 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5319 dest = MkClassType(source->_class->string);
5320 dest->truth = source->truth;
5321 dest->classObjectType = source->classObjectType;
5323 source = _class->dataType;
5325 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5331 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5340 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5342 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5344 if(_class->type == 0 || _class->type == 5)
5346 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5348 *newExp = *sourceExp;
5349 if(sourceExp->destType)
5350 sourceExp->destType->refCount++;
5351 if(sourceExp->expType)
5352 sourceExp->expType->refCount++;
5353 sourceExp->type = 11;
5354 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5355 sourceExp->cast.exp = newExp;
5356 FreeType(sourceExp->expType);
5357 sourceExp->expType = (((void *)0));
5358 ProcessExpressionType(sourceExp);
5361 FreeType(sourceExp->expType);
5362 sourceExp->expType = dest;
5367 if(backupSourceExpType)
5368 FreeType(backupSourceExpType);
5371 if(!_class->dataType)
5372 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5374 dest = _class->dataType;
5377 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5379 specs = MkListOne(MkSpecifier(DOUBLE));
5381 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5383 specs = MkListOne(MkSpecifier(FLOAT));
5385 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5389 ListAdd(specs, MkSpecifier(UNSIGNED));
5390 ListAdd(specs, MkSpecifier(INT64));
5392 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5396 ListAdd(specs, MkSpecifier(UNSIGNED));
5397 ListAdd(specs, MkSpecifier(INT));
5399 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5403 ListAdd(specs, MkSpecifier(UNSIGNED));
5404 ListAdd(specs, MkSpecifier(SHORT));
5406 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5410 ListAdd(specs, MkSpecifier(UNSIGNED));
5411 ListAdd(specs, MkSpecifier(CHAR));
5417 if(backupSourceExpType)
5419 if(sourceExp->expType)
5420 FreeType(sourceExp->expType);
5421 sourceExp->expType = backupSourceExpType;
5426 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))
5428 specs = MkListOne(MkSpecifier(DOUBLE));
5430 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5432 specs = MkListOne(MkSpecifier(FLOAT));
5434 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)))
5438 ListAdd(specs, MkSpecifier(UNSIGNED));
5439 ListAdd(specs, MkSpecifier(CHAR));
5441 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)))))
5445 ListAdd(specs, MkSpecifier(UNSIGNED));
5446 ListAdd(specs, MkSpecifier(SHORT));
5448 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5452 ListAdd(specs, MkSpecifier(UNSIGNED));
5453 ListAdd(specs, MkSpecifier(INT));
5455 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5459 ListAdd(specs, MkSpecifier(UNSIGNED));
5460 ListAdd(specs, MkSpecifier(INT64));
5462 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5464 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5470 if(backupSourceExpType)
5472 if(sourceExp->expType)
5473 FreeType(sourceExp->expType);
5474 sourceExp->expType = backupSourceExpType;
5480 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5482 *newExp = *sourceExp;
5483 newExp->prev = (((void *)0));
5484 newExp->next = (((void *)0));
5485 if(sourceExp->destType)
5486 sourceExp->destType->refCount++;
5487 if(sourceExp->expType)
5488 sourceExp->expType->refCount++;
5489 sourceExp->type = 11;
5490 if(realDest->kind == 8)
5492 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5493 FreeList(specs, FreeSpecifier);
5496 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5497 if(newExp->type == 4)
5499 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5502 sourceExp->cast.exp = newExp;
5503 FreeType(sourceExp->expType);
5504 sourceExp->expType = (((void *)0));
5505 ProcessExpressionType(sourceExp);
5508 FreeList(specs, FreeSpecifier);
5511 if(backupSourceExpType)
5512 FreeType(backupSourceExpType);
5517 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5518 sourceExp = (*sourceExp->list).last;
5519 if(sourceExp->type == 0)
5521 struct Identifier * id = sourceExp->identifier;
5525 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5527 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5528 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5532 for(; _class && _class->type == 4; _class = _class->base)
5534 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5535 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5537 for(value = e->values.first; value; value = value->next)
5539 if(!strcmp(value->name, id->string))
5544 FreeExpContents(sourceExp);
5545 FreeType(sourceExp->expType);
5546 sourceExp->isConstant = 0x1;
5547 sourceExp->expType = MkClassType(_class->fullName);
5551 sourceExp->type = 2;
5552 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5553 sprintf(constant, "%d", value->data);
5555 sprintf(constant, "0x%X", value->data);
5556 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5564 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5571 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5573 int value2 = op2->i;
5576 exp->string = PrintInt(op1->i + value2);
5579 exp->expType = op1->type;
5581 op1->type->refCount++;
5586 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5588 unsigned int value2 = op2->ui;
5591 exp->string = PrintUInt(op1->ui + value2);
5594 exp->expType = op1->type;
5596 op1->type->refCount++;
5601 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5603 short value2 = op2->s;
5606 exp->string = PrintShort(op1->s + value2);
5609 exp->expType = op1->type;
5611 op1->type->refCount++;
5616 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5618 unsigned short value2 = op2->us;
5621 exp->string = PrintUShort(op1->us + value2);
5624 exp->expType = op1->type;
5626 op1->type->refCount++;
5631 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5633 char value2 = op2->c;
5636 exp->string = PrintChar(op1->c + value2);
5639 exp->expType = op1->type;
5641 op1->type->refCount++;
5646 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5648 unsigned char value2 = op2->uc;
5651 exp->string = PrintUChar(op1->uc + value2);
5654 exp->expType = op1->type;
5656 op1->type->refCount++;
5661 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5663 float value2 = op2->f;
5666 exp->string = PrintFloat(op1->f + value2);
5669 exp->expType = op1->type;
5671 op1->type->refCount++;
5676 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5678 double value2 = op2->d;
5681 exp->string = PrintDouble(op1->d + value2);
5684 exp->expType = op1->type;
5686 op1->type->refCount++;
5691 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5693 int value2 = op2->i;
5696 exp->string = PrintInt(op1->i - value2);
5699 exp->expType = op1->type;
5701 op1->type->refCount++;
5706 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5708 unsigned int value2 = op2->ui;
5711 exp->string = PrintUInt(op1->ui - value2);
5714 exp->expType = op1->type;
5716 op1->type->refCount++;
5721 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5723 short value2 = op2->s;
5726 exp->string = PrintShort(op1->s - value2);
5729 exp->expType = op1->type;
5731 op1->type->refCount++;
5736 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5738 unsigned short value2 = op2->us;
5741 exp->string = PrintUShort(op1->us - value2);
5744 exp->expType = op1->type;
5746 op1->type->refCount++;
5751 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5753 char value2 = op2->c;
5756 exp->string = PrintChar(op1->c - value2);
5759 exp->expType = op1->type;
5761 op1->type->refCount++;
5766 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5768 unsigned char value2 = op2->uc;
5771 exp->string = PrintUChar(op1->uc - value2);
5774 exp->expType = op1->type;
5776 op1->type->refCount++;
5781 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5783 float value2 = op2->f;
5786 exp->string = PrintFloat(op1->f - value2);
5789 exp->expType = op1->type;
5791 op1->type->refCount++;
5796 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5798 double value2 = op2->d;
5801 exp->string = PrintDouble(op1->d - value2);
5804 exp->expType = op1->type;
5806 op1->type->refCount++;
5811 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5813 int value2 = op2->i;
5816 exp->string = PrintInt(op1->i * value2);
5819 exp->expType = op1->type;
5821 op1->type->refCount++;
5826 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5828 unsigned int value2 = op2->ui;
5831 exp->string = PrintUInt(op1->ui * value2);
5834 exp->expType = op1->type;
5836 op1->type->refCount++;
5841 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5843 short value2 = op2->s;
5846 exp->string = PrintShort(op1->s * value2);
5849 exp->expType = op1->type;
5851 op1->type->refCount++;
5856 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5858 unsigned short value2 = op2->us;
5861 exp->string = PrintUShort(op1->us * value2);
5864 exp->expType = op1->type;
5866 op1->type->refCount++;
5871 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5873 char value2 = op2->c;
5876 exp->string = PrintChar(op1->c * value2);
5879 exp->expType = op1->type;
5881 op1->type->refCount++;
5886 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5888 unsigned char value2 = op2->uc;
5891 exp->string = PrintUChar(op1->uc * value2);
5894 exp->expType = op1->type;
5896 op1->type->refCount++;
5901 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5903 float value2 = op2->f;
5906 exp->string = PrintFloat(op1->f * value2);
5909 exp->expType = op1->type;
5911 op1->type->refCount++;
5916 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5918 double value2 = op2->d;
5921 exp->string = PrintDouble(op1->d * value2);
5924 exp->expType = op1->type;
5926 op1->type->refCount++;
5931 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5933 int value2 = op2->i;
5936 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5939 exp->expType = op1->type;
5941 op1->type->refCount++;
5946 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5948 unsigned int value2 = op2->ui;
5951 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5954 exp->expType = op1->type;
5956 op1->type->refCount++;
5961 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5963 short value2 = op2->s;
5966 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
5969 exp->expType = op1->type;
5971 op1->type->refCount++;
5976 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5978 unsigned short value2 = op2->us;
5981 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
5984 exp->expType = op1->type;
5986 op1->type->refCount++;
5991 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5993 char value2 = op2->c;
5996 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
5999 exp->expType = op1->type;
6001 op1->type->refCount++;
6006 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6008 unsigned char value2 = op2->uc;
6011 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6014 exp->expType = op1->type;
6016 op1->type->refCount++;
6021 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6023 float value2 = op2->f;
6026 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
6029 exp->expType = op1->type;
6031 op1->type->refCount++;
6036 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6038 double value2 = op2->d;
6041 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
6044 exp->expType = op1->type;
6046 op1->type->refCount++;
6051 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6053 int value2 = op2->i;
6056 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6059 exp->expType = op1->type;
6061 op1->type->refCount++;
6066 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6068 unsigned int value2 = op2->ui;
6071 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6074 exp->expType = op1->type;
6076 op1->type->refCount++;
6081 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6083 short value2 = op2->s;
6086 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6089 exp->expType = op1->type;
6091 op1->type->refCount++;
6096 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6098 unsigned short value2 = op2->us;
6101 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6104 exp->expType = op1->type;
6106 op1->type->refCount++;
6111 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6113 char value2 = op2->c;
6116 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6119 exp->expType = op1->type;
6121 op1->type->refCount++;
6126 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6128 unsigned char value2 = op2->uc;
6131 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6134 exp->expType = op1->type;
6136 op1->type->refCount++;
6141 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6144 exp->string = PrintInt(-op1->i);
6147 exp->expType = op1->type;
6149 op1->type->refCount++;
6154 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6157 exp->string = PrintUInt(-op1->ui);
6160 exp->expType = op1->type;
6162 op1->type->refCount++;
6167 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6170 exp->string = PrintShort(-op1->s);
6173 exp->expType = op1->type;
6175 op1->type->refCount++;
6180 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6183 exp->string = PrintUShort(-op1->us);
6186 exp->expType = op1->type;
6188 op1->type->refCount++;
6193 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6196 exp->string = PrintChar(-op1->c);
6199 exp->expType = op1->type;
6201 op1->type->refCount++;
6206 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6209 exp->string = PrintUChar(-op1->uc);
6212 exp->expType = op1->type;
6214 op1->type->refCount++;
6219 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6222 exp->string = PrintFloat(-op1->f);
6225 exp->expType = op1->type;
6227 op1->type->refCount++;
6232 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6235 exp->string = PrintDouble(-op1->d);
6238 exp->expType = op1->type;
6240 op1->type->refCount++;
6245 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6248 exp->string = PrintInt(++op1->i);
6251 exp->expType = op1->type;
6253 op1->type->refCount++;
6258 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6261 exp->string = PrintUInt(++op1->ui);
6264 exp->expType = op1->type;
6266 op1->type->refCount++;
6271 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6274 exp->string = PrintShort(++op1->s);
6277 exp->expType = op1->type;
6279 op1->type->refCount++;
6284 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6287 exp->string = PrintUShort(++op1->us);
6290 exp->expType = op1->type;
6292 op1->type->refCount++;
6297 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6300 exp->string = PrintChar(++op1->c);
6303 exp->expType = op1->type;
6305 op1->type->refCount++;
6310 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6313 exp->string = PrintUChar(++op1->uc);
6316 exp->expType = op1->type;
6318 op1->type->refCount++;
6323 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6326 exp->string = PrintFloat(++op1->f);
6329 exp->expType = op1->type;
6331 op1->type->refCount++;
6336 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6339 exp->string = PrintDouble(++op1->d);
6342 exp->expType = op1->type;
6344 op1->type->refCount++;
6349 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6352 exp->string = PrintInt(--op1->i);
6355 exp->expType = op1->type;
6357 op1->type->refCount++;
6362 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6365 exp->string = PrintUInt(--op1->ui);
6368 exp->expType = op1->type;
6370 op1->type->refCount++;
6375 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6378 exp->string = PrintShort(--op1->s);
6381 exp->expType = op1->type;
6383 op1->type->refCount++;
6388 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6391 exp->string = PrintUShort(--op1->us);
6394 exp->expType = op1->type;
6396 op1->type->refCount++;
6401 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6404 exp->string = PrintChar(--op1->c);
6407 exp->expType = op1->type;
6409 op1->type->refCount++;
6414 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6417 exp->string = PrintUChar(--op1->uc);
6420 exp->expType = op1->type;
6422 op1->type->refCount++;
6427 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6430 exp->string = PrintFloat(--op1->f);
6433 exp->expType = op1->type;
6435 op1->type->refCount++;
6440 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6443 exp->string = PrintDouble(--op1->d);
6446 exp->expType = op1->type;
6448 op1->type->refCount++;
6453 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6455 int value2 = op2->i;
6458 exp->string = PrintInt(op1->i = value2);
6461 exp->expType = op1->type;
6463 op1->type->refCount++;
6468 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6470 unsigned int value2 = op2->ui;
6473 exp->string = PrintUInt(op1->ui = value2);
6476 exp->expType = op1->type;
6478 op1->type->refCount++;
6483 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6485 short value2 = op2->s;
6488 exp->string = PrintShort(op1->s = value2);
6491 exp->expType = op1->type;
6493 op1->type->refCount++;
6498 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6500 unsigned short value2 = op2->us;
6503 exp->string = PrintUShort(op1->us = value2);
6506 exp->expType = op1->type;
6508 op1->type->refCount++;
6513 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6515 char value2 = op2->c;
6518 exp->string = PrintChar(op1->c = value2);
6521 exp->expType = op1->type;
6523 op1->type->refCount++;
6528 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6530 unsigned char value2 = op2->uc;
6533 exp->string = PrintUChar(op1->uc = value2);
6536 exp->expType = op1->type;
6538 op1->type->refCount++;
6543 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6545 float value2 = op2->f;
6548 exp->string = PrintFloat(op1->f = value2);
6551 exp->expType = op1->type;
6553 op1->type->refCount++;
6558 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6560 double value2 = op2->d;
6563 exp->string = PrintDouble(op1->d = value2);
6566 exp->expType = op1->type;
6568 op1->type->refCount++;
6573 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6575 int value2 = op2->i;
6578 exp->string = PrintInt(op1->i += value2);
6581 exp->expType = op1->type;
6583 op1->type->refCount++;
6588 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6590 unsigned int value2 = op2->ui;
6593 exp->string = PrintUInt(op1->ui += value2);
6596 exp->expType = op1->type;
6598 op1->type->refCount++;
6603 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6605 short value2 = op2->s;
6608 exp->string = PrintShort(op1->s += value2);
6611 exp->expType = op1->type;
6613 op1->type->refCount++;
6618 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6620 unsigned short value2 = op2->us;
6623 exp->string = PrintUShort(op1->us += value2);
6626 exp->expType = op1->type;
6628 op1->type->refCount++;
6633 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6635 char value2 = op2->c;
6638 exp->string = PrintChar(op1->c += value2);
6641 exp->expType = op1->type;
6643 op1->type->refCount++;
6648 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6650 unsigned char value2 = op2->uc;
6653 exp->string = PrintUChar(op1->uc += value2);
6656 exp->expType = op1->type;
6658 op1->type->refCount++;
6663 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6665 float value2 = op2->f;
6668 exp->string = PrintFloat(op1->f += value2);
6671 exp->expType = op1->type;
6673 op1->type->refCount++;
6678 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6680 double value2 = op2->d;
6683 exp->string = PrintDouble(op1->d += value2);
6686 exp->expType = op1->type;
6688 op1->type->refCount++;
6693 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6695 int value2 = op2->i;
6698 exp->string = PrintInt(op1->i -= value2);
6701 exp->expType = op1->type;
6703 op1->type->refCount++;
6708 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6710 unsigned int value2 = op2->ui;
6713 exp->string = PrintUInt(op1->ui -= value2);
6716 exp->expType = op1->type;
6718 op1->type->refCount++;
6723 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6725 short value2 = op2->s;
6728 exp->string = PrintShort(op1->s -= value2);
6731 exp->expType = op1->type;
6733 op1->type->refCount++;
6738 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6740 unsigned short value2 = op2->us;
6743 exp->string = PrintUShort(op1->us -= value2);
6746 exp->expType = op1->type;
6748 op1->type->refCount++;
6753 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6755 char value2 = op2->c;
6758 exp->string = PrintChar(op1->c -= value2);
6761 exp->expType = op1->type;
6763 op1->type->refCount++;
6768 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6770 unsigned char value2 = op2->uc;
6773 exp->string = PrintUChar(op1->uc -= value2);
6776 exp->expType = op1->type;
6778 op1->type->refCount++;
6783 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6785 float value2 = op2->f;
6788 exp->string = PrintFloat(op1->f -= value2);
6791 exp->expType = op1->type;
6793 op1->type->refCount++;
6798 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6800 double value2 = op2->d;
6803 exp->string = PrintDouble(op1->d -= value2);
6806 exp->expType = op1->type;
6808 op1->type->refCount++;
6813 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6815 int value2 = op2->i;
6818 exp->string = PrintInt(op1->i *= value2);
6821 exp->expType = op1->type;
6823 op1->type->refCount++;
6828 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6830 unsigned int value2 = op2->ui;
6833 exp->string = PrintUInt(op1->ui *= value2);
6836 exp->expType = op1->type;
6838 op1->type->refCount++;
6843 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6845 short value2 = op2->s;
6848 exp->string = PrintShort(op1->s *= value2);
6851 exp->expType = op1->type;
6853 op1->type->refCount++;
6858 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6860 unsigned short value2 = op2->us;
6863 exp->string = PrintUShort(op1->us *= value2);
6866 exp->expType = op1->type;
6868 op1->type->refCount++;
6873 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6875 char value2 = op2->c;
6878 exp->string = PrintChar(op1->c *= value2);
6881 exp->expType = op1->type;
6883 op1->type->refCount++;
6888 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6890 unsigned char value2 = op2->uc;
6893 exp->string = PrintUChar(op1->uc *= value2);
6896 exp->expType = op1->type;
6898 op1->type->refCount++;
6903 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6905 float value2 = op2->f;
6908 exp->string = PrintFloat(op1->f *= value2);
6911 exp->expType = op1->type;
6913 op1->type->refCount++;
6918 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6920 double value2 = op2->d;
6923 exp->string = PrintDouble(op1->d *= value2);
6926 exp->expType = op1->type;
6928 op1->type->refCount++;
6933 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6935 int value2 = op2->i;
6938 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6941 exp->expType = op1->type;
6943 op1->type->refCount++;
6948 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6950 unsigned int value2 = op2->ui;
6953 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6956 exp->expType = op1->type;
6958 op1->type->refCount++;
6963 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6965 short value2 = op2->s;
6968 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
6971 exp->expType = op1->type;
6973 op1->type->refCount++;
6978 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6980 unsigned short value2 = op2->us;
6983 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
6986 exp->expType = op1->type;
6988 op1->type->refCount++;
6993 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6995 char value2 = op2->c;
6998 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7001 exp->expType = op1->type;
7003 op1->type->refCount++;
7008 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7010 unsigned char value2 = op2->uc;
7013 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7016 exp->expType = op1->type;
7018 op1->type->refCount++;
7023 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7025 float value2 = op2->f;
7028 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
7031 exp->expType = op1->type;
7033 op1->type->refCount++;
7038 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7040 double value2 = op2->d;
7043 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
7046 exp->expType = op1->type;
7048 op1->type->refCount++;
7053 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7055 int value2 = op2->i;
7058 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7061 exp->expType = op1->type;
7063 op1->type->refCount++;
7068 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7070 unsigned int value2 = op2->ui;
7073 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7076 exp->expType = op1->type;
7078 op1->type->refCount++;
7083 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7085 short value2 = op2->s;
7088 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7091 exp->expType = op1->type;
7093 op1->type->refCount++;
7098 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7100 unsigned short value2 = op2->us;
7103 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7106 exp->expType = op1->type;
7108 op1->type->refCount++;
7113 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7115 char value2 = op2->c;
7118 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7121 exp->expType = op1->type;
7123 op1->type->refCount++;
7128 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7130 unsigned char value2 = op2->uc;
7133 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7136 exp->expType = op1->type;
7138 op1->type->refCount++;
7143 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7145 int value2 = op2->i;
7148 exp->string = PrintInt(op1->i & value2);
7151 exp->expType = op1->type;
7153 op1->type->refCount++;
7158 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7160 unsigned int value2 = op2->ui;
7163 exp->string = PrintUInt(op1->ui & value2);
7166 exp->expType = op1->type;
7168 op1->type->refCount++;
7173 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7175 short value2 = op2->s;
7178 exp->string = PrintShort(op1->s & value2);
7181 exp->expType = op1->type;
7183 op1->type->refCount++;
7188 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7190 unsigned short value2 = op2->us;
7193 exp->string = PrintUShort(op1->us & value2);
7196 exp->expType = op1->type;
7198 op1->type->refCount++;
7203 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7205 char value2 = op2->c;
7208 exp->string = PrintChar(op1->c & value2);
7211 exp->expType = op1->type;
7213 op1->type->refCount++;
7218 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7220 unsigned char value2 = op2->uc;
7223 exp->string = PrintUChar(op1->uc & value2);
7226 exp->expType = op1->type;
7228 op1->type->refCount++;
7233 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7235 int value2 = op2->i;
7238 exp->string = PrintInt(op1->i | value2);
7241 exp->expType = op1->type;
7243 op1->type->refCount++;
7248 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7250 unsigned int value2 = op2->ui;
7253 exp->string = PrintUInt(op1->ui | value2);
7256 exp->expType = op1->type;
7258 op1->type->refCount++;
7263 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7265 short value2 = op2->s;
7268 exp->string = PrintShort(op1->s | value2);
7271 exp->expType = op1->type;
7273 op1->type->refCount++;
7278 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7280 unsigned short value2 = op2->us;
7283 exp->string = PrintUShort(op1->us | value2);
7286 exp->expType = op1->type;
7288 op1->type->refCount++;
7293 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7295 char value2 = op2->c;
7298 exp->string = PrintChar(op1->c | value2);
7301 exp->expType = op1->type;
7303 op1->type->refCount++;
7308 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7310 unsigned char value2 = op2->uc;
7313 exp->string = PrintUChar(op1->uc | value2);
7316 exp->expType = op1->type;
7318 op1->type->refCount++;
7323 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7325 int value2 = op2->i;
7328 exp->string = PrintInt(op1->i ^ value2);
7331 exp->expType = op1->type;
7333 op1->type->refCount++;
7338 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7340 unsigned int value2 = op2->ui;
7343 exp->string = PrintUInt(op1->ui ^ value2);
7346 exp->expType = op1->type;
7348 op1->type->refCount++;
7353 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7355 short value2 = op2->s;
7358 exp->string = PrintShort(op1->s ^ value2);
7361 exp->expType = op1->type;
7363 op1->type->refCount++;
7368 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7370 unsigned short value2 = op2->us;
7373 exp->string = PrintUShort(op1->us ^ value2);
7376 exp->expType = op1->type;
7378 op1->type->refCount++;
7383 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7385 char value2 = op2->c;
7388 exp->string = PrintChar(op1->c ^ value2);
7391 exp->expType = op1->type;
7393 op1->type->refCount++;
7398 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7400 unsigned char value2 = op2->uc;
7403 exp->string = PrintUChar(op1->uc ^ value2);
7406 exp->expType = op1->type;
7408 op1->type->refCount++;
7413 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7415 int value2 = op2->i;
7418 exp->string = PrintInt(op1->i << value2);
7421 exp->expType = op1->type;
7423 op1->type->refCount++;
7428 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7430 unsigned int value2 = op2->ui;
7433 exp->string = PrintUInt(op1->ui << value2);
7436 exp->expType = op1->type;
7438 op1->type->refCount++;
7443 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7445 short value2 = op2->s;
7448 exp->string = PrintShort(op1->s << value2);
7451 exp->expType = op1->type;
7453 op1->type->refCount++;
7458 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7460 unsigned short value2 = op2->us;
7463 exp->string = PrintUShort(op1->us << value2);
7466 exp->expType = op1->type;
7468 op1->type->refCount++;
7473 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7475 char value2 = op2->c;
7478 exp->string = PrintChar(op1->c << value2);
7481 exp->expType = op1->type;
7483 op1->type->refCount++;
7488 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7490 unsigned char value2 = op2->uc;
7493 exp->string = PrintUChar(op1->uc << value2);
7496 exp->expType = op1->type;
7498 op1->type->refCount++;
7503 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7505 int value2 = op2->i;
7508 exp->string = PrintInt(op1->i >> value2);
7511 exp->expType = op1->type;
7513 op1->type->refCount++;
7518 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7520 unsigned int value2 = op2->ui;
7523 exp->string = PrintUInt(op1->ui >> value2);
7526 exp->expType = op1->type;
7528 op1->type->refCount++;
7533 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7535 short value2 = op2->s;
7538 exp->string = PrintShort(op1->s >> value2);
7541 exp->expType = op1->type;
7543 op1->type->refCount++;
7548 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7550 unsigned short value2 = op2->us;
7553 exp->string = PrintUShort(op1->us >> value2);
7556 exp->expType = op1->type;
7558 op1->type->refCount++;
7563 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7565 char value2 = op2->c;
7568 exp->string = PrintChar(op1->c >> value2);
7571 exp->expType = op1->type;
7573 op1->type->refCount++;
7578 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7580 unsigned char value2 = op2->uc;
7583 exp->string = PrintUChar(op1->uc >> value2);
7586 exp->expType = op1->type;
7588 op1->type->refCount++;
7593 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7596 exp->string = PrintInt(~op1->i);
7599 exp->expType = op1->type;
7601 op1->type->refCount++;
7606 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7609 exp->string = PrintUInt(~op1->ui);
7612 exp->expType = op1->type;
7614 op1->type->refCount++;
7619 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7622 exp->string = PrintShort(~op1->s);
7625 exp->expType = op1->type;
7627 op1->type->refCount++;
7632 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7635 exp->string = PrintUShort(~op1->us);
7638 exp->expType = op1->type;
7640 op1->type->refCount++;
7645 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7648 exp->string = PrintChar(~op1->c);
7651 exp->expType = op1->type;
7653 op1->type->refCount++;
7658 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7661 exp->string = PrintUChar(~op1->uc);
7664 exp->expType = op1->type;
7666 op1->type->refCount++;
7671 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7673 int value2 = op2->i;
7676 exp->string = PrintInt(op1->i &= value2);
7679 exp->expType = op1->type;
7681 op1->type->refCount++;
7686 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7688 unsigned int value2 = op2->ui;
7691 exp->string = PrintUInt(op1->ui &= value2);
7694 exp->expType = op1->type;
7696 op1->type->refCount++;
7701 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7703 short value2 = op2->s;
7706 exp->string = PrintShort(op1->s &= value2);
7709 exp->expType = op1->type;
7711 op1->type->refCount++;
7716 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7718 unsigned short value2 = op2->us;
7721 exp->string = PrintUShort(op1->us &= value2);
7724 exp->expType = op1->type;
7726 op1->type->refCount++;
7731 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7733 char value2 = op2->c;
7736 exp->string = PrintChar(op1->c &= value2);
7739 exp->expType = op1->type;
7741 op1->type->refCount++;
7746 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7748 unsigned char value2 = op2->uc;
7751 exp->string = PrintUChar(op1->uc &= value2);
7754 exp->expType = op1->type;
7756 op1->type->refCount++;
7761 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7763 int value2 = op2->i;
7766 exp->string = PrintInt(op1->i |= value2);
7769 exp->expType = op1->type;
7771 op1->type->refCount++;
7776 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7778 unsigned int value2 = op2->ui;
7781 exp->string = PrintUInt(op1->ui |= value2);
7784 exp->expType = op1->type;
7786 op1->type->refCount++;
7791 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7793 short value2 = op2->s;
7796 exp->string = PrintShort(op1->s |= value2);
7799 exp->expType = op1->type;
7801 op1->type->refCount++;
7806 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7808 unsigned short value2 = op2->us;
7811 exp->string = PrintUShort(op1->us |= value2);
7814 exp->expType = op1->type;
7816 op1->type->refCount++;
7821 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7823 char value2 = op2->c;
7826 exp->string = PrintChar(op1->c |= value2);
7829 exp->expType = op1->type;
7831 op1->type->refCount++;
7836 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7838 unsigned char value2 = op2->uc;
7841 exp->string = PrintUChar(op1->uc |= value2);
7844 exp->expType = op1->type;
7846 op1->type->refCount++;
7851 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7853 int value2 = op2->i;
7856 exp->string = PrintInt(op1->i ^= value2);
7859 exp->expType = op1->type;
7861 op1->type->refCount++;
7866 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7868 unsigned int value2 = op2->ui;
7871 exp->string = PrintUInt(op1->ui ^= value2);
7874 exp->expType = op1->type;
7876 op1->type->refCount++;
7881 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7883 short value2 = op2->s;
7886 exp->string = PrintShort(op1->s ^= value2);
7889 exp->expType = op1->type;
7891 op1->type->refCount++;
7896 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7898 unsigned short value2 = op2->us;
7901 exp->string = PrintUShort(op1->us ^= value2);
7904 exp->expType = op1->type;
7906 op1->type->refCount++;
7911 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7913 char value2 = op2->c;
7916 exp->string = PrintChar(op1->c ^= value2);
7919 exp->expType = op1->type;
7921 op1->type->refCount++;
7926 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7928 unsigned char value2 = op2->uc;
7931 exp->string = PrintUChar(op1->uc ^= value2);
7934 exp->expType = op1->type;
7936 op1->type->refCount++;
7941 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7943 int value2 = op2->i;
7946 exp->string = PrintInt(op1->i <<= value2);
7949 exp->expType = op1->type;
7951 op1->type->refCount++;
7956 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7958 unsigned int value2 = op2->ui;
7961 exp->string = PrintUInt(op1->ui <<= value2);
7964 exp->expType = op1->type;
7966 op1->type->refCount++;
7971 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7973 short value2 = op2->s;
7976 exp->string = PrintShort(op1->s <<= value2);
7979 exp->expType = op1->type;
7981 op1->type->refCount++;
7986 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7988 unsigned short value2 = op2->us;
7991 exp->string = PrintUShort(op1->us <<= value2);
7994 exp->expType = op1->type;
7996 op1->type->refCount++;
8001 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8003 char value2 = op2->c;
8006 exp->string = PrintChar(op1->c <<= value2);
8009 exp->expType = op1->type;
8011 op1->type->refCount++;
8016 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8018 unsigned char value2 = op2->uc;
8021 exp->string = PrintUChar(op1->uc <<= value2);
8024 exp->expType = op1->type;
8026 op1->type->refCount++;
8031 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8033 int value2 = op2->i;
8036 exp->string = PrintInt(op1->i >>= value2);
8039 exp->expType = op1->type;
8041 op1->type->refCount++;
8046 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8048 unsigned int value2 = op2->ui;
8051 exp->string = PrintUInt(op1->ui >>= value2);
8054 exp->expType = op1->type;
8056 op1->type->refCount++;
8061 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8063 short value2 = op2->s;
8066 exp->string = PrintShort(op1->s >>= value2);
8069 exp->expType = op1->type;
8071 op1->type->refCount++;
8076 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8078 unsigned short value2 = op2->us;
8081 exp->string = PrintUShort(op1->us >>= value2);
8084 exp->expType = op1->type;
8086 op1->type->refCount++;
8091 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8093 char value2 = op2->c;
8096 exp->string = PrintChar(op1->c >>= value2);
8099 exp->expType = op1->type;
8101 op1->type->refCount++;
8106 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8108 unsigned char value2 = op2->uc;
8111 exp->string = PrintUChar(op1->uc >>= value2);
8114 exp->expType = op1->type;
8116 op1->type->refCount++;
8121 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8124 exp->string = PrintInt(!op1->i);
8127 exp->expType = op1->type;
8129 op1->type->refCount++;
8134 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8137 exp->string = PrintUInt(!op1->ui);
8140 exp->expType = op1->type;
8142 op1->type->refCount++;
8147 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8150 exp->string = PrintShort(!op1->s);
8153 exp->expType = op1->type;
8155 op1->type->refCount++;
8160 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8163 exp->string = PrintUShort(!op1->us);
8166 exp->expType = op1->type;
8168 op1->type->refCount++;
8173 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8176 exp->string = PrintChar(!op1->c);
8179 exp->expType = op1->type;
8181 op1->type->refCount++;
8186 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8189 exp->string = PrintUChar(!op1->uc);
8192 exp->expType = op1->type;
8194 op1->type->refCount++;
8199 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8201 int value2 = op2->i;
8204 exp->string = PrintInt(op1->i == value2);
8207 exp->expType = op1->type;
8209 op1->type->refCount++;
8214 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8216 unsigned int value2 = op2->ui;
8219 exp->string = PrintUInt(op1->ui == value2);
8222 exp->expType = op1->type;
8224 op1->type->refCount++;
8229 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8231 short value2 = op2->s;
8234 exp->string = PrintShort(op1->s == value2);
8237 exp->expType = op1->type;
8239 op1->type->refCount++;
8244 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8246 unsigned short value2 = op2->us;
8249 exp->string = PrintUShort(op1->us == value2);
8252 exp->expType = op1->type;
8254 op1->type->refCount++;
8259 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8261 char value2 = op2->c;
8264 exp->string = PrintChar(op1->c == value2);
8267 exp->expType = op1->type;
8269 op1->type->refCount++;
8274 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8276 unsigned char value2 = op2->uc;
8279 exp->string = PrintUChar(op1->uc == value2);
8282 exp->expType = op1->type;
8284 op1->type->refCount++;
8289 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8291 float value2 = op2->f;
8294 exp->string = PrintFloat(op1->f == value2);
8297 exp->expType = op1->type;
8299 op1->type->refCount++;
8304 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8306 double value2 = op2->d;
8309 exp->string = PrintDouble(op1->d == value2);
8312 exp->expType = op1->type;
8314 op1->type->refCount++;
8319 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8321 int value2 = op2->i;
8324 exp->string = PrintInt(op1->i != value2);
8327 exp->expType = op1->type;
8329 op1->type->refCount++;
8334 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8336 unsigned int value2 = op2->ui;
8339 exp->string = PrintUInt(op1->ui != value2);
8342 exp->expType = op1->type;
8344 op1->type->refCount++;
8349 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8351 short value2 = op2->s;
8354 exp->string = PrintShort(op1->s != value2);
8357 exp->expType = op1->type;
8359 op1->type->refCount++;
8364 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8366 unsigned short value2 = op2->us;
8369 exp->string = PrintUShort(op1->us != value2);
8372 exp->expType = op1->type;
8374 op1->type->refCount++;
8379 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8381 char value2 = op2->c;
8384 exp->string = PrintChar(op1->c != value2);
8387 exp->expType = op1->type;
8389 op1->type->refCount++;
8394 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8396 unsigned char value2 = op2->uc;
8399 exp->string = PrintUChar(op1->uc != value2);
8402 exp->expType = op1->type;
8404 op1->type->refCount++;
8409 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8411 float value2 = op2->f;
8414 exp->string = PrintFloat(op1->f != value2);
8417 exp->expType = op1->type;
8419 op1->type->refCount++;
8424 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8426 double value2 = op2->d;
8429 exp->string = PrintDouble(op1->d != value2);
8432 exp->expType = op1->type;
8434 op1->type->refCount++;
8439 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8441 int value2 = op2->i;
8444 exp->string = PrintInt(op1->i && value2);
8447 exp->expType = op1->type;
8449 op1->type->refCount++;
8454 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8456 unsigned int value2 = op2->ui;
8459 exp->string = PrintUInt(op1->ui && value2);
8462 exp->expType = op1->type;
8464 op1->type->refCount++;
8469 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8471 short value2 = op2->s;
8474 exp->string = PrintShort(op1->s && value2);
8477 exp->expType = op1->type;
8479 op1->type->refCount++;
8484 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8486 unsigned short value2 = op2->us;
8489 exp->string = PrintUShort(op1->us && value2);
8492 exp->expType = op1->type;
8494 op1->type->refCount++;
8499 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8501 char value2 = op2->c;
8504 exp->string = PrintChar(op1->c && value2);
8507 exp->expType = op1->type;
8509 op1->type->refCount++;
8514 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8516 unsigned char value2 = op2->uc;
8519 exp->string = PrintUChar(op1->uc && value2);
8522 exp->expType = op1->type;
8524 op1->type->refCount++;
8529 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8531 float value2 = op2->f;
8534 exp->string = PrintFloat(op1->f && value2);
8537 exp->expType = op1->type;
8539 op1->type->refCount++;
8544 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8546 double value2 = op2->d;
8549 exp->string = PrintDouble(op1->d && value2);
8552 exp->expType = op1->type;
8554 op1->type->refCount++;
8559 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8561 int value2 = op2->i;
8564 exp->string = PrintInt(op1->i || value2);
8567 exp->expType = op1->type;
8569 op1->type->refCount++;
8574 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8576 unsigned int value2 = op2->ui;
8579 exp->string = PrintUInt(op1->ui || value2);
8582 exp->expType = op1->type;
8584 op1->type->refCount++;
8589 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8591 short value2 = op2->s;
8594 exp->string = PrintShort(op1->s || value2);
8597 exp->expType = op1->type;
8599 op1->type->refCount++;
8604 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8606 unsigned short value2 = op2->us;
8609 exp->string = PrintUShort(op1->us || value2);
8612 exp->expType = op1->type;
8614 op1->type->refCount++;
8619 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8621 char value2 = op2->c;
8624 exp->string = PrintChar(op1->c || value2);
8627 exp->expType = op1->type;
8629 op1->type->refCount++;
8634 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8636 unsigned char value2 = op2->uc;
8639 exp->string = PrintUChar(op1->uc || value2);
8642 exp->expType = op1->type;
8644 op1->type->refCount++;
8649 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8651 float value2 = op2->f;
8654 exp->string = PrintFloat(op1->f || value2);
8657 exp->expType = op1->type;
8659 op1->type->refCount++;
8664 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8666 double value2 = op2->d;
8669 exp->string = PrintDouble(op1->d || value2);
8672 exp->expType = op1->type;
8674 op1->type->refCount++;
8679 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8681 int value2 = op2->i;
8684 exp->string = PrintInt(op1->i > value2);
8687 exp->expType = op1->type;
8689 op1->type->refCount++;
8694 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8696 unsigned int value2 = op2->ui;
8699 exp->string = PrintUInt(op1->ui > value2);
8702 exp->expType = op1->type;
8704 op1->type->refCount++;
8709 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8711 short value2 = op2->s;
8714 exp->string = PrintShort(op1->s > value2);
8717 exp->expType = op1->type;
8719 op1->type->refCount++;
8724 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8726 unsigned short value2 = op2->us;
8729 exp->string = PrintUShort(op1->us > value2);
8732 exp->expType = op1->type;
8734 op1->type->refCount++;
8739 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8741 char value2 = op2->c;
8744 exp->string = PrintChar(op1->c > value2);
8747 exp->expType = op1->type;
8749 op1->type->refCount++;
8754 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8756 unsigned char value2 = op2->uc;
8759 exp->string = PrintUChar(op1->uc > value2);
8762 exp->expType = op1->type;
8764 op1->type->refCount++;
8769 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8771 float value2 = op2->f;
8774 exp->string = PrintFloat(op1->f > value2);
8777 exp->expType = op1->type;
8779 op1->type->refCount++;
8784 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8786 double value2 = op2->d;
8789 exp->string = PrintDouble(op1->d > value2);
8792 exp->expType = op1->type;
8794 op1->type->refCount++;
8799 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8801 int value2 = op2->i;
8804 exp->string = PrintInt(op1->i < value2);
8807 exp->expType = op1->type;
8809 op1->type->refCount++;
8814 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8816 unsigned int value2 = op2->ui;
8819 exp->string = PrintUInt(op1->ui < value2);
8822 exp->expType = op1->type;
8824 op1->type->refCount++;
8829 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8831 short value2 = op2->s;
8834 exp->string = PrintShort(op1->s < value2);
8837 exp->expType = op1->type;
8839 op1->type->refCount++;
8844 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8846 unsigned short value2 = op2->us;
8849 exp->string = PrintUShort(op1->us < value2);
8852 exp->expType = op1->type;
8854 op1->type->refCount++;
8859 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8861 char value2 = op2->c;
8864 exp->string = PrintChar(op1->c < value2);
8867 exp->expType = op1->type;
8869 op1->type->refCount++;
8874 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8876 unsigned char value2 = op2->uc;
8879 exp->string = PrintUChar(op1->uc < value2);
8882 exp->expType = op1->type;
8884 op1->type->refCount++;
8889 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8891 float value2 = op2->f;
8894 exp->string = PrintFloat(op1->f < value2);
8897 exp->expType = op1->type;
8899 op1->type->refCount++;
8904 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8906 double value2 = op2->d;
8909 exp->string = PrintDouble(op1->d < value2);
8912 exp->expType = op1->type;
8914 op1->type->refCount++;
8919 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8921 int value2 = op2->i;
8924 exp->string = PrintInt(op1->i >= value2);
8927 exp->expType = op1->type;
8929 op1->type->refCount++;
8934 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8936 unsigned int value2 = op2->ui;
8939 exp->string = PrintUInt(op1->ui >= value2);
8942 exp->expType = op1->type;
8944 op1->type->refCount++;
8949 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8951 short value2 = op2->s;
8954 exp->string = PrintShort(op1->s >= value2);
8957 exp->expType = op1->type;
8959 op1->type->refCount++;
8964 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8966 unsigned short value2 = op2->us;
8969 exp->string = PrintUShort(op1->us >= value2);
8972 exp->expType = op1->type;
8974 op1->type->refCount++;
8979 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8981 char value2 = op2->c;
8984 exp->string = PrintChar(op1->c >= value2);
8987 exp->expType = op1->type;
8989 op1->type->refCount++;
8994 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8996 unsigned char value2 = op2->uc;
8999 exp->string = PrintUChar(op1->uc >= value2);
9002 exp->expType = op1->type;
9004 op1->type->refCount++;
9009 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9011 float value2 = op2->f;
9014 exp->string = PrintFloat(op1->f >= value2);
9017 exp->expType = op1->type;
9019 op1->type->refCount++;
9024 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9026 double value2 = op2->d;
9029 exp->string = PrintDouble(op1->d >= value2);
9032 exp->expType = op1->type;
9034 op1->type->refCount++;
9039 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9041 int value2 = op2->i;
9044 exp->string = PrintInt(op1->i <= value2);
9047 exp->expType = op1->type;
9049 op1->type->refCount++;
9054 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9056 unsigned int value2 = op2->ui;
9059 exp->string = PrintUInt(op1->ui <= value2);
9062 exp->expType = op1->type;
9064 op1->type->refCount++;
9069 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9071 short value2 = op2->s;
9074 exp->string = PrintShort(op1->s <= value2);
9077 exp->expType = op1->type;
9079 op1->type->refCount++;
9084 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9086 unsigned short value2 = op2->us;
9089 exp->string = PrintUShort(op1->us <= value2);
9092 exp->expType = op1->type;
9094 op1->type->refCount++;
9099 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9101 char value2 = op2->c;
9104 exp->string = PrintChar(op1->c <= value2);
9107 exp->expType = op1->type;
9109 op1->type->refCount++;
9114 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9116 unsigned char value2 = op2->uc;
9119 exp->string = PrintUChar(op1->uc <= value2);
9122 exp->expType = op1->type;
9124 op1->type->refCount++;
9129 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9131 float value2 = op2->f;
9134 exp->string = PrintFloat(op1->f <= value2);
9137 exp->expType = op1->type;
9139 op1->type->refCount++;
9144 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9146 double value2 = op2->d;
9149 exp->string = PrintDouble(op1->d <= value2);
9152 exp->expType = op1->type;
9154 op1->type->refCount++;
9159 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9162 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9165 exp->expType = op1->type;
9167 op1->type->refCount++;
9172 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9175 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9178 exp->expType = op1->type;
9180 op1->type->refCount++;
9185 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9188 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9191 exp->expType = op1->type;
9193 op1->type->refCount++;
9198 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9201 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9204 exp->expType = op1->type;
9206 op1->type->refCount++;
9211 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9214 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9217 exp->expType = op1->type;
9219 op1->type->refCount++;
9224 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9227 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9230 exp->expType = op1->type;
9232 op1->type->refCount++;
9237 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9240 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9243 exp->expType = op1->type;
9245 op1->type->refCount++;
9250 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9253 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9256 exp->expType = op1->type;
9258 op1->type->refCount++;
9263 struct OpTable intOps =
9265 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
9268 struct OpTable uintOps =
9270 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
9273 struct OpTable shortOps =
9275 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
9278 struct OpTable ushortOps =
9280 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
9283 struct OpTable floatOps =
9285 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
9288 struct OpTable doubleOps =
9290 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
9293 struct OpTable charOps =
9295 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
9298 struct OpTable ucharOps =
9300 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
9303 void ReadString(char * output, char * string)
9305 int len = strlen(string);
9307 unsigned int quoted = 0x0, escaped = 0x0;
9309 for(c = 0; c < len; c++)
9311 char ch = string[c];
9367 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9369 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9371 extern double strtod(char * , char * * );
9373 struct Operand GetOperand(struct Expression * exp)
9379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9382 struct Type * type = exp->expType;
9386 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9388 if(!type->_class->registered->dataType)
9389 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9390 type = type->_class->registered->dataType;
9392 op.kind = type->kind;
9393 op.type = exp->expType;
9394 if(exp->isConstant && exp->type == 2)
9400 if(exp->constant[0] == '\'')
9401 op.c = exp->constant[1];
9402 else if(type->isSigned)
9404 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9409 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9417 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9422 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9430 op.i = strtol(exp->constant, (((void *)0)), 0);
9435 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9443 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9448 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9456 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9461 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9469 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9474 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9480 op.f = (float)strtod(exp->constant, (((void *)0)));
9484 op.d = (double)strtod(exp->constant, (((void *)0)));
9490 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9500 int __ecereVMethodID_class_OnGetString;
9502 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9504 static void UnusedFunction()
9508 ((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);
9511 extern int __ecereVMethodID_class_OnGetString;
9513 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9515 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9517 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9519 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9520 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9523 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9524 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9526 void * ptr = inst->data + dataMember->offset + offset;
9527 char * result = (((void *)0));
9529 exp->loc = member->loc = inst->loc;
9530 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9531 if(!dataMember->dataType)
9532 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9533 type = dataMember->dataType;
9536 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9538 if(_class->type == 4)
9540 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9544 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9545 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9547 for(item = e->values.first; item; item = item->next)
9549 if((int)item->data == *(int *)ptr)
9551 result = item->name;
9557 exp->identifier = MkIdentifier(result);
9559 exp->destType = MkClassType(_class->fullName);
9560 ProcessExpressionType(exp);
9564 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9566 if(!_class->dataType)
9567 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9568 type = _class->dataType;
9577 FreeExpContents(exp);
9578 exp->constant = PrintFloat(*(float *)ptr);
9584 FreeExpContents(exp);
9585 exp->constant = PrintDouble(*(double *)ptr);
9591 FreeExpContents(exp);
9592 exp->constant = PrintInt(*(int *)ptr);
9598 FreeExpContents(exp);
9599 exp->constant = PrintInt64(*(long long *)ptr);
9605 FreeExpContents(exp);
9606 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9612 FreeExpContents(exp);
9613 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9618 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9621 ListAdd(memberList, member);
9623 if(parentDataMember->type == 1)
9628 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9630 void PopulateInstance(struct Instantiation * inst)
9632 struct Symbol * classSym = inst->_class->symbol;
9633 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9634 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9635 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9637 inst->members = MkListOne(MkMembersInitList(memberList));
9638 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9640 if(!dataMember->isProperty)
9642 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9643 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9646 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9647 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9649 void * ptr = inst->data + dataMember->offset;
9650 char * result = (((void *)0));
9652 exp->loc = member->loc = inst->loc;
9653 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9654 if(!dataMember->dataType)
9655 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9656 type = dataMember->dataType;
9659 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9661 if(_class->type == 4)
9663 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9667 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9668 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9670 for(item = e->values.first; item; item = item->next)
9672 if((int)item->data == *(int *)ptr)
9674 result = item->name;
9681 exp->identifier = MkIdentifier(result);
9683 exp->destType = MkClassType(_class->fullName);
9684 ProcessExpressionType(exp);
9687 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9689 if(!_class->dataType)
9690 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9691 type = _class->dataType;
9700 exp->constant = PrintFloat(*(float *)ptr);
9706 exp->constant = PrintDouble(*(double *)ptr);
9712 exp->constant = PrintInt(*(int *)ptr);
9718 exp->constant = PrintInt64(*(long long *)ptr);
9724 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9729 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9732 ListAdd(memberList, member);
9738 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);
9740 extern void FreeInstance(struct Instantiation * inst);
9742 void ComputeInstantiation(struct Expression * exp)
9744 struct Instantiation * inst = exp->instance;
9745 struct MembersInit * members;
9746 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9747 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9748 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9749 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9750 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9751 int subMemberStackPos = 0;
9754 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9758 if(_class->type == 0 || _class->type == 5)
9759 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9761 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9765 for(members = (*inst->members).first; members; members = members->next)
9767 switch(members->type)
9771 if(members->dataMembers)
9773 struct MemberInit * member;
9775 for(member = (*members->dataMembers).first; member; member = member->next)
9777 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9778 unsigned int found = 0x0;
9779 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9780 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9781 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9782 unsigned int dataMemberOffset;
9786 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9789 if(curMember->isProperty)
9790 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9793 dataMember = curMember;
9794 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9801 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9805 if(prop->memberAccess == 1)
9807 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9808 curClass = prop->_class;
9813 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9814 int _subMemberStackPos = 0;
9816 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9820 if(dataMember->memberAccess == 1)
9822 curMember = dataMember;
9823 curClass = dataMember->_class;
9824 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9825 subMemberStackPos = _subMemberStackPos;
9830 if(found && member->initializer && member->initializer->type == 0)
9832 struct Expression * value = member->initializer->exp;
9833 struct Type * type = (((void *)0));
9837 type = prop->dataType;
9841 if(!dataMember->dataType)
9842 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9843 type = dataMember->dataType;
9845 if(ident && ident->next)
9847 for(ident = ident->next; ident && type; ident = ident->next)
9851 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9853 type = prop->dataType;
9856 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9858 type = dataMember->dataType;
9861 else if(type->kind == 9 || type->kind == 10)
9863 struct Type * memberType;
9865 for(memberType = type->members.first; memberType; memberType = memberType->next)
9867 if(!strcmp(memberType->name, ident->string))
9878 FreeType(value->destType);
9879 value->destType = type;
9882 ComputeExpression(value);
9884 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9888 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9890 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9892 if(!_class->dataType)
9893 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9894 type = _class->dataType;
9899 void * ptr = inst->data + dataMemberOffset;
9901 if(value->type == 2)
9907 GetInt(value, (int *)ptr);
9912 GetInt64(value, (long long *)ptr);
9917 GetIntPtr(value, (intptr_t *)ptr);
9922 GetIntSize(value, (ssize_t *)ptr);
9927 GetFloat(value, (float *)ptr);
9932 GetDouble(value, (double *)ptr);
9937 else if(value->type == 1)
9941 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9943 if(_class->type == 1)
9945 ComputeTypeSize(type);
9946 if(value->instance->data)
9947 memcpy(ptr, value->instance->data, type->size);
9954 if(value->type == 1 && value->instance->data)
9956 void (* Set)(void *, void *) = (void *)prop->Set;
9958 Set(inst->data, value->instance->data);
9959 PopulateInstance(inst);
9961 else if(value->type == 2)
9967 void (* Set)(void *, double) = (void *)prop->Set;
9969 Set(inst->data, strtod(value->constant, (((void *)0))));
9974 void (* Set)(void *, float) = (void *)prop->Set;
9976 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
9981 void (* Set)(void *, int) = (void *)prop->Set;
9983 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
9988 void (* Set)(void *, long long) = (void *)prop->Set;
9990 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
9995 void (* Set)(void *, intptr_t) = (void *)prop->Set;
9997 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10002 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10004 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10009 else if(value->type == 3)
10013 ReadString(temp, value->string);
10014 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10018 else if(_class->type == 3)
10022 if(value->type == 2)
10024 if(type->kind == 8)
10026 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10028 if(_class->type == 3)
10030 if(!_class->dataType)
10031 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10032 type = _class->dataType;
10040 float (* Set)(float) = (void *)prop->Set;
10042 GetFloat(member->initializer->exp, &fValue);
10043 exp->constant = PrintFloat(Set(fValue));
10050 double (* Set)(double) = (void *)prop->Set;
10052 GetDouble(member->initializer->exp, &dValue);
10053 exp->constant = PrintDouble(Set(dValue));
10061 else if(_class->type == 2)
10065 if(value->type == 1 && value->instance->data)
10067 unsigned int (* Set)(void *) = (void *)prop->Set;
10069 bits = Set(value->instance->data);
10071 else if(value->type == 2)
10075 else if(dataMember)
10077 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10078 struct Type * type;
10081 GetInt(value, &part);
10082 bits = (bits & ~bitMember->mask);
10083 if(!bitMember->dataType)
10084 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10085 type = bitMember->dataType;
10086 if(type->kind == 8 && type->_class && type->_class->registered)
10088 if(!type->_class->registered->dataType)
10089 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10090 type = type->_class->registered->dataType;
10096 bits |= ((char)part << bitMember->pos);
10098 bits |= ((unsigned char)part << bitMember->pos);
10102 bits |= ((short)part << bitMember->pos);
10104 bits |= ((unsigned short)part << bitMember->pos);
10109 bits |= (part << bitMember->pos);
10111 bits |= ((unsigned int)part << bitMember->pos);
10115 bits |= ((long long)part << bitMember->pos);
10117 bits |= ((uint64)part << bitMember->pos);
10122 bits |= ((intptr_t)part << bitMember->pos);
10126 bits |= ((uintptr_t)part << bitMember->pos);
10132 bits |= ((ssize_t)part << bitMember->pos);
10136 bits |= ((size_t)part << bitMember->pos);
10145 if(_class && _class->type == 3)
10147 ComputeExpression(member->initializer->exp);
10148 exp->constant = member->initializer->exp->constant;
10150 member->initializer->exp->constant = (((void *)0));
10160 if(_class && _class->type == 2)
10162 exp->constant = PrintHexUInt(bits);
10167 FreeInstance(inst);
10171 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10173 if(exp->op.op == SIZEOF)
10175 FreeExpContents(exp);
10177 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10187 struct Expression * exp2 = exp->op.exp2;
10189 exp->op.exp2 = (((void *)0));
10190 FreeExpContents(exp);
10191 FreeType(exp->expType);
10192 FreeType(exp->destType);
10194 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10200 FreeExpContents(exp);
10201 op1->ops.Neg(exp, op1);
10205 if(op1->ops.BitNot)
10207 FreeExpContents(exp);
10208 op1->ops.BitNot(exp, op1);
10214 FreeExpContents(exp);
10215 op1->ops.Not(exp, op1);
10227 FreeExpContents(exp);
10228 op1->ops.Add(exp, op1, op2);
10234 FreeExpContents(exp);
10235 op1->ops.Sub(exp, op1, op2);
10241 FreeExpContents(exp);
10242 op1->ops.Mul(exp, op1, op2);
10248 FreeExpContents(exp);
10249 op1->ops.Div(exp, op1, op2);
10255 FreeExpContents(exp);
10256 op1->ops.Mod(exp, op1, op2);
10262 if(op1->ops.BitAnd)
10264 FreeExpContents(exp);
10265 op1->ops.BitAnd(exp, op1, op2);
10272 FreeExpContents(exp);
10273 op1->ops.BitOr(exp, op1, op2);
10277 if(op1->ops.BitXor)
10279 FreeExpContents(exp);
10280 op1->ops.BitXor(exp, op1, op2);
10284 if(op1->ops.LShift)
10286 FreeExpContents(exp);
10287 op1->ops.LShift(exp, op1, op2);
10291 if(op1->ops.RShift)
10293 FreeExpContents(exp);
10294 op1->ops.RShift(exp, op1, op2);
10300 FreeExpContents(exp);
10301 op1->ops.Equ(exp, op1, op2);
10307 FreeExpContents(exp);
10308 op1->ops.Nqu(exp, op1, op2);
10314 FreeExpContents(exp);
10315 op1->ops.And(exp, op1, op2);
10321 FreeExpContents(exp);
10322 op1->ops.Or(exp, op1, op2);
10328 FreeExpContents(exp);
10329 op1->ops.Grt(exp, op1, op2);
10335 FreeExpContents(exp);
10336 op1->ops.Sma(exp, op1, op2);
10340 if(op1->ops.GrtEqu)
10342 FreeExpContents(exp);
10343 op1->ops.GrtEqu(exp, op1, op2);
10347 if(op1->ops.SmaEqu)
10349 FreeExpContents(exp);
10350 op1->ops.SmaEqu(exp, op1, op2);
10358 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10360 void ComputeExpression(struct Expression * exp)
10362 char expString[10240];
10364 expString[0] = '\0';
10369 ComputeInstantiation(exp);
10374 struct Expression * exp1, * exp2 = (((void *)0));
10375 struct Operand op1 =
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
10382 struct Operand op2 =
10386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10391 ComputeExpression(exp->op.exp2);
10394 ComputeExpression(exp->op.exp1);
10395 exp1 = exp->op.exp1;
10396 exp2 = exp->op.exp2;
10397 op1 = GetOperand(exp1);
10399 op1.type->refCount++;
10402 op2 = GetOperand(exp2);
10404 op2.type->refCount++;
10409 exp1 = exp->op.exp2;
10410 op1 = GetOperand(exp1);
10412 op1.type->refCount++;
10414 CallOperator(exp, exp1, exp2, &op1, &op2);
10416 FreeType(op1.type);
10418 FreeType(op2.type);
10424 struct Expression * e, * n;
10426 for(e = (*exp->list).first; e; e = n)
10431 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10433 ComputeExpression(e);
10434 FreeType(exp->expType);
10435 FreeType(exp->destType);
10437 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10438 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10449 struct Expression * memberExp = exp->member.exp;
10450 struct Identifier * memberID = exp->member.member;
10451 struct Type * type;
10453 ComputeExpression(exp->member.exp);
10454 type = exp->member.exp->expType;
10457 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)));
10458 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10459 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10460 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10462 if(type->kind == 19 && exp->member.exp->type == 26)
10463 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10467 struct Symbol * classSym;
10470 PrintType(type, string, 0x0, 0x1);
10471 classSym = FindClass(string);
10472 _class = classSym ? classSym->registered : (((void *)0));
10474 if(exp->member.member)
10476 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10478 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10480 if(!prop && !member && _class && exp->member.member)
10482 struct Symbol * classSym = FindClass(exp->member.member->string);
10484 convertTo = _class;
10485 _class = classSym ? classSym->registered : (((void *)0));
10486 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10492 struct Type * type = prop->dataType;
10494 if(_class->type == 3)
10496 if(type->kind == 8)
10498 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10500 if(_class->type == 3)
10502 if(!_class->dataType)
10503 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10504 type = _class->dataType;
10512 float (* Get)(float) = (void *)prop->Get;
10514 GetFloat(exp->member.exp, &value);
10515 exp->constant = PrintFloat(Get ? Get(value) : value);
10522 double (* Get)(double);
10524 GetDouble(exp->member.exp, &value);
10526 Get = (void *)prop->Set;
10528 Get = (void *)prop->Get;
10529 exp->constant = PrintDouble(Get ? Get(value) : value);
10539 struct Expression * value = exp->member.exp;
10540 struct Type * type;
10542 if(!prop->dataType)
10543 ProcessPropertyType(prop);
10544 type = prop->dataType;
10548 else if(_class->type == 1)
10554 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10556 if(propertyClass->type == 1 && value->type == 1)
10558 void (* Set)(void *, void *) = (void *)prop->Set;
10560 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10561 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10562 exp->instance->_class = MkSpecifierName(_class->fullName);
10563 exp->instance->loc = exp->loc;
10565 Set(exp->instance->data, value->instance->data);
10566 PopulateInstance(exp->instance);
10573 void (* Set)(void *, int) = (void *)prop->Set;
10575 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10576 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10577 exp->instance->_class = MkSpecifierName(_class->fullName);
10578 exp->instance->loc = exp->loc;
10580 GetInt(value, &intValue);
10581 Set(exp->instance->data, intValue);
10582 PopulateInstance(exp->instance);
10587 long long intValue;
10588 void (* Set)(void *, long long) = (void *)prop->Set;
10590 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10591 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10592 exp->instance->_class = MkSpecifierName(_class->fullName);
10593 exp->instance->loc = exp->loc;
10595 GetInt64(value, &intValue);
10596 Set(exp->instance->data, intValue);
10597 PopulateInstance(exp->instance);
10603 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10605 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10606 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10607 exp->instance->_class = MkSpecifierName(_class->fullName);
10608 exp->instance->loc = exp->loc;
10610 GetIntPtr(value, &intValue);
10611 Set(exp->instance->data, intValue);
10612 PopulateInstance(exp->instance);
10618 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10620 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10621 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10622 exp->instance->_class = MkSpecifierName(_class->fullName);
10623 exp->instance->loc = exp->loc;
10625 GetIntSize(value, &intValue);
10626 Set(exp->instance->data, intValue);
10627 PopulateInstance(exp->instance);
10632 double doubleValue;
10633 void (* Set)(void *, double) = (void *)prop->Set;
10635 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10636 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10637 exp->instance->_class = MkSpecifierName(_class->fullName);
10638 exp->instance->loc = exp->loc;
10640 GetDouble(value, &doubleValue);
10641 Set(exp->instance->data, doubleValue);
10642 PopulateInstance(exp->instance);
10647 else if(_class->type == 2)
10653 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10655 if(propertyClass->type == 1 && value->instance->data)
10657 unsigned int (* Set)(void *) = (void *)prop->Set;
10658 unsigned int bits = Set(value->instance->data);
10660 exp->constant = PrintHexUInt(bits);
10664 else if(_class->type == 2)
10666 unsigned int value;
10667 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10670 GetUInt(exp->member.exp, &value);
10672 exp->constant = PrintHexUInt(bits);
10681 if(_class->type == 2)
10683 unsigned int value;
10685 GetUInt(exp->member.exp, &value);
10690 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10692 if(_class->type == 1)
10694 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10696 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10697 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10698 exp->instance->_class = MkSpecifierName(_class->fullName);
10699 exp->instance->loc = exp->loc;
10701 Get(value, exp->instance->data);
10702 PopulateInstance(exp->instance);
10704 else if(_class->type == 2)
10706 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10707 uint64 bits = Get(value);
10709 exp->constant = PrintHexUInt64(bits);
10716 else if(_class->type == 1)
10718 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10724 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10726 if(_class->type == 1 && value)
10728 void (* Get)(void *, void *) = (void *)prop->Get;
10730 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10731 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10732 exp->instance->_class = MkSpecifierName(_class->fullName);
10733 exp->instance->loc = exp->loc;
10735 Get(value, exp->instance->data);
10736 PopulateInstance(exp->instance);
10747 exp->isConstant = 0x0;
10756 FreeExpression(memberExp);
10757 FreeIdentifier(memberID);
10763 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10765 FreeExpContents(exp);
10766 exp->constant = PrintUInt(ComputeTypeSize(type));
10773 struct Symbol * classSym = exp->_class->symbol;
10775 if(classSym && classSym->registered)
10777 if(classSym->registered->fixed)
10779 FreeSpecifier(exp->_class);
10780 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10785 char className[1024];
10787 strcpy(className, "__ecereClass_");
10788 FullClassNameCat(className, classSym->string, 0x1);
10789 MangleClassName(className);
10790 FreeExpContents(exp);
10792 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10793 exp->member.member = MkIdentifier("structSize");
10800 struct Type * type;
10801 struct Expression * e = exp;
10803 if(exp->type == 11)
10806 ComputeExpression(exp->cast.exp);
10809 if(e && exp->expType)
10811 type = exp->expType;
10812 if(type->kind == 8)
10814 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10816 if(_class && (_class->type == 3 || _class->type == 2))
10818 if(!_class->dataType)
10819 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10820 type = _class->dataType;
10830 GetChar(e, &value);
10831 FreeExpContents(exp);
10832 exp->constant = PrintChar(value);
10837 unsigned char value;
10839 GetUChar(e, &value);
10840 FreeExpContents(exp);
10841 exp->constant = PrintUChar(value);
10850 GetShort(e, &value);
10851 FreeExpContents(exp);
10852 exp->constant = PrintShort(value);
10857 unsigned short value;
10859 GetUShort(e, &value);
10860 FreeExpContents(exp);
10861 exp->constant = PrintUShort(value);
10871 FreeExpContents(exp);
10872 exp->constant = PrintInt(value);
10877 unsigned int value;
10879 GetUInt(e, &value);
10880 FreeExpContents(exp);
10881 exp->constant = PrintUInt(value);
10890 GetInt64(e, &value);
10891 FreeExpContents(exp);
10892 exp->constant = PrintInt64(value);
10899 GetUInt64(e, &value);
10900 FreeExpContents(exp);
10901 exp->constant = PrintUInt64(value);
10910 GetIntPtr(e, &value);
10911 FreeExpContents(exp);
10912 exp->constant = PrintInt64((long long)value);
10919 GetUIntPtr(e, &value);
10920 FreeExpContents(exp);
10921 exp->constant = PrintUInt64((uint64)value);
10930 GetIntSize(e, &value);
10931 FreeExpContents(exp);
10932 exp->constant = PrintInt64((long long)value);
10939 GetUIntSize(e, &value);
10940 FreeExpContents(exp);
10941 exp->constant = PrintUInt64((uint64)value);
10949 GetFloat(e, &value);
10950 FreeExpContents(exp);
10951 exp->constant = PrintFloat(value);
10959 GetDouble(e, &value);
10960 FreeExpContents(exp);
10961 exp->constant = PrintDouble(value);
10971 struct Operand op1 =
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 op2 =
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
10985 struct Operand op3 =
10989 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10994 ComputeExpression((*exp->cond.exp).last);
10995 if(exp->cond.elseExp)
10996 ComputeExpression(exp->cond.elseExp);
10998 ComputeExpression(exp->cond.cond);
10999 op1 = GetOperand(exp->cond.cond);
11001 op1.type->refCount++;
11002 op2 = GetOperand((*exp->cond.exp).last);
11004 op2.type->refCount++;
11005 op3 = GetOperand(exp->cond.elseExp);
11007 op3.type->refCount++;
11010 FreeExpContents(exp);
11011 op1.ops.Cond(exp, &op1, &op2, &op3);
11014 FreeType(op1.type);
11016 FreeType(op2.type);
11018 FreeType(op3.type);
11024 void ApplyAnyObjectLogic(struct Expression * e);
11026 extern void CopyTypeInto(struct Type * type, struct Type * src);
11028 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11030 unsigned int result = 0x1;
11034 struct __ecereNameSpace__ecere__sys__OldList converts =
11038 struct Conversion * convert;
11040 if(destType->kind == 0)
11042 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11046 for(convert = converts.first; convert; convert = convert->next)
11048 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11052 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11053 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11056 newExp->destType = (((void *)0));
11060 exp->addedThis = 0x1;
11061 exp->member.exp = newExp;
11062 FreeType(exp->member.exp->expType);
11063 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11064 exp->member.exp->expType->classObjectType = objectType;
11065 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11066 exp->member.memberType = 1;
11067 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11068 exp->needCast = 0x1;
11070 exp->expType->refCount++;
11071 ApplyAnyObjectLogic(exp->member.exp);
11077 exp->addedThis = 0x1;
11078 exp->member.exp = newExp;
11079 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11081 newExp->byReference = 0x1;
11083 FreeType(exp->member.exp->expType);
11084 exp->member.exp->expType = (((void *)0));
11085 if(convert->convert->dataType)
11087 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11088 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11089 exp->member.exp->expType->refCount = 1;
11090 exp->member.exp->expType->classObjectType = objectType;
11091 ApplyAnyObjectLogic(exp->member.exp);
11093 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11094 exp->member.memberType = 4;
11095 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11096 exp->needCast = 0x1;
11097 if(convert->resultType)
11098 convert->resultType->refCount++;
11104 FreeType(exp->expType);
11107 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11108 exp->needCast = 0x1;
11110 exp->expType->refCount++;
11114 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11115 exp->needCast = 0x1;
11116 if(convert->resultType)
11117 convert->resultType->refCount++;
11121 if(exp->isConstant && inCompiler)
11122 ComputeExpression(exp);
11123 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11125 if(!result && exp->expType && converts.count)
11127 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11129 if(!result && exp->expType && exp->destType)
11131 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))
11138 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11140 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11142 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11144 void CheckTemplateTypes(struct Expression * exp)
11146 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11148 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11149 struct Statement * compound;
11150 struct Context * context;
11154 exp->destType->refCount++;
11156 exp->expType->refCount++;
11157 newExp->prev = (((void *)0));
11158 newExp->next = (((void *)0));
11159 switch(exp->expType->kind)
11162 if(exp->destType->classObjectType)
11165 exp->destType->refCount--;
11167 exp->expType->refCount--;
11168 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11172 struct __ecereNameSpace__ecere__sys__OldList * specs;
11173 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11174 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11176 context = PushContext();
11177 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11178 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11179 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11181 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11182 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11183 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11184 exp->compound->compound.context = context;
11185 PopContext(context);
11190 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11191 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11195 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11197 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11198 struct Statement * compound;
11199 struct Context * context;
11203 exp->destType->refCount++;
11205 exp->expType->refCount++;
11206 newExp->prev = (((void *)0));
11207 newExp->next = (((void *)0));
11208 switch(exp->expType->kind)
11211 if(exp->destType->classObjectType)
11214 exp->destType->refCount--;
11216 exp->expType->refCount--;
11217 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11221 struct __ecereNameSpace__ecere__sys__OldList * specs;
11222 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11223 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11225 context = PushContext();
11226 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11227 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11228 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11230 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11231 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11232 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11233 exp->compound->compound.context = context;
11234 PopContext(context);
11239 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11242 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11243 ProcessExpressionType((*exp->list).first);
11249 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11250 newExp->needCast = 0x1;
11251 ProcessExpressionType((*exp->list).first);
11257 if(exp->expType->kind == 20)
11259 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11263 FreeType(exp->destType);
11264 FreeType(exp->expType);
11265 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11269 if(newExp->type == 8 && newExp->member.memberType == 3)
11273 exp->op.exp1 = (((void *)0));
11274 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11278 char typeString[1024];
11279 struct Declarator * decl;
11280 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11282 typeString[0] = '\0';
11283 PrintType(exp->expType, typeString, 0x0, 0x0);
11284 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11286 exp->cast.typeName = MkTypeName(specs, decl);
11287 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11288 exp->cast.exp->needCast = 0x1;
11296 extern int strncmp(const char * , const char * , size_t n);
11298 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11300 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11302 int nsLen = strlen(nameSpace);
11303 struct Symbol * symbol;
11305 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)))
11307 char * s = symbol->string;
11309 if(!strncmp(s, nameSpace, nsLen))
11314 for(c = strlen(s) - 1; c >= 0; c--)
11317 namePart = s + c + 1;
11318 if(!strcmp(namePart, name))
11326 return (((void *)0));
11329 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11332 char nameSpace[1024];
11334 unsigned int gotColon = 0x0;
11336 nameSpace[0] = '\0';
11337 for(c = strlen(name) - 1; c >= 0; c--)
11343 namePart = name + c + 1;
11344 while(c >= 0 && name[c] == ':')
11348 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11352 memcpy(nameSpace, name, c + 1);
11353 nameSpace[c + 1] = (char)0;
11354 return ScanWithNameSpace(tree, nameSpace, namePart);
11358 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11364 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11368 return ScanWithNameSpace(tree, "", namePart);
11370 return (((void *)0));
11373 static void ProcessDeclaration(struct Declaration * decl);
11375 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11377 struct Context * ctx;
11378 struct Symbol * symbol = (((void *)0));
11380 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11382 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11384 symbol = (((void *)0));
11387 char curName[1024];
11389 strcpy(curName, thisNameSpace);
11390 strcat(curName, "::");
11391 strcat(curName, name);
11392 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11395 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11398 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11399 if(symbol || ctx == endContext)
11402 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11404 if(symbol->pointerExternal->type == 0)
11406 struct FunctionDefinition * function = symbol->pointerExternal->function;
11407 struct Context * tmpContext = curContext;
11409 curContext = (((void *)0));
11410 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11411 curContext = tmpContext;
11412 symbol->pointerExternal->symbol = symbol;
11413 DeclareType(symbol->type, 0x1, 0x1);
11414 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11415 symbol->id = curExternal->symbol->idCode;
11417 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11420 symbol->id = curExternal->symbol->idCode;
11426 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11428 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11429 ListAdd(specs, MkSpecifier(UNSIGNED));
11434 if(type->_class->registered)
11436 if(!type->_class->registered->dataType)
11437 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11438 GetTypeSpecs(type->_class->registered->dataType, specs);
11443 ListAdd(specs, MkSpecifier(DOUBLE));
11446 ListAdd(specs, MkSpecifier(FLOAT));
11449 ListAdd(specs, MkSpecifier(CHAR));
11452 ListAdd(specs, MkSpecifier(SHORT));
11455 ListAdd(specs, MkSpecifier(INT64));
11458 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11461 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11465 ListAdd(specs, MkSpecifier(INT));
11470 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11472 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11479 if(type->_class && type->_class->string)
11481 if(type->classObjectType == 2)
11482 strcat(string, "typed_object");
11484 strcat(string, type->_class->string);
11487 if(type->_class->registered)
11488 strcat(string, type->_class->registered->name);
11490 strcat(string, type->_class->string);
11497 _PrintType(type->type, string, 0x0, printFunction, fullName);
11498 strcat(string, " *");
11503 strcat(string, "void");
11506 strcat(string, type->isSigned ? "int" : "uint");
11509 strcat(string, type->isSigned ? "int64" : "uint64");
11512 strcat(string, type->isSigned ? "intptr" : "uintptr");
11515 strcat(string, type->isSigned ? "intsize" : "uintsize");
11518 strcat(string, type->isSigned ? "char" : "byte");
11521 strcat(string, type->isSigned ? "short" : "uint16");
11524 strcat(string, "float");
11527 strcat(string, "double");
11532 strcat(string, "struct ");
11533 strcat(string, type->enumName);
11535 else if(type->typeName)
11537 strcat(string, type->typeName);
11541 struct Type * member;
11543 strcat(string, "struct {");
11544 for(member = type->members.first; member; member = member->next)
11546 PrintType(member, string, 0x1, fullName);
11547 strcat(string, "; ");
11549 strcat(string, "}");
11555 strcat(string, "union ");
11556 strcat(string, type->enumName);
11558 else if(type->typeName)
11560 strcat(string, type->typeName);
11564 strcat(string, "union ");
11565 strcat(string, "(unnamed)");
11571 strcat(string, "enum ");
11572 strcat(string, type->enumName);
11574 else if(type->typeName)
11576 strcat(string, type->typeName);
11579 strcat(string, "enum");
11585 if(type->dllExport)
11586 strcat(string, "dllexport ");
11587 PrintType(type->returnType, string, 0x0, fullName);
11588 strcat(string, " ");
11595 strcat(string, type->name);
11598 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11604 strcat(string, name);
11610 struct Type * param;
11612 strcat(string, "(");
11613 for(param = type->params.first; param; param = param->next)
11615 PrintType(param, string, 0x1, fullName);
11617 strcat(string, ", ");
11619 strcat(string, ")");
11626 char baseType[1024], size[256];
11627 struct Type * arrayType = type;
11629 baseType[0] = '\0';
11631 while(arrayType->kind == 12)
11634 if(arrayType->enumClass)
11635 strcat(size, arrayType->enumClass->string);
11636 else if(arrayType->arraySizeExp)
11637 PrintExpression(arrayType->arraySizeExp, size);
11639 arrayType = arrayType->arrayType;
11641 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11642 strcat(string, baseType);
11643 strcat(string, size);
11649 strcat(string, "...");
11652 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11655 strcat(string, "subclass(");
11656 strcat(string, type->_class ? type->_class->string : "int");
11657 strcat(string, ")");
11660 strcat(string, type->templateParameter->identifier->string);
11663 strcat(string, "thisclass");
11666 strcat(string, "__builtin_va_list");
11669 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11671 strcat(string, " ");
11672 strcat(string, type->name);
11677 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11679 struct Type * funcType;
11681 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11683 if(funcType && funcType->kind == 11 && type != funcType)
11685 char typeString[1024];
11686 struct Type * param;
11688 PrintType(funcType->returnType, string, 0x0, fullName);
11689 strcat(string, "(");
11690 _PrintType(type, string, printName, 0x0, fullName);
11691 strcat(string, ")");
11692 strcat(string, "(");
11693 for(param = funcType->params.first; param; param = param->next)
11695 PrintType(param, string, 0x1, fullName);
11697 strcat(string, ", ");
11699 strcat(string, ")");
11702 _PrintType(type, string, printName, 0x1, fullName);
11703 if(type->bitFieldCount)
11707 sprintf(count, ":%d", type->bitFieldCount);
11708 strcat(string, count);
11712 static struct Type * FindMember(struct Type * type, char * string)
11714 struct Type * memberType;
11716 for(memberType = type->members.first; memberType; memberType = memberType->next)
11718 if(!memberType->name)
11720 struct Type * subType = FindMember(memberType, string);
11725 else if(!strcmp(memberType->name, string))
11728 return (((void *)0));
11731 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11733 struct Type * memberType;
11735 for(memberType = type->members.first; memberType; memberType = memberType->next)
11737 if(!memberType->name)
11739 struct Type * subType = FindMember(memberType, string);
11743 *offset += memberType->offset;
11747 else if(!strcmp(memberType->name, string))
11749 *offset += memberType->offset;
11753 return (((void *)0));
11756 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11758 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11760 struct Expression * ParseExpressionString(char * expression)
11762 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11763 ((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));
11764 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11766 parsedExpression = (((void *)0));
11768 expression_yyparse();
11769 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11770 return parsedExpression;
11773 extern char * QMkString(char * source);
11775 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11777 void * __ecereTemp1;
11778 struct Identifier * id = exp->identifier;
11779 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11780 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11781 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11782 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11784 if(_class && _class->type == 4)
11786 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11787 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11791 struct __ecereNameSpace__ecere__com__Class * baseClass;
11793 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11795 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11797 for(value = e->values.first; value; value = value->next)
11799 if(!strcmp(value->name, id->string))
11804 char constant[256];
11806 FreeExpContents(exp);
11808 exp->isConstant = 0x1;
11809 if(!strcmp(baseClass->dataTypeString, "int"))
11810 sprintf(constant, "%d", value->data);
11812 sprintf(constant, "0x%X", value->data);
11813 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11814 exp->expType = MkClassType(baseClass->fullName);
11822 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11824 ProcessMethodType(method);
11825 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));
11828 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11830 if(!prop->dataType)
11831 ProcessPropertyType(prop);
11832 exp->expType = prop->dataType;
11834 prop->dataType->refCount++;
11837 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11839 if(!member->dataType)
11840 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11841 exp->expType = member->dataType;
11842 if(member->dataType)
11843 member->dataType->refCount++;
11846 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11848 if(!classProp->dataType)
11849 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11850 if(classProp->constant)
11852 FreeExpContents(exp);
11853 exp->isConstant = 0x1;
11854 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11857 exp->constant = QMkString((char *)classProp->Get(_class));
11861 char constant[256];
11864 sprintf(constant, "%d", (int)classProp->Get(_class));
11865 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11871 exp->expType = classProp->dataType;
11872 if(classProp->dataType)
11873 classProp->dataType->refCount++;
11879 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11881 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11882 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11883 struct __ecereNameSpace__ecere__com__NameSpace * child;
11887 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)))
11889 data = ScanGlobalData(child, name);
11897 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11899 extern char * strncpy(char * , const char * , size_t n);
11901 static struct GlobalData * FindGlobalData(char * name)
11904 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11906 nameSpace = globalData;
11907 for(c = 0; name[c]; c++)
11909 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11911 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11912 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11914 strncpy(spaceName, name + start, c - start);
11915 spaceName[c - start] = '\0';
11916 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11917 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11919 return (((void *)0));
11920 nameSpace = newSpace;
11928 return ScanGlobalData(nameSpace, name + start);
11930 return (((void *)0));
11933 static int definedExpStackPos;
11935 static void * definedExpStack[512];
11937 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11939 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11941 FreeExpContents(checkedExp);
11942 FreeType(checkedExp->expType);
11943 FreeType(checkedExp->destType);
11944 *checkedExp = *newExp;
11945 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11946 checkedExp->prev = prev;
11947 checkedExp->next = next;
11950 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11952 extern int printf(char * , ...);
11954 void __ecereMethod_Expression_Clear();
11956 void ApplyAnyObjectLogic(struct Expression * e)
11958 struct Type * destType = e->destType;
11960 if(destType && (destType->classObjectType == 3))
11962 if(e && e->expType)
11964 struct Type * type = e->expType;
11965 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
11967 if(type->kind == 8 && type->_class && type->_class->registered)
11969 _class = type->_class->registered;
11971 else if(type->kind == 19)
11973 _class = FindClass("ecere::com::Class")->registered;
11977 char string[1024] = "";
11978 struct Symbol * classSym;
11980 PrintType(type, string, 0x0, 0x1);
11981 classSym = FindClass(string);
11983 _class = classSym->registered;
11985 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)))
11987 if(!_class || strcmp(_class->fullName, "char *"))
11989 struct Expression * checkedExp = e, * newExp;
11991 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
11993 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
11995 if(checkedExp->type == 25)
11997 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12000 checkedExp = (*checkedExp->list).last;
12002 else if(checkedExp->type == 11)
12003 checkedExp = checkedExp->cast.exp;
12005 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12007 newExp = checkedExp->op.exp2;
12008 checkedExp->op.exp2 = (((void *)0));
12009 FreeExpContents(checkedExp);
12010 if(e->expType && e->expType->passAsTemplate)
12014 ComputeTypeSize(e->expType);
12015 sprintf(size, "%d", e->expType->size);
12016 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))))));
12018 ReplaceExpContents(checkedExp, newExp);
12019 e->byReference = 0x1;
12021 else if(!e->byReference || (_class && _class->type == 5))
12023 struct Expression * checkedExp, * newExp;
12026 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;
12028 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12030 struct Context * context = PushContext();
12031 struct Declarator * decl;
12032 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12033 char typeString[1024];
12034 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12036 typeString[0] = '\0';
12038 newExp->prev = (((void *)0));
12039 newExp->next = (((void *)0));
12040 newExp->expType = (((void *)0));
12041 PrintType(e->expType, typeString, 0x0, 0x1);
12042 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12043 newExp->destType = ProcessType(specs, decl);
12044 curContext = context;
12049 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12051 sprintf(name, "__internalValue%03X", internalValueCounter++);
12052 if(!curCompound->compound.declarations)
12053 curCompound->compound.declarations = MkList();
12054 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12055 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12056 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12057 e->compound = MkCompoundStmt((((void *)0)), stmts);
12060 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12062 struct Type * type = e->destType;
12064 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12065 CopyTypeInto(e->destType, type);
12066 e->destType->refCount = 1;
12067 e->destType->classObjectType = 0;
12070 e->compound->compound.context = context;
12071 PopContext(context);
12072 curContext = context->parent;
12076 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12078 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12080 if(checkedExp->type == 25)
12082 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12085 checkedExp = (*checkedExp->list).last;
12087 else if(checkedExp->type == 11)
12088 checkedExp = checkedExp->cast.exp;
12091 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12093 *operand = *checkedExp;
12094 checkedExp->destType = (((void *)0));
12095 checkedExp->expType = (((void *)0));
12096 __ecereMethod_Expression_Clear(checkedExp);
12097 checkedExp->type = 4;
12098 checkedExp->op.op = '&';
12099 checkedExp->op.exp1 = (((void *)0));
12100 checkedExp->op.exp2 = operand;
12109 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))))
12111 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
12117 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12120 thisExp->prev = (((void *)0));
12121 thisExp->next = (((void *)0));
12122 __ecereMethod_Expression_Clear(e);
12124 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
12125 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12126 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12128 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12129 CopyTypeInto(e->expType, thisExp->expType);
12130 e->expType->byReference = 0x0;
12131 e->expType->refCount = 1;
12132 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))
12134 e->expType->classObjectType = 0;
12139 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12141 if(destType->kind == 14)
12143 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12145 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12147 unsigned int byReference = e->expType->byReference;
12148 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12149 struct Declarator * decl;
12150 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12151 char typeString[1024];
12152 struct Type * type;
12153 int backupClassObjectType;
12155 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12159 backupClassObjectType = type->classObjectType;
12160 type->classObjectType = 0;
12161 typeString[0] = '\0';
12162 PrintType(type, typeString, 0x0, 0x1);
12163 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12164 type->classObjectType = backupClassObjectType;
12166 thisExp->prev = (((void *)0));
12167 thisExp->next = (((void *)0));
12168 __ecereMethod_Expression_Clear(e);
12169 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)))
12173 e->op.exp1 = (((void *)0));
12174 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12179 e->cast.typeName = MkTypeName(specs, decl);
12180 e->cast.exp = thisExp;
12181 e->byReference = 0x1;
12184 e->destType = destType;
12186 destType->refCount++;
12191 extern char * strstr(const char * , const char * );
12193 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12195 struct __ecereNameSpace__ecere__com__DefinedExpression
12197 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12198 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12201 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12202 } __attribute__ ((gcc_struct));
12204 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12206 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12208 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12210 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12212 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12214 extern struct Expression * CopyExpression(struct Expression * exp);
12216 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12218 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12220 static void ProcessStatement(struct Statement * stmt);
12222 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12224 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12226 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12228 extern char * sourceFile;
12230 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12232 void ProcessExpressionType(struct Expression * exp)
12234 void * __ecereTemp2;
12235 void * __ecereTemp1;
12236 unsigned int unresolved = 0x0;
12237 struct Location oldyylloc = yylloc;
12238 unsigned int notByReference = 0x0;
12240 if(!exp || exp->expType)
12247 struct Identifier * id = exp->identifier;
12251 if(id->_class && id->_class->name)
12253 id->classSym = id->_class->symbol;
12255 if(strstr(id->string, "__ecereClass") == id->string)
12257 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12260 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12262 ReplaceClassMembers(exp, thisClass);
12265 ProcessExpressionType(exp);
12268 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12273 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12277 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12283 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12286 ProcessExpressionType(exp);
12290 else if(currentClass && !id->_class)
12292 if(ResolveIdWithClass(exp, currentClass, 0x1))
12295 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12300 struct Type * type = symbol->type;
12301 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12303 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12305 struct Context * context = SetupTemplatesContext(_class);
12307 type = ReplaceThisClassType(_class);
12308 FinishTemplatesContext(context);
12310 type->refCount = 0;
12312 FreeSpecifier(id->_class);
12313 id->_class = (((void *)0));
12314 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12315 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12316 id->classSym = (((void *)0));
12317 exp->expType = type;
12320 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12321 exp->isConstant = 0x1;
12322 if(symbol->isParam || !strcmp(id->string, "this"))
12324 if(_class && _class->type == 1)
12325 exp->byReference = 0x1;
12327 if(symbol->isIterator)
12329 if(symbol->isIterator == 3)
12332 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12333 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12334 exp->expType = (((void *)0));
12335 ProcessExpressionType(exp);
12337 else if(symbol->isIterator != 4)
12340 exp->member.exp = MkExpIdentifier(exp->identifier);
12341 exp->member.exp->expType = exp->expType;
12342 exp->member.member = MkIdentifier("data");
12343 exp->expType = (((void *)0));
12344 ProcessExpressionType(exp);
12351 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12353 if(thisNameSpace && !(id->_class && !id->_class->name))
12357 strcpy(name, thisNameSpace);
12358 strcat(name, "::");
12359 strcat(name, id->string);
12360 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12363 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12368 for(c = 0; c < definedExpStackPos; c++)
12369 if(definedExpStack[c] == definedExp)
12371 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12373 struct Location backupYylloc = yylloc;
12375 definedExpStack[definedExpStackPos++] = definedExp;
12376 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12377 ((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));
12378 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12380 parsedExpression = (((void *)0));
12382 expression_yyparse();
12383 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12384 yylloc = backupYylloc;
12385 if(parsedExpression)
12387 FreeIdentifier(id);
12389 exp->list = MkListOne(parsedExpression);
12390 parsedExpression->loc = yylloc;
12391 ProcessExpressionType(exp);
12392 definedExpStackPos--;
12395 definedExpStackPos--;
12401 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12407 struct GlobalData * data = (((void *)0));
12409 if(thisNameSpace && !(id->_class && !id->_class->name))
12413 strcpy(name, thisNameSpace);
12414 strcat(name, "::");
12415 strcat(name, id->string);
12416 data = FindGlobalData(name);
12419 data = FindGlobalData(id->string);
12422 DeclareGlobalData(data);
12423 exp->expType = data->dataType;
12425 data->dataType->refCount++;
12426 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12427 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12428 FreeSpecifier(id->_class);
12429 id->_class = (((void *)0));
12434 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12436 if(thisNameSpace && !(id->_class && !id->_class->name))
12440 strcpy(name, thisNameSpace);
12441 strcat(name, "::");
12442 strcat(name, id->string);
12443 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12446 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12451 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12452 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12454 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12455 strcpy(name, "__ecereFunction_");
12456 FullClassNameCat(name, id->string, 0x0);
12457 if(DeclareFunction(function, name))
12459 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12460 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12462 exp->expType = function->dataType;
12463 if(function->dataType)
12464 function->dataType->refCount++;
12465 FreeSpecifier(id->_class);
12466 id->_class = (((void *)0));
12478 struct __ecereNameSpace__ecere__com__Class * _class;
12480 if(!exp->instance->_class)
12482 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12484 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12487 ProcessInstantiationType(exp->instance);
12488 exp->isConstant = exp->instance->isConstant;
12489 if(exp->instance->_class)
12491 exp->expType = MkClassType(exp->instance->_class->name);
12499 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12501 exp->expType = type;
12502 if(exp->constant[0] == '\'')
12504 if((int)((unsigned char *)exp->constant)[1] > 127)
12507 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12510 ch = exp->constant[1];
12511 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12512 exp->constant = PrintUInt(ch);
12514 type->_class = FindClass("unichar");
12515 type->isSigned = 0x0;
12520 type->isSigned = 0x1;
12523 else if(strchr(exp->constant, '.'))
12525 char ch = exp->constant[strlen(exp->constant) - 1];
12531 type->isSigned = 0x1;
12535 if(exp->constant[0] == '0' && exp->constant[1])
12536 type->isSigned = 0x0;
12537 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12538 type->isSigned = 0x0;
12539 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12540 type->isSigned = 0x0;
12542 type->isSigned = 0x1;
12545 exp->isConstant = 0x1;
12551 exp->isConstant = 0x1;
12552 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));
12557 ProcessExpressionType(exp->_new.size);
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->_new.typeName->qualifiers, exp->_new.typeName->declarator), ((struct Type *)__ecereTemp1));
12559 DeclareType(exp->expType->type, 0x0, 0x0);
12563 ProcessExpressionType(exp->_renew.size);
12564 ProcessExpressionType(exp->_renew.exp);
12565 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));
12566 DeclareType(exp->expType->type, 0x0, 0x0);
12570 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12571 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12572 unsigned int useDestType = 0x0, useSideType = 0x0;
12573 struct Location oldyylloc = yylloc;
12574 unsigned int useSideUnit = 0x0;
12575 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12617 if(exp->op.op != '*' || exp->op.exp1)
12624 if(exp->op.op == '&')
12626 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12628 struct Identifier * id = exp->op.exp2->identifier;
12629 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12631 if(symbol && symbol->isIterator == 2)
12634 exp->member.exp = exp->op.exp2;
12635 exp->member.member = MkIdentifier("key");
12636 exp->expType = (((void *)0));
12637 exp->op.exp2->expType = symbol->type;
12638 symbol->type->refCount++;
12639 ProcessExpressionType(exp);
12647 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))
12649 if(exp->op.exp1->destType)
12650 FreeType(exp->op.exp1->destType);
12651 exp->op.exp1->destType = exp->destType;
12653 exp->destType->refCount++;
12657 if(exp->op.exp1->destType)
12658 FreeType(exp->op.exp1->destType);
12659 exp->op.exp1->destType = dummy;
12662 if(exp->op.exp1->destType && exp->op.op != '=')
12663 exp->op.exp1->destType->count++;
12664 ProcessExpressionType(exp->op.exp1);
12665 if(exp->op.exp1->destType && exp->op.op != '=')
12666 exp->op.exp1->destType->count--;
12667 if(exp->op.exp1->destType == dummy)
12670 exp->op.exp1->destType = (((void *)0));
12672 type1 = exp->op.exp1->expType;
12676 char expString[10240];
12678 expString[0] = '\0';
12679 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12683 exp->op.exp2->destType = exp->op.exp1->expType;
12684 if(exp->op.exp1->expType)
12685 exp->op.exp1->expType->refCount++;
12689 exp->op.exp2->destType = exp->destType;
12691 exp->destType->refCount++;
12695 exp->expType = type1;
12700 PrintExpression(exp->op.exp2, expString);
12701 if(type1 && type1->kind == 13)
12703 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)
12704 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12705 else if(exp->op.op == '=')
12707 if(exp->op.exp2->destType)
12708 FreeType(exp->op.exp2->destType);
12709 exp->op.exp2->destType = type1;
12716 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)
12720 if(exp->op.exp2->destType)
12721 FreeType(exp->op.exp2->destType);
12722 exp->op.exp2->destType = type1;
12729 exp->expType = type1;
12731 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)))
12733 if(exp->op.exp2->destType)
12734 FreeType(exp->op.exp2->destType);
12735 exp->op.exp2->destType = exp->destType;
12737 exp->destType->refCount++;
12741 if(exp->op.exp2->destType)
12742 FreeType(exp->op.exp2->destType);
12743 exp->op.exp2->destType = dummy;
12746 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12748 FreeType(exp->op.exp2->destType);
12749 exp->op.exp2->destType = type1;
12752 if(exp->op.exp2->destType && exp->op.op != '=')
12753 exp->op.exp2->destType->count++;
12754 ProcessExpressionType(exp->op.exp2);
12755 if(exp->op.exp2->destType && exp->op.op != '=')
12756 exp->op.exp2->destType->count--;
12757 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12759 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)
12761 if(exp->op.op != '=' && type1->type->kind == 0)
12762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12764 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)))
12766 if(exp->op.op == ADD_ASSIGN)
12767 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12769 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))
12771 if(exp->op.op == ADD_ASSIGN)
12772 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12774 else if(inCompiler)
12776 char type1String[1024];
12777 char type2String[1024];
12779 type1String[0] = '\0';
12780 type2String[0] = '\0';
12781 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12782 PrintType(type1, type2String, 0x0, 0x1);
12783 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12784 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12787 if(exp->op.exp2->destType == dummy)
12790 exp->op.exp2->destType = (((void *)0));
12792 type2 = exp->op.exp2->expType;
12795 if(exp->op.op == SIZEOF)
12797 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
12798 exp->isConstant = 0x1;
12800 else if(exp->op.op == '*' && !exp->op.exp1)
12802 exp->expType = Dereference(type2);
12803 if(type2 && type2->kind == 8)
12804 notByReference = 0x1;
12806 else if(exp->op.op == '&' && !exp->op.exp1)
12807 exp->expType = Reference(type2);
12814 if(exp->op.exp1->destType)
12815 FreeType(exp->op.exp1->destType);
12816 exp->op.exp1->destType = MkClassType("bool");
12817 exp->op.exp1->destType->truth = 0x1;
12818 if(!exp->op.exp1->expType)
12819 ProcessExpressionType(exp->op.exp1);
12821 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12822 FreeType(exp->op.exp1->expType);
12823 exp->op.exp1->expType = MkClassType("bool");
12824 exp->op.exp1->expType->truth = 0x1;
12828 if(exp->op.exp2->destType)
12829 FreeType(exp->op.exp2->destType);
12830 exp->op.exp2->destType = MkClassType("bool");
12831 exp->op.exp2->destType->truth = 0x1;
12832 if(!exp->op.exp2->expType)
12833 ProcessExpressionType(exp->op.exp2);
12835 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12836 FreeType(exp->op.exp2->expType);
12837 exp->op.exp2->expType = MkClassType("bool");
12838 exp->op.exp2->expType->truth = 0x1;
12841 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")))))
12843 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12845 if(exp->op.exp2->destType)
12846 FreeType(exp->op.exp2->destType);
12847 exp->op.exp2->destType = type1;
12849 if(exp->op.exp1->destType)
12850 FreeType(exp->op.exp1->destType);
12851 exp->op.exp1->destType = type2;
12853 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)
12854 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);
12855 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12857 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12861 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12863 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12864 ProcessExpressionType(exp->op.exp1);
12865 if(type2->kind != 13)
12867 ProcessExpressionType(classExp);
12868 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"))))))));
12869 if(!exp->op.exp2->expType)
12870 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12871 ProcessExpressionType(exp->op.exp2);
12875 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)))
12877 if(type1->kind != 8 && type1->type->kind == 0)
12878 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12879 exp->expType = type1;
12883 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)))
12885 if(type2->kind != 8 && type2->type->kind == 0)
12886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12887 exp->expType = type2;
12891 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))
12893 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12897 unsigned int success = 0x0;
12899 if(type1->kind == 13 && type2->kind == 13)
12901 if(exp->op.op == '+')
12902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12903 else if(exp->op.op == '-')
12905 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12907 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1));
12909 if(type1->type->kind == 20)
12911 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12915 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12917 ProcessExpressionType(classExp);
12919 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")))))));
12920 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12928 if(!success && exp->op.exp1->type == 2)
12930 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12933 FreeType(exp->expType);
12934 exp->expType = exp->op.exp1->destType;
12935 if(exp->op.exp1->destType)
12936 exp->op.exp1->destType->refCount++;
12939 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12942 FreeType(exp->expType);
12943 exp->expType = exp->op.exp2->destType;
12944 if(exp->op.exp2->destType)
12945 exp->op.exp2->destType->refCount++;
12951 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
12954 FreeType(exp->expType);
12955 exp->expType = exp->op.exp2->destType;
12956 if(exp->op.exp2->destType)
12957 exp->op.exp2->destType->refCount++;
12960 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12963 FreeType(exp->expType);
12964 exp->expType = exp->op.exp1->destType;
12965 if(exp->op.exp1->destType)
12966 exp->op.exp1->destType->refCount++;
12972 char expString1[10240];
12973 char expString2[10240];
12977 expString1[0] = '\0';
12978 expString2[0] = '\0';
12983 PrintExpression(exp->op.exp1, expString1);
12984 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
12985 PrintExpression(exp->op.exp2, expString2);
12986 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
12987 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
12988 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
12990 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
12994 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
12996 if(exp->op.exp1->destType)
12997 FreeType(exp->op.exp1->destType);
12998 exp->op.exp1->destType = type2->_class->registered->dataType;
12999 if(type2->_class->registered->dataType)
13000 type2->_class->registered->dataType->refCount++;
13001 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13002 exp->expType = type2;
13006 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13008 if(exp->op.exp2->destType)
13009 FreeType(exp->op.exp2->destType);
13010 exp->op.exp2->destType = type1->_class->registered->dataType;
13011 if(type1->_class->registered->dataType)
13012 type1->_class->registered->dataType->refCount++;
13013 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13014 exp->expType = type1;
13020 unsigned int valid = 0x0;
13022 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13024 if(exp->op.exp2->destType)
13025 FreeType(exp->op.exp2->destType);
13026 if(!type1->_class->registered->dataType)
13027 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13028 exp->op.exp2->destType = type1->_class->registered->dataType;
13029 exp->op.exp2->destType->refCount++;
13030 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13031 type2 = exp->op.exp2->destType;
13032 exp->expType = type2;
13035 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13037 if(exp->op.exp1->destType)
13038 FreeType(exp->op.exp1->destType);
13039 if(!type2->_class->registered->dataType)
13040 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13041 exp->op.exp1->destType = type2->_class->registered->dataType;
13042 exp->op.exp1->destType->refCount++;
13043 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13044 type1 = exp->op.exp1->destType;
13045 exp->expType = type1;
13048 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13050 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13052 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13055 FreeType(exp->expType);
13056 exp->expType = exp->op.exp1->expType;
13057 if(exp->op.exp2->expType)
13058 exp->op.exp1->expType->refCount++;
13062 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13064 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13067 FreeType(exp->expType);
13068 exp->expType = exp->op.exp2->expType;
13069 if(exp->op.exp2->expType)
13070 exp->op.exp2->expType->refCount++;
13077 if(exp->op.exp2->destType)
13078 FreeType(exp->op.exp2->destType);
13079 exp->op.exp2->destType = type1;
13081 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13084 FreeType(exp->expType);
13085 exp->expType = exp->op.exp2->destType;
13086 if(exp->op.exp2->destType)
13087 exp->op.exp2->destType->refCount++;
13089 else if(type1 && type2)
13091 char expString1[10240];
13092 char expString2[10240];
13093 char type1String[1024];
13094 char type2String[1024];
13096 expString1[0] = '\0';
13097 expString2[0] = '\0';
13098 type1String[0] = '\0';
13099 type2String[0] = '\0';
13102 PrintExpression(exp->op.exp1, expString1);
13103 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13104 PrintExpression(exp->op.exp2, expString2);
13105 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13106 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13107 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13109 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13110 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13112 exp->expType = exp->op.exp1->expType;
13113 if(exp->op.exp1->expType)
13114 exp->op.exp1->expType->refCount++;
13116 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13118 exp->expType = exp->op.exp2->expType;
13119 if(exp->op.exp2->expType)
13120 exp->op.exp2->expType->refCount++;
13127 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13129 struct Type * oldType = exp->op.exp1->expType;
13131 exp->op.exp1->expType = (((void *)0));
13132 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13135 exp->op.exp1->expType = oldType;
13137 if(exp->op.exp1->destType)
13138 FreeType(exp->op.exp1->destType);
13139 exp->op.exp1->destType = type2;
13141 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13144 FreeType(exp->expType);
13145 exp->expType = exp->op.exp1->destType;
13146 if(exp->op.exp1->destType)
13147 exp->op.exp1->destType->refCount++;
13151 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13153 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13155 if(exp->op.exp1->destType)
13156 FreeType(exp->op.exp1->destType);
13157 exp->op.exp1->destType = type2->_class->registered->dataType;
13158 if(type2->_class->registered->dataType)
13159 type2->_class->registered->dataType->refCount++;
13160 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13162 if(exp->op.op == '!')
13164 exp->expType = MkClassType("bool");
13165 exp->expType->truth = 0x1;
13169 exp->expType = type2;
13174 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13176 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13178 if(exp->op.exp2->destType)
13179 FreeType(exp->op.exp2->destType);
13180 exp->op.exp2->destType = type1->_class->registered->dataType;
13181 if(type1->_class->registered->dataType)
13182 type1->_class->registered->dataType->refCount++;
13183 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13185 exp->expType = type1;
13191 if(exp->op.exp1 && !exp->op.exp1->expType)
13193 char expString[10000];
13195 expString[0] = '\0';
13198 PrintExpression(exp->op.exp1, expString);
13199 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13202 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13204 if(exp->op.exp2 && !exp->op.exp2->expType)
13206 char expString[10240];
13208 expString[0] = '\0';
13211 PrintExpression(exp->op.exp2, expString);
13212 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13215 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13219 FreeType(exp->expType);
13220 exp->expType = MkClassType("bool");
13221 exp->expType->truth = 0x1;
13223 if(exp->op.op != SIZEOF)
13224 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13225 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13227 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13229 yylloc = oldyylloc;
13236 struct Expression * e;
13238 exp->isConstant = 0x1;
13239 for(e = (*exp->list).first; e; e = e->next)
13241 unsigned int inced = 0x0;
13245 FreeType(e->destType);
13246 e->destType = exp->destType;
13249 exp->destType->refCount++;
13250 e->destType->count++;
13254 ProcessExpressionType(e);
13256 exp->destType->count--;
13257 if(!exp->expType && !e->next)
13259 exp->expType = e->expType;
13261 e->expType->refCount++;
13264 exp->isConstant = 0x0;
13266 e = (*exp->list).first;
13267 if(!e->next && e->type == 8)
13269 struct Expression * next = exp->next, * prev = exp->prev;
13271 FreeType(exp->expType);
13272 FreeType(exp->destType);
13273 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13277 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13278 ProcessExpressionType(exp);
13284 struct Expression * e;
13286 exp->isConstant = 0x1;
13287 ProcessExpressionType(exp->index.exp);
13288 if(!exp->index.exp->isConstant)
13289 exp->isConstant = 0x0;
13290 if(exp->index.exp->expType)
13292 struct Type * source = exp->index.exp->expType;
13294 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)
13296 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13298 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13299 if(exp->index.index && (*exp->index.index).last)
13301 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13305 for(e = (*exp->index.index).first; e; e = e->next)
13307 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13310 FreeType(e->destType);
13311 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13313 ProcessExpressionType(e);
13318 exp->isConstant = 0x0;
13321 exp->expType = Dereference(exp->index.exp->expType);
13323 DeclareType(exp->expType, 0x0, 0x0);
13328 struct Expression * e;
13329 struct Type * functionType;
13330 struct Type * methodType = (((void *)0));
13336 PrintExpression(exp->call.exp, name);
13337 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13339 PrintExpression(exp->call.exp, name);
13342 if(exp->call.exp->type == 0)
13344 struct Expression * idExp = exp->call.exp;
13345 struct Identifier * id = idExp->identifier;
13347 if(!strcmp(id->string, "__builtin_frame_address"))
13349 exp->expType = ProcessTypeString("void *", 0x1);
13350 if(exp->call.arguments && (*exp->call.arguments).first)
13351 ProcessExpressionType((*exp->call.arguments).first);
13354 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13356 exp->expType = ProcessTypeString("int", 0x1);
13357 if(exp->call.arguments && (*exp->call.arguments).first)
13358 ProcessExpressionType((*exp->call.arguments).first);
13361 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13363 struct Expression * a = (((void *)0));
13364 struct Expression * b = (((void *)0));
13365 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13367 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13369 a = (*exp->call.arguments).first;
13370 b = (*exp->call.arguments).last;
13374 else if((*exp->call.arguments).count == 1)
13376 a = (*exp->call.arguments).first;
13381 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13382 idExp->identifier = (((void *)0));
13383 FreeExpContents(exp);
13384 ProcessExpressionType(a);
13386 ProcessExpressionType(b);
13388 exp->list = MkList();
13389 if(a->expType && (!b || b->expType))
13391 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13395 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13396 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13397 struct Declaration * decl;
13398 char temp1[1024], temp2[1024];
13400 GetTypeSpecs(a->expType, specs);
13401 if(a && !a->isConstant && a->type != 0)
13403 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13404 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13405 tempExp1 = QMkExpId(temp1);
13406 tempExp1->expType = a->expType;
13408 a->expType->refCount++;
13409 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13411 if(b && !b->isConstant && b->type != 0)
13413 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13414 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13415 tempExp2 = QMkExpId(temp2);
13416 tempExp2->expType = b->expType;
13418 b->expType->refCount++;
13419 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13421 decl = MkDeclaration(specs, decls);
13422 if(!curCompound->compound.declarations)
13423 curCompound->compound.declarations = MkList();
13424 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13428 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13430 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13432 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13433 exp->expType = a->expType;
13435 a->expType->refCount++;
13437 else if(!strcmp(id->string, "Abs"))
13439 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13440 exp->expType = a->expType;
13442 a->expType->refCount++;
13444 else if(!strcmp(id->string, "Sgn"))
13446 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"))))));
13447 exp->expType = ProcessTypeString("int", 0x0);
13449 FreeExpression(tempExp1);
13451 FreeExpression(tempExp2);
13452 FreeIdentifier(id);
13458 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13460 if(!exp->call.exp->destType)
13462 exp->call.exp->destType = dummy;
13465 ProcessExpressionType(exp->call.exp);
13466 if(exp->call.exp->destType == dummy)
13469 exp->call.exp->destType = (((void *)0));
13473 functionType = exp->call.exp->expType;
13474 if(functionType && functionType->kind == 16)
13476 methodType = functionType;
13477 functionType = methodType->method->dataType;
13478 if(exp->call.exp->expType->usedClass)
13480 char typeString[1024];
13482 typeString[0] = '\0';
13483 PrintType(functionType, typeString, 0x1, 0x1);
13484 if(strstr(typeString, "thisclass"))
13486 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13487 struct Declarator * decl;
13490 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13492 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13493 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13494 thisClassParams = 0x0;
13495 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13497 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13499 thisClass = exp->call.exp->expType->usedClass;
13500 ProcessDeclarator(decl);
13501 thisClass = backupThisClass;
13503 thisClassParams = 0x1;
13504 functionType = ProcessType(specs, decl);
13505 functionType->refCount = 0;
13506 FinishTemplatesContext(context);
13508 FreeList(specs, FreeSpecifier);
13509 FreeDeclarator(decl);
13513 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13515 struct Type * type = functionType->type;
13517 if(!functionType->refCount)
13519 functionType->type = (((void *)0));
13520 FreeType(functionType);
13522 functionType = type;
13524 if(functionType && functionType->kind != 11)
13526 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13528 else if(functionType)
13530 unsigned int emptyParams = 0x0, noParams = 0x0;
13531 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13532 struct Type * type = functionType->params.first;
13533 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13535 struct Location oldyylloc = yylloc;
13539 if(functionType->extraParam && e && functionType->thisClass)
13541 e->destType = MkClassType(functionType->thisClass->string);
13544 if(!functionType->staticMethod)
13546 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13548 type = MkClassType(memberExp->member.exp->expType->_class->string);
13551 e->destType = type;
13553 type = functionType->params.first;
13556 type->refCount = 0;
13558 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13560 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13563 e->destType = type;
13565 type = functionType->params.first;
13568 type->refCount = 0;
13571 if(type && type->kind == 0)
13574 if(!type->refCount)
13576 type = (((void *)0));
13578 for(; e; e = e->next)
13580 if(!type && !emptyParams)
13583 if(methodType && methodType->methodClass)
13584 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);
13586 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);
13589 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13591 struct Type * templatedType = (((void *)0));
13592 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13593 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13596 if(_class && _class->templateArgs)
13598 struct __ecereNameSpace__ecere__com__Class * sClass;
13600 for(sClass = _class; sClass; sClass = sClass->base)
13602 if(sClass->templateClass)
13603 sClass = sClass->templateClass;
13605 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13607 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13609 struct __ecereNameSpace__ecere__com__Class * nextClass;
13611 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13613 if(nextClass->templateClass)
13614 nextClass = nextClass->templateClass;
13615 id += nextClass->templateParams.count;
13625 if(curParam && _class->templateArgs[id].dataTypeString)
13627 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13630 struct Context * context = SetupTemplatesContext(_class);
13632 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13633 FinishTemplatesContext(context);
13635 e->destType = templatedType;
13638 templatedType->passAsTemplate = 0x1;
13643 e->destType = type;
13650 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13652 e->destType = type->prev;
13653 e->destType->refCount++;
13657 e->destType = type;
13662 if(type && type->kind != 14)
13664 struct Type * next = type->next;
13666 if(!type->refCount)
13671 if(type && type->kind != 14)
13673 if(methodType && methodType->methodClass)
13674 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);
13676 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);
13678 yylloc = oldyylloc;
13679 if(type && !type->refCount)
13684 functionType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 0, ((struct Type *)__ecereTemp1)->kind = 11, ((struct Type *)__ecereTemp1));
13685 if(exp->call.exp->type == 0)
13687 char * string = exp->call.exp->identifier->string;
13691 struct Symbol * symbol;
13692 struct Location oldyylloc = yylloc;
13694 yylloc = exp->call.exp->identifier->loc;
13695 if(strstr(string, "__builtin_") == string)
13698 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13699 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));
13700 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13701 if(strstr(symbol->string, "::"))
13702 globalContext->hasNameSpace = 0x1;
13703 yylloc = oldyylloc;
13706 else if(exp->call.exp->type == 8)
13710 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13711 if(!functionType->returnType)
13713 functionType->returnType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
13716 if(functionType && functionType->kind == 11)
13718 exp->expType = functionType->returnType;
13719 if(functionType->returnType)
13720 functionType->returnType->refCount++;
13721 if(!functionType->refCount)
13722 FreeType(functionType);
13724 if(exp->call.arguments)
13726 for(e = (*exp->call.arguments).first; e; e = e->next)
13728 struct Type * destType = e->destType;
13730 ProcessExpressionType(e);
13737 struct Type * type;
13738 struct Location oldyylloc = yylloc;
13739 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13741 exp->thisPtr = thisPtr;
13742 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13744 exp->member.member->classSym = exp->member.member->_class->symbol;
13746 ProcessExpressionType(exp->member.exp);
13747 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)
13749 exp->isConstant = 0x0;
13752 exp->isConstant = exp->member.exp->isConstant;
13753 type = exp->member.exp->expType;
13755 if(type && (type->kind == 20))
13757 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13758 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13762 for(param = _class->templateParams.first; param; param = param->next)
13764 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13768 if(param && param->defaultArg.member)
13770 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13774 struct Expression * expMember = exp->member.exp;
13775 struct Declarator * decl;
13776 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13777 char thisClassTypeString[1024];
13779 FreeIdentifier(exp->member.member);
13780 ProcessExpressionType(argExp);
13782 char * colon = strstr(param->defaultArg.memberString, "::");
13786 char className[1024];
13787 struct __ecereNameSpace__ecere__com__Class * sClass;
13789 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13790 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13793 strcpy(thisClassTypeString, _class->fullName);
13795 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13796 exp->expType = ProcessType(specs, decl);
13797 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13799 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13800 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13802 int paramCount = 0;
13803 int lastParam = -1;
13804 char templateString[1024];
13805 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13807 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13808 for(cClass = expClass; cClass; cClass = cClass->base)
13812 for(param = cClass->templateParams.first; param; param = param->next)
13815 struct __ecereNameSpace__ecere__com__Class * sClass;
13816 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13818 for(sClass = cClass->base; sClass; sClass = sClass->base)
13819 id += sClass->templateParams.count;
13820 arg = expClass->templateArgs[id];
13821 for(sClass = _class; sClass; sClass = sClass->base)
13823 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13825 struct __ecereNameSpace__ecere__com__Class * nextClass;
13827 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13828 p += nextClass->templateParams.count;
13829 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13831 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13833 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13835 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13836 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13843 char argument[256];
13845 argument[0] = '\0';
13846 switch(param->type)
13850 char expString[1024];
13851 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13852 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13853 struct Expression * exp;
13854 char * string = PrintHexUInt64(arg.expression.ui64);
13856 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13857 ProcessExpressionType(exp);
13858 ComputeExpression(exp);
13859 expString[0] = '\0';
13860 PrintExpression(exp, expString);
13861 strcat(argument, expString);
13862 FreeExpression(exp);
13867 strcat(argument, arg.member->name);
13872 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13874 if(!strcmp(arg.dataTypeString, "thisclass"))
13875 strcat(argument, thisClassTypeString);
13877 strcat(argument, arg.dataTypeString);
13885 strcat(templateString, ", ");
13886 if(lastParam != p - 1)
13888 strcat(templateString, param->name);
13889 strcat(templateString, " = ");
13891 strcat(templateString, argument);
13900 int len = strlen(templateString);
13902 if(templateString[len - 1] == '>')
13903 templateString[len++] = ' ';
13904 templateString[len++] = '>';
13905 templateString[len++] = '\0';
13908 struct Context * context = SetupTemplatesContext(_class);
13910 FreeType(exp->expType);
13911 exp->expType = ProcessTypeString(templateString, 0x0);
13912 FinishTemplatesContext(context);
13916 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")))))))));
13919 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13921 type = ProcessTemplateParameterType(type->templateParameter);
13924 if(type && (type->kind == 20))
13926 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13928 struct Identifier * id = exp->member.member;
13929 int typeKind = type->kind;
13930 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));
13932 if(typeKind == 19 && exp->member.exp->type == 26)
13934 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
13937 if(id && (typeKind == 3 || typeKind == 15))
13938 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
13941 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
13942 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
13943 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
13944 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
13945 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
13947 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
13948 exp->member.memberType = 1;
13949 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
13950 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
13953 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
13955 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13956 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
13958 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13960 member = (((void *)0));
13962 if(!member && !prop)
13963 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13964 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
13965 exp->member.thisPtr = 0x1;
13971 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
13972 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13973 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
13975 if(!prop && !member)
13977 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
13980 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
13981 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
13982 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
13987 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
13988 prop = (((void *)0));
13990 member = (((void *)0));
13994 if(!prop && !member)
13995 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
13996 if(!prop && !member && !method)
14000 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14003 exp->member.memberType = 5;
14004 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14008 char structName[1024];
14009 struct Identifier * id = exp->member.member;
14010 struct Expression * classExp = exp->member.exp;
14013 FreeType(classExp->expType);
14014 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14015 strcpy(structName, "__ecereClassData_");
14016 FullClassNameCat(structName, type->_class->string, 0x0);
14018 exp->member.member = id;
14019 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"))))))));
14021 ProcessExpressionType(exp);
14027 struct Symbol * classSym = FindClass(id->string);
14031 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14034 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14040 exp->member.memberType = 1;
14041 if(!prop->dataType)
14042 ProcessPropertyType(prop);
14043 exp->expType = prop->dataType;
14045 prop->dataType->refCount++;
14049 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14051 FreeExpContents(exp);
14053 exp->identifier = MkIdentifier("class");
14054 ProcessExpressionType(exp);
14057 exp->member.memberType = 3;
14058 DeclareStruct(_class->fullName, 0x0);
14059 if(!member->dataType)
14061 struct Context * context = SetupTemplatesContext(_class);
14063 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14064 FinishTemplatesContext(context);
14066 exp->expType = member->dataType;
14067 if(member->dataType)
14068 member->dataType->refCount++;
14070 else if(revConvert)
14072 exp->member.memberType = 4;
14073 exp->expType = MkClassType(revConvert->_class->fullName);
14079 exp->member.memberType = 2;
14081 if(!method->dataType)
14082 ProcessMethodType(method);
14083 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));
14084 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14085 exp->expType->usedClass = _class;
14087 else if(!classProp)
14089 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14091 FreeExpContents(exp);
14093 exp->identifier = MkIdentifier("class");
14094 ProcessExpressionType(exp);
14097 yylloc = exp->member.member->loc;
14098 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14100 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14102 if(_class && exp->expType)
14104 struct __ecereNameSpace__ecere__com__Class * tClass;
14107 while(tClass && !tClass->templateClass)
14108 tClass = tClass->base;
14109 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14112 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14113 struct __ecereNameSpace__ecere__com__Class * sClass;
14115 for(sClass = tClass; sClass; sClass = sClass->base)
14118 if(sClass->templateClass)
14119 sClass = sClass->templateClass;
14120 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14122 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14124 for(sClass = sClass->base; sClass; sClass = sClass->base)
14125 id += sClass->templateParams.count;
14133 if(curParam && tClass->templateArgs[id].dataTypeString)
14135 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14136 struct Context * context = SetupTemplatesContext(tClass);
14138 FreeType(exp->expType);
14139 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14142 if(exp->expType->kind == 21)
14144 FreeType(exp->expType);
14145 exp->expType = ReplaceThisClassType(_class);
14147 if(tClass->templateClass)
14148 exp->expType->passAsTemplate = 0x1;
14151 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14152 if(exp->destType->kind == 21)
14154 FreeType(exp->destType);
14155 exp->destType = ReplaceThisClassType(_class);
14159 FinishTemplatesContext(context);
14162 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14165 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14166 struct __ecereNameSpace__ecere__com__Class * sClass;
14168 for(sClass = tClass; sClass; sClass = sClass->base)
14171 if(sClass->templateClass)
14172 sClass = sClass->templateClass;
14173 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14175 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14177 for(sClass = sClass->base; sClass; sClass = sClass->base)
14178 id += sClass->templateParams.count;
14188 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14189 struct Context * context = SetupTemplatesContext(tClass);
14190 struct Type * basicType;
14192 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14195 if(basicType->kind == 21)
14197 FreeType(basicType);
14198 basicType = ReplaceThisClassType(_class);
14200 FreeType(exp->expType);
14201 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));
14204 exp->destType = exp->expType;
14205 exp->destType->refCount++;
14208 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14209 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14210 struct Declarator * decl;
14212 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14215 exp->destType->refCount++;
14217 exp->expType->refCount++;
14219 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14220 exp->cast.exp = newExp;
14223 FinishTemplatesContext(context);
14226 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14228 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14232 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14235 int paramCount = 0;
14236 int lastParam = -1;
14237 char templateString[1024];
14238 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14240 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14241 while(cClass != expClass)
14243 struct __ecereNameSpace__ecere__com__Class * sClass;
14245 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14248 for(param = cClass->templateParams.first; param; param = param->next)
14250 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14253 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14254 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14256 while(cClassCur != tClass && !paramCur)
14258 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14260 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14262 cClassCur = sClassCur;
14263 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14265 if(!strcmp(paramCur->name, param->name))
14272 if(paramCur && paramCur->type == 0)
14273 arg = tClass->templateArgs[cp];
14275 arg = expClass->templateArgs[p];
14277 char argument[256];
14279 argument[0] = '\0';
14280 switch(param->type)
14284 char expString[1024];
14285 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14286 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14287 struct Expression * exp;
14288 char * string = PrintHexUInt64(arg.expression.ui64);
14290 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14291 ProcessExpressionType(exp);
14292 ComputeExpression(exp);
14293 expString[0] = '\0';
14294 PrintExpression(exp, expString);
14295 strcat(argument, expString);
14296 FreeExpression(exp);
14301 strcat(argument, arg.member->name);
14306 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14307 strcat(argument, arg.dataTypeString);
14314 strcat(templateString, ", ");
14315 if(lastParam != p - 1)
14317 strcat(templateString, param->name);
14318 strcat(templateString, " = ");
14320 strcat(templateString, argument);
14329 int len = strlen(templateString);
14331 if(templateString[len - 1] == '>')
14332 templateString[len++] = ' ';
14333 templateString[len++] = '>';
14334 templateString[len++] = '\0';
14336 FreeType(exp->expType);
14338 struct Context * context = SetupTemplatesContext(tClass);
14340 exp->expType = ProcessTypeString(templateString, 0x0);
14341 FinishTemplatesContext(context);
14348 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)");
14350 else if(type && (type->kind == 9 || type->kind == 10))
14352 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14356 exp->expType = memberType;
14358 memberType->refCount++;
14363 char expString[10240];
14365 expString[0] = '\0';
14368 PrintExpression(exp, expString);
14369 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14371 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14373 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14375 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14377 struct Identifier * id = exp->member.member;
14378 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));
14382 FreeType(exp->expType);
14383 exp->expType = ReplaceThisClassType(_class);
14387 yylloc = oldyylloc;
14392 struct Type * destType = exp->destType;
14394 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14396 exp->member.member->classSym = exp->member.member->_class->symbol;
14398 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14402 ProcessExpressionType(exp);
14409 struct Symbol * classSym = exp->_class->symbol;
14411 if(classSym && classSym->registered)
14413 if(classSym->registered->type == 5)
14418 DeclareStruct(classSym->string, 0x0);
14419 FreeSpecifier(exp->_class);
14421 FullClassNameCat(name, classSym->string, 0x0);
14422 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14426 if(classSym->registered->fixed)
14428 FreeSpecifier(exp->_class);
14429 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14434 char className[1024];
14436 strcpy(className, "__ecereClass_");
14437 FullClassNameCat(className, classSym->string, 0x1);
14438 MangleClassName(className);
14439 DeclareClass(classSym, className);
14440 FreeExpContents(exp);
14442 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14443 exp->member.member = MkIdentifier("structSize");
14447 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14452 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14454 exp->expType = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), ((struct Type *)__ecereTemp1)->refCount = 1, ((struct Type *)__ecereTemp1)->kind = 3, ((struct Type *)__ecereTemp1));
14455 exp->isConstant = 0x1;
14456 DeclareType(type, 0x0, 0x0);
14462 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14464 type->count = (unsigned int)1;
14465 FreeType(exp->cast.exp->destType);
14466 exp->cast.exp->destType = type;
14468 ProcessExpressionType(exp->cast.exp);
14469 type->count = (unsigned int)0;
14470 exp->expType = type;
14471 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14473 void * prev = exp->prev, * next = exp->next;
14474 struct Type * expType = exp->cast.exp->destType;
14475 struct Expression * castExp = exp->cast.exp;
14476 struct Type * destType = exp->destType;
14479 expType->refCount++;
14480 FreeType(exp->expType);
14481 FreeTypeName(exp->cast.typeName);
14483 FreeType(exp->expType);
14484 FreeType(exp->destType);
14485 exp->expType = expType;
14486 exp->destType = destType;
14487 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14493 exp->isConstant = exp->cast.exp->isConstant;
14499 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14502 exp->expType = type;
14507 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14509 ProcessExpressionType(exp->vaArg.exp);
14511 exp->expType = type;
14516 struct Expression * e;
14518 exp->isConstant = 0x1;
14519 FreeType(exp->cond.cond->destType);
14520 exp->cond.cond->destType = MkClassType("bool");
14521 exp->cond.cond->destType->truth = 0x1;
14522 ProcessExpressionType(exp->cond.cond);
14523 if(!exp->cond.cond->isConstant)
14524 exp->isConstant = 0x0;
14525 for(e = (*exp->cond.exp).first; e; e = e->next)
14529 FreeType(e->destType);
14530 e->destType = exp->destType;
14532 e->destType->refCount++;
14534 ProcessExpressionType(e);
14537 exp->expType = e->expType;
14539 e->expType->refCount++;
14542 exp->isConstant = 0x0;
14544 FreeType(exp->cond.elseExp->destType);
14545 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14546 if(exp->cond.elseExp->destType)
14547 exp->cond.elseExp->destType->refCount++;
14548 ProcessExpressionType(exp->cond.elseExp);
14549 if(!exp->cond.elseExp->isConstant)
14550 exp->isConstant = 0x0;
14555 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14557 struct Statement * last = (*exp->compound->compound.statements).last;
14559 if(last->type == 3 && last->expressions && (*last->expressions).last)
14561 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14563 exp->destType->refCount++;
14565 ProcessStatement(exp->compound);
14566 exp->expType = ((struct Expression *)(*last->expressions).last)->expType;
14567 if(((struct Expression *)(*last->expressions).last)->expType)
14568 exp->expType->refCount++;
14574 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14576 if(spec && spec->type == 1)
14578 exp->expType = MkClassType(spec->name);
14579 exp->expType->kind = 19;
14580 exp->byReference = 0x1;
14584 exp->expType = MkClassType("ecere::com::Class");
14585 exp->byReference = 0x1;
14591 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14595 struct Identifier * id = exp->classData.id;
14596 char structName[1024];
14597 struct Expression * classExp;
14599 strcpy(structName, "__ecereClassData_");
14600 FullClassNameCat(structName, _class->fullName, 0x0);
14602 exp->member.member = id;
14603 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14604 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14606 classExp = MkExpIdentifier(MkIdentifier("class"));
14607 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"))))))));
14608 ProcessExpressionType(exp);
14615 struct Type * type = (((void *)0));
14616 char * typeString = (((void *)0));
14617 char typeStringBuf[1024];
14619 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))
14621 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14623 typeString = templateClass->templateArgs[2].dataTypeString;
14627 struct Expression * e;
14629 for(e = (*exp->list).first; e; e = e->next)
14631 ProcessExpressionType(e);
14641 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14645 e->expType = (((void *)0));
14646 e = (*exp->list).first;
14647 ProcessExpressionType(e);
14650 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14652 FreeType(e->expType);
14653 e->expType = (((void *)0));
14655 type = (((void *)0));
14663 FreeType(e->expType);
14664 e->expType = (((void *)0));
14670 typeStringBuf[0] = '\0';
14671 PrintType(type, typeStringBuf, 0x0, 0x1);
14672 typeString = typeStringBuf;
14674 type = (((void *)0));
14679 char templateString[1024];
14680 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14681 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14682 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14683 struct Expression * expExt;
14684 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14686 sprintf(templateString, "Container<%s>", typeString);
14689 struct Expression * e;
14691 type = ProcessTypeString(typeString, 0x0);
14692 while(e = (*exp->list).first)
14694 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14695 e->destType = type;
14697 ProcessExpressionType(e);
14698 ListAdd(initializers, MkInitializerAssignment(e));
14701 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14703 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14704 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14705 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14706 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14707 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14708 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14709 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14710 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14711 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14712 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))));
14713 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14714 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14715 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14716 exp->expType = ProcessTypeString(templateString, 0x0);
14718 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14719 ProcessExpressionType(expExt);
14723 exp->expType = ProcessTypeString("Container", 0x0);
14724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14729 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14731 FreeType(exp->expType);
14732 exp->expType = ReplaceThisClassType(thisClass);
14734 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14736 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14740 if(exp->expType->kind != 15)
14742 struct Type * member;
14743 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14745 FreeType(exp->expType);
14746 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14747 exp->expType->kind = symbol->type->kind;
14748 exp->expType->refCount++;
14749 exp->expType->enumName = enumName;
14750 exp->expType->members = symbol->type->members;
14751 for(member = symbol->type->members.first; member; member = member->next)
14752 member->refCount++;
14756 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14758 for(member = symbol->type->members.first; member; member = member->next)
14760 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14762 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14768 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14770 else if(exp->destType && !exp->destType->keepCast)
14772 if(!CheckExpressionType(exp, exp->destType, 0x0))
14774 if(!exp->destType->count || unresolved)
14779 if(exp->destType->kind != 14)
14786 char expString[10240];
14788 expString[0] = '\0';
14789 PrintType(exp->destType, type2, 0x0, 0x1);
14792 PrintExpression(exp, expString);
14793 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14796 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14797 else if(exp->type != 16)
14798 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14803 char expString[10240];
14805 expString[0] = '\0';
14808 PrintExpression(exp, expString);
14809 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14812 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14813 else if(exp->type != 16)
14814 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14826 PrintType(exp->expType, type1, 0x0, 0x1);
14827 PrintType(exp->destType, type2, 0x0, 0x1);
14829 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)))
14833 char expString[10240];
14835 expString[0] = '\0';
14838 PrintExpression(exp, expString);
14839 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14841 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14842 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14843 FreeType(exp->expType);
14844 exp->destType->refCount++;
14845 exp->expType = exp->destType;
14850 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14852 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14853 char typeString[1024];
14854 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14855 struct Declarator * decl;
14857 typeString[0] = '\0';
14860 exp->expType->refCount++;
14862 exp->expType->refCount++;
14864 newExp->destType = exp->expType;
14865 PrintType(exp->expType, typeString, 0x0, 0x0);
14866 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14867 exp->cast.typeName = MkTypeName(specs, decl);
14868 exp->cast.exp = newExp;
14871 else if(unresolved)
14873 if(exp->identifier->_class && exp->identifier->_class->name)
14874 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14875 else if(exp->identifier->string && exp->identifier->string[0])
14876 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14878 else if(!exp->expType && exp->type != 16)
14880 char expString[10240];
14882 expString[0] = '\0';
14885 PrintExpression(exp, expString);
14886 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14888 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14890 ApplyAnyObjectLogic(exp);
14891 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14893 exp->byReference = 0x1;
14895 yylloc = oldyylloc;
14898 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)
14902 *curMember = (*curMember)->next;
14903 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14905 *curMember = subMemberStack[--(*subMemberStackPos)];
14906 *curMember = (*curMember)->next;
14908 while((*curMember) && (*curMember)->isProperty)
14909 *curMember = (*curMember)->next;
14910 if(subMemberStackPos)
14912 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14914 subMemberStack[(*subMemberStackPos)++] = *curMember;
14915 *curMember = (*curMember)->members.first;
14916 while(*curMember && (*curMember)->isProperty)
14917 *curMember = (*curMember)->next;
14925 if(subMemberStackPos && *subMemberStackPos)
14927 *curMember = subMemberStack[--(*subMemberStackPos)];
14928 *curMember = (*curMember)->next;
14932 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
14934 if(*curClass == _class)
14936 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
14938 *curMember = (*curClass)->membersAndProperties.first;
14940 while((*curMember) && (*curMember)->isProperty)
14941 *curMember = (*curMember)->next;
14942 if(subMemberStackPos)
14944 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
14946 subMemberStack[(*subMemberStackPos)++] = *curMember;
14947 *curMember = (*curMember)->members.first;
14948 while(*curMember && (*curMember)->isProperty)
14949 *curMember = (*curMember)->next;
14956 static void ProcessInitializer(struct Initializer * init, struct Type * type)
14961 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
14963 if(init->exp && !init->exp->destType)
14965 FreeType(init->exp->destType);
14966 init->exp->destType = type;
14972 ProcessExpressionType(init->exp);
14973 init->isConstant = init->exp->isConstant;
14979 struct Expression * exp = init->exp;
14980 struct Instantiation * inst = exp->instance;
14981 struct MembersInit * members;
14984 init->list = MkList();
14987 for(members = (*inst->members).first; members; members = members->next)
14989 if(members->type == 0)
14991 struct MemberInit * member;
14993 for(member = (*members->dataMembers).first; member; member = member->next)
14995 ListAdd(init->list, member->initializer);
14996 member->initializer = (((void *)0));
15001 FreeExpression(exp);
15005 struct Initializer * i;
15006 struct Type * initializerType = (((void *)0));
15007 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15008 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15009 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15010 int subMemberStackPos = 0;
15012 if(type && type->kind == 12)
15013 initializerType = Dereference(type);
15014 else if(type && (type->kind == 9 || type->kind == 10))
15015 initializerType = type->members.first;
15016 for(i = (*init->list).first; i; i = i->next)
15018 if(type && type->kind == 8 && type->_class && type->_class->registered)
15020 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15023 if(!curMember->dataType)
15024 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15025 initializerType = curMember->dataType;
15028 ProcessInitializer(i, initializerType);
15029 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15030 initializerType = initializerType->next;
15032 init->isConstant = 0x0;
15034 if(type && type->kind == 12)
15035 FreeType(initializerType);
15036 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15038 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15045 extern struct Symbol * FindType(struct Context * ctx, char * name);
15047 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15049 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15055 if(spec->specifier == THISCLASS)
15060 spec->name = ReplaceThisClass(thisClass);
15061 spec->symbol = FindClass(spec->name);
15062 ProcessSpecifier(spec, declareStruct);
15069 struct Symbol * symbol = FindType(curContext, spec->name);
15072 DeclareType(symbol->type, 0x1, 0x1);
15073 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15074 DeclareStruct(spec->name, 0x0);
15079 struct Enumerator * e;
15083 for(e = (*spec->list).first; e; e = e->next)
15086 ProcessExpressionType(e->exp);
15094 if(spec->definitions)
15096 struct ClassDef * def;
15097 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15099 ProcessClass(spec->definitions, symbol);
15106 static void ProcessDeclarator(struct Declarator * decl)
15111 if(decl->identifier->classSym)
15113 FreeSpecifier(decl->identifier->_class);
15114 decl->identifier->_class = (((void *)0));
15118 if(decl->array.exp)
15119 ProcessExpressionType(decl->array.exp);
15126 if(decl->declarator)
15127 ProcessDeclarator(decl->declarator);
15128 if(decl->type == 4)
15130 struct Identifier * id = GetDeclId(decl);
15132 if(id && id->_class)
15134 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15136 if(!decl->function.parameters)
15137 decl->function.parameters = MkList();
15138 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15139 id->_class = (((void *)0));
15141 if(decl->function.parameters)
15143 struct TypeName * param;
15145 for(param = (*decl->function.parameters).first; param; param = param->next)
15147 if(param->qualifiers && (*param->qualifiers).first)
15149 struct Specifier * spec = (*param->qualifiers).first;
15151 if(spec && spec->specifier == TYPED_OBJECT)
15153 struct Declarator * d = param->declarator;
15154 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);
15156 FreeList(param->qualifiers, FreeSpecifier);
15157 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15158 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15159 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15162 else if(spec && spec->specifier == ANY_OBJECT)
15164 struct Declarator * d = param->declarator;
15166 FreeList(param->qualifiers, FreeSpecifier);
15167 param->qualifiers = MkListOne(MkSpecifier(VOID));
15168 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15170 else if(spec->specifier == THISCLASS)
15175 spec->name = ReplaceThisClass(thisClass);
15176 spec->symbol = FindClass(spec->name);
15177 ProcessSpecifier(spec, 0x0);
15181 if(param->declarator)
15182 ProcessDeclarator(param->declarator);
15190 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15192 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15194 static void ProcessDeclaration(struct Declaration * decl)
15196 yylloc = decl->loc;
15201 unsigned int declareStruct = 0x0;
15203 if(decl->declarators)
15205 struct InitDeclarator * d;
15207 for(d = (*decl->declarators).first; d; d = d->next)
15209 struct Type * type, * subType;
15211 ProcessDeclarator(d->declarator);
15212 type = ProcessType(decl->specifiers, d->declarator);
15215 ProcessInitializer(d->initializer, type);
15216 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15218 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15220 struct Instantiation * inst = d->initializer->exp->instance;
15222 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15223 d->initializer->exp->instance = (((void *)0));
15224 if(decl->specifiers)
15225 FreeList(decl->specifiers, FreeSpecifier);
15226 FreeList(decl->declarators, FreeInitDeclarator);
15233 for(subType = type; subType; )
15235 if(subType->kind == 8)
15237 declareStruct = 0x1;
15240 else if(subType->kind == 13)
15242 else if(subType->kind == 12)
15243 subType = subType->arrayType;
15252 if(decl->specifiers)
15254 struct Specifier * s;
15256 for(s = (*decl->specifiers).first; s; s = s->next)
15258 ProcessSpecifier(s, declareStruct);
15265 ProcessInstantiationType(decl->inst);
15270 struct Specifier * spec;
15271 struct Declarator * d;
15272 unsigned int declareStruct = 0x0;
15274 if(decl->declarators)
15276 for(d = (*decl->declarators).first; d; d = d->next)
15278 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15279 struct Type * subType;
15281 ProcessDeclarator(d);
15282 for(subType = type; subType; )
15284 if(subType->kind == 8)
15286 declareStruct = 0x1;
15289 else if(subType->kind == 13)
15291 else if(subType->kind == 12)
15292 subType = subType->arrayType;
15299 if(decl->specifiers)
15301 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15302 ProcessSpecifier(spec, declareStruct);
15309 static struct FunctionDefinition * curFunction;
15311 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15313 char propName[1024], propNameM[1024];
15314 char getName[1024], setName[1024];
15315 struct __ecereNameSpace__ecere__sys__OldList * args;
15317 DeclareProperty(prop, setName, getName);
15318 strcpy(propName, "__ecereProp_");
15319 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15320 strcat(propName, "_");
15321 FullClassNameCat(propName, prop->name, 0x1);
15322 MangleClassName(propName);
15323 strcpy(propNameM, "__ecerePropM_");
15324 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15325 strcat(propNameM, "_");
15326 FullClassNameCat(propNameM, prop->name, 0x1);
15327 MangleClassName(propNameM);
15328 if(prop->isWatchable)
15331 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15332 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15333 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15335 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15336 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15337 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15341 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15342 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15343 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15345 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15346 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15347 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15349 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15350 curFunction->propSet->fireWatchersDone = 0x1;
15353 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15355 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15357 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15359 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15361 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15363 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15365 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15367 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15369 static void ProcessStatement(struct Statement * stmt)
15371 yylloc = stmt->loc;
15375 ProcessStatement(stmt->labeled.stmt);
15378 if(stmt->caseStmt.exp)
15380 FreeType(stmt->caseStmt.exp->destType);
15381 stmt->caseStmt.exp->destType = curSwitchType;
15383 curSwitchType->refCount++;
15384 ProcessExpressionType(stmt->caseStmt.exp);
15385 ComputeExpression(stmt->caseStmt.exp);
15387 if(stmt->caseStmt.stmt)
15388 ProcessStatement(stmt->caseStmt.stmt);
15392 if(stmt->compound.context)
15394 struct Declaration * decl;
15395 struct Statement * s;
15396 struct Statement * prevCompound = curCompound;
15397 struct Context * prevContext = curContext;
15399 if(!stmt->compound.isSwitch)
15401 curCompound = stmt;
15402 curContext = stmt->compound.context;
15404 if(stmt->compound.declarations)
15406 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15407 ProcessDeclaration(decl);
15409 if(stmt->compound.statements)
15411 for(s = (*stmt->compound.statements).first; s; s = s->next)
15412 ProcessStatement(s);
15414 curContext = prevContext;
15415 curCompound = prevCompound;
15421 struct Expression * exp;
15423 if(stmt->expressions)
15425 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15426 ProcessExpressionType(exp);
15432 struct Expression * exp;
15434 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15435 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15436 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15437 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15439 ProcessExpressionType(exp);
15441 if(stmt->ifStmt.stmt)
15442 ProcessStatement(stmt->ifStmt.stmt);
15443 if(stmt->ifStmt.elseStmt)
15444 ProcessStatement(stmt->ifStmt.elseStmt);
15449 struct Type * oldSwitchType = curSwitchType;
15451 if(stmt->switchStmt.exp)
15453 struct Expression * exp;
15455 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15459 ProcessExpressionType(exp);
15462 curSwitchType = exp->expType;
15465 ProcessStatement(stmt->switchStmt.stmt);
15466 curSwitchType = oldSwitchType;
15471 if(stmt->whileStmt.exp)
15473 struct Expression * exp;
15475 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15476 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15477 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15478 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15480 ProcessExpressionType(exp);
15483 if(stmt->whileStmt.stmt)
15484 ProcessStatement(stmt->whileStmt.stmt);
15489 if(stmt->doWhile.exp)
15491 struct Expression * exp;
15493 if((*stmt->doWhile.exp).last)
15495 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15496 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15497 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15499 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15501 ProcessExpressionType(exp);
15504 if(stmt->doWhile.stmt)
15505 ProcessStatement(stmt->doWhile.stmt);
15510 struct Expression * exp;
15512 if(stmt->forStmt.init)
15513 ProcessStatement(stmt->forStmt.init);
15514 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15516 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15517 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15518 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15520 if(stmt->forStmt.check)
15521 ProcessStatement(stmt->forStmt.check);
15522 if(stmt->forStmt.increment)
15524 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15525 ProcessExpressionType(exp);
15527 if(stmt->forStmt.stmt)
15528 ProcessStatement(stmt->forStmt.stmt);
15533 struct Identifier * id = stmt->forEachStmt.id;
15534 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15535 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15536 struct Statement * block = stmt->forEachStmt.stmt;
15537 char iteratorType[1024];
15538 struct Type * source;
15539 struct Expression * e;
15540 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));
15541 struct Expression * arrayExp;
15542 char * typeString = (((void *)0));
15543 int builtinCount = 0;
15545 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15549 FreeType(e->destType);
15550 e->destType = ProcessTypeString("Container", 0x0);
15552 if(!isBuiltin || e->next)
15553 ProcessExpressionType(e);
15555 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15556 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15558 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15559 struct Symbol * symbol;
15560 struct Expression * expIt = (((void *)0));
15561 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15562 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15563 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15564 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15567 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15568 stmt->compound.context->parent = curContext;
15569 curContext = stmt->compound.context;
15570 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15572 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15573 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15575 isCustomAVLTree = 0x1;
15576 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15578 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15581 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15583 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15585 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15588 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15592 struct Declarator * decl;
15593 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15595 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15596 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15597 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15601 struct Type * type = (((void *)0));
15602 char typeStringBuf[1024];
15604 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15605 if(((struct Expression *)(*exp).last)->type == 11)
15607 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15610 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15612 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)
15614 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15616 typeString = templateClass->templateArgs[2].dataTypeString;
15618 else if(arrayExp->list)
15620 struct Expression * e;
15622 for(e = (*arrayExp->list).first; e; e = e->next)
15624 ProcessExpressionType(e);
15634 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15638 e->expType = (((void *)0));
15639 e = (*arrayExp->list).first;
15640 ProcessExpressionType(e);
15643 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15645 FreeType(e->expType);
15646 e->expType = (((void *)0));
15648 type = (((void *)0));
15656 FreeType(e->expType);
15657 e->expType = (((void *)0));
15663 typeStringBuf[0] = '\0';
15664 PrintType(type, typeStringBuf, 0x0, 0x1);
15665 typeString = typeStringBuf;
15671 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15672 struct Declarator * decl;
15673 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15677 struct Expression * e;
15679 builtinCount = (*arrayExp->list).count;
15680 type = ProcessTypeString(typeString, 0x0);
15681 while(e = (*arrayExp->list).first)
15683 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15684 e->destType = type;
15686 ProcessExpressionType(e);
15687 ListAdd(initializers, MkInitializerAssignment(e));
15690 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15692 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15693 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15694 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15695 FreeList(exp, FreeExpression);
15699 arrayExp->expType = ProcessTypeString("Container", 0x0);
15700 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15703 else if(isLinkList && !isList)
15705 struct Declarator * decl;
15706 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15708 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15709 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15710 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15712 else if(_class->templateArgs)
15715 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15717 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15718 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15720 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15721 if(block && block->type == 2 && block->compound.context)
15723 block->compound.context->parent = stmt->compound.context;
15727 block = MkIfStmt(filter, block, (((void *)0)));
15731 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));
15732 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15733 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15734 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15740 sprintf(count, "%d", builtinCount);
15741 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));
15742 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15743 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15744 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15746 else if(isLinkList && !isList)
15748 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15749 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15751 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
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)), '=', MkExpMember(MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("next")))), block));
15757 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15758 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15760 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));
15762 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15763 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15764 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15768 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15770 ProcessExpressionType(expIt);
15771 if((*stmt->compound.declarations).first)
15772 ProcessDeclaration((*stmt->compound.declarations).first);
15774 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15775 ProcessStatement(stmt);
15776 curContext = stmt->compound.context->parent;
15781 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15793 struct Expression * exp;
15795 if(stmt->expressions)
15797 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15801 if(curFunction && !curFunction->type)
15802 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15803 FreeType(exp->destType);
15804 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15806 exp->destType->refCount++;
15808 ProcessExpressionType(exp);
15815 ProcessDeclaration(stmt->decl);
15820 struct AsmField * field;
15822 if(stmt->asmStmt.inputFields)
15824 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15825 if(field->expression)
15826 ProcessExpressionType(field->expression);
15828 if(stmt->asmStmt.outputFields)
15830 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15831 if(field->expression)
15832 ProcessExpressionType(field->expression);
15834 if(stmt->asmStmt.clobberedFields)
15836 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15838 if(field->expression)
15839 ProcessExpressionType(field->expression);
15846 struct PropertyWatch * propWatch;
15847 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15848 struct Expression * object = stmt->_watch.object;
15849 struct Expression * watcher = stmt->_watch.watcher;
15852 ProcessExpressionType(watcher);
15854 ProcessExpressionType(object);
15857 if(watcher || thisClass)
15859 struct External * external = curExternal;
15860 struct Context * context = curContext;
15863 stmt->expressions = MkList();
15864 curExternal = external->prev;
15865 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15867 struct ClassFunction * func;
15868 char watcherName[1024];
15869 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15870 struct External * createdExternal;
15871 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15873 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15874 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15875 if(propWatch->deleteWatch)
15876 strcat(watcherName, "_delete");
15879 struct Identifier * propID;
15881 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15883 strcat(watcherName, "_");
15884 strcat(watcherName, propID->string);
15887 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15889 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15890 ProcessClassFunctionBody(func, propWatch->compound);
15891 propWatch->compound = (((void *)0));
15892 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15893 createdExternal->symbol->idCode = external->symbol->idCode;
15894 curExternal = createdExternal;
15895 ProcessFunction(createdExternal->function);
15897 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15899 externalDecl->declaration = decl;
15900 if(decl->symbol && !decl->symbol->pointerExternal)
15901 decl->symbol->pointerExternal = externalDecl;
15903 if(propWatch->deleteWatch)
15905 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15907 ListAdd(args, CopyExpression(object));
15908 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15909 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15910 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
15914 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
15915 struct Identifier * propID;
15917 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15919 char propName[1024];
15920 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15924 char getName[1024], setName[1024];
15925 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15927 DeclareProperty(prop, setName, getName);
15928 strcpy(propName, "__ecereProp_");
15929 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15930 strcat(propName, "_");
15931 FullClassNameCat(propName, prop->name, 0x1);
15932 ListAdd(args, CopyExpression(object));
15933 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15934 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15935 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
15936 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
15939 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
15944 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
15946 curExternal = external;
15947 curContext = context;
15949 FreeExpression(watcher);
15951 FreeExpression(object);
15952 FreeList(watches, FreePropertyWatch);
15955 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
15959 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15961 ProcessStatement(propWatch->compound);
15968 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15969 struct Expression * object = stmt->_watch.object;
15970 struct __ecereNameSpace__ecere__com__Class * _class;
15973 ProcessExpressionType(object);
15976 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
15979 struct Identifier * propID;
15982 stmt->expressions = MkList();
15983 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15985 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
15992 for(propID = (*watches).first; propID; propID = propID->next)
15994 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
15998 CreateFireWatcher(prop, object, stmt);
16001 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16006 struct __ecereNameSpace__ecere__com__Property * prop;
16007 struct __ecereNameSpace__ecere__com__Class * base;
16009 for(base = _class; base; base = base->base)
16011 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16013 if(prop->isProperty && prop->isWatchable)
16015 CreateFireWatcher(prop, object, stmt);
16021 FreeExpression(object);
16022 FreeList(watches, FreeIdentifier);
16025 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16031 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16032 struct Expression * object = stmt->_watch.object;
16033 struct Expression * watcher = stmt->_watch.watcher;
16034 struct __ecereNameSpace__ecere__com__Class * _class;
16037 ProcessExpressionType(object);
16039 ProcessExpressionType(watcher);
16042 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16043 if(watcher || thisClass)
16047 struct Identifier * propID;
16050 stmt->expressions = MkList();
16053 struct __ecereNameSpace__ecere__sys__OldList * args;
16056 ListAdd(args, CopyExpression(object));
16057 ListAdd(args, MkExpConstant("0"));
16058 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16059 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16063 for(propID = (*watches).first; propID; propID = propID->next)
16065 char propName[1024];
16066 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16070 char getName[1024], setName[1024];
16071 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16073 DeclareProperty(prop, setName, getName);
16074 strcpy(propName, "__ecereProp_");
16075 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16076 strcat(propName, "_");
16077 FullClassNameCat(propName, prop->name, 0x1);
16078 MangleClassName(propName);
16079 ListAdd(args, CopyExpression(object));
16080 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16081 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16082 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16085 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16089 FreeExpression(object);
16091 FreeExpression(watcher);
16092 FreeList(watches, FreeIdentifier);
16095 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16098 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16105 extern struct Expression * QBrackets(struct Expression * exp);
16107 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16109 extern struct Declarator * QMkPtrDecl(char * id);
16111 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16113 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16115 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16117 static void ProcessFunction(struct FunctionDefinition * function)
16119 void * __ecereTemp2;
16120 void * __ecereTemp1;
16121 struct Identifier * id = GetDeclId(function->declarator);
16122 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16123 struct Type * type = symbol ? symbol->type : (((void *)0));
16124 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16125 struct Context * oldTopContext = topContext;
16127 yylloc = function->loc;
16128 if(type && type->thisClass)
16130 struct Symbol * classSym = type->thisClass;
16131 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16132 char className[1024];
16133 char structName[1024];
16134 struct Declarator * funcDecl;
16135 struct Symbol * thisSymbol;
16136 unsigned int typedObject = 0x0;
16138 if(_class && !_class->base)
16140 _class = currentClass;
16141 if(_class && !_class->symbol)
16142 _class->symbol = FindClass(_class->fullName);
16143 classSym = _class ? _class->symbol : (((void *)0));
16146 thisClass = _class;
16147 if(inCompiler && _class)
16149 if(type->kind == 11)
16151 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16153 struct Type * param = symbol->type->params.first;
16155 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16158 if(type->classObjectType != 1)
16160 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16161 symbol->type->staticMethod = 0x1;
16162 symbol->type->thisClass = (((void *)0));
16163 symbol->type->extraParam = 0x0;
16166 strcpy(className, "__ecereClass_");
16167 FullClassNameCat(className, _class->fullName, 0x1);
16168 MangleClassName(className);
16169 structName[0] = (char)0;
16170 FullClassNameCat(structName, _class->fullName, 0x0);
16171 funcDecl = GetFuncDecl(function->declarator);
16174 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16176 struct TypeName * param = (*funcDecl->function.parameters).first;
16178 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16180 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16181 FreeTypeName(param);
16184 if(!function->propertyNoThis)
16186 struct TypeName * thisParam;
16188 if(type->classObjectType != 1)
16190 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16191 if(!funcDecl->function.parameters)
16192 funcDecl->function.parameters = MkList();
16193 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16197 if(type->classObjectType != 1)
16199 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16200 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16202 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));
16203 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16207 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16209 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16211 funcDecl = GetFuncDecl(initDecl->declarator);
16214 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16216 struct TypeName * param = (*funcDecl->function.parameters).first;
16218 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16220 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16221 FreeTypeName(param);
16224 if(type->classObjectType != 1)
16226 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16228 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16230 if(!funcDecl->function.parameters)
16231 funcDecl->function.parameters = MkList();
16232 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16240 if(type->classObjectType != 1)
16242 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));
16243 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16244 if(typedObject && thisSymbol->type)
16246 thisSymbol->type->classObjectType = 2;
16247 thisSymbol->type->byReference = type->byReference;
16251 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16253 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16256 struct __ecereNameSpace__ecere__com__Class * base;
16258 for(base = _class; base && base->type != 1000; base = base->next)
16260 for(member = base->membersAndProperties.first; member; member = member->next)
16261 if(!member->isProperty)
16267 for(member = _class->membersAndProperties.first; member; member = member->next)
16268 if(!member->isProperty)
16272 char pointerName[1024];
16273 struct Declaration * decl;
16274 struct Initializer * initializer;
16275 struct Expression * exp, * bytePtr;
16277 strcpy(pointerName, "__ecerePointer_");
16278 FullClassNameCat(pointerName, _class->fullName, 0x0);
16280 char className[1024];
16282 strcpy(className, "__ecereClass_");
16283 FullClassNameCat(className, classSym->string, 0x1);
16284 MangleClassName(className);
16285 DeclareClass(classSym, className);
16287 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16292 sprintf(string, "%d", _class->offset);
16293 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16297 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16299 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16300 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));
16303 yylloc = function->body->loc;
16304 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16306 struct Context * prevContext = curContext;
16308 curContext = function->body->compound.context;
16309 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16310 curContext = prevContext;
16312 decl->symbol = (((void *)0));
16313 if(!function->body->compound.declarations)
16314 function->body->compound.declarations = MkList();
16315 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16321 thisClass = (((void *)0));
16324 FreeSpecifier(id->_class);
16325 id->_class = (((void *)0));
16326 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16328 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16330 id = GetDeclId(initDecl->declarator);
16331 FreeSpecifier(id->_class);
16332 id->_class = (((void *)0));
16336 topContext = function->body->compound.context;
16338 struct FunctionDefinition * oldFunction = curFunction;
16340 curFunction = function;
16342 ProcessStatement(function->body);
16343 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16345 struct Statement * prevCompound = curCompound;
16346 struct Context * prevContext = curContext;
16347 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16349 if(!function->body->compound.statements)
16350 function->body->compound.statements = MkList();
16351 ListAdd(function->body->compound.statements, fireWatchers);
16352 curCompound = function->body;
16353 curContext = function->body->compound.context;
16354 ProcessStatement(fireWatchers);
16355 curContext = prevContext;
16356 curCompound = prevCompound;
16358 curFunction = oldFunction;
16360 if(function->declarator)
16362 ProcessDeclarator(function->declarator);
16364 topContext = oldTopContext;
16365 thisClass = oldThisClass;
16368 extern void FreeSymbol(struct Symbol * symbol);
16370 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16372 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16374 struct ClassDef * def;
16375 struct External * external = curExternal;
16376 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16378 for(def = definitions->first; def; def = def->next)
16382 if(def->function->declarator)
16383 curExternal = def->function->declarator->symbol->pointerExternal;
16385 curExternal = external;
16386 ProcessFunction((struct FunctionDefinition *)def->function);
16388 else if(def->type == 2)
16390 if(def->decl->type == 2)
16392 thisClass = regClass;
16393 ProcessInstantiationType(def->decl->inst);
16394 thisClass = (((void *)0));
16398 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16401 thisClass = regClass;
16402 ProcessDeclaration(def->decl);
16403 thisClass = backThisClass;
16406 else if(def->type == 1 && def->defProperties)
16408 struct MemberInit * defProperty;
16409 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);
16411 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16412 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16414 thisClass = regClass;
16415 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16416 thisClass = (((void *)0));
16418 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16419 FreeSymbol(thisSymbol);
16421 else if(def->type == 3 && def->propertyDef)
16423 struct PropertyDef * prop = def->propertyDef;
16425 thisClass = regClass;
16430 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16432 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16434 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16435 ProcessStatement(prop->setStmt);
16441 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16443 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16445 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16446 ProcessStatement(prop->getStmt);
16448 if(prop->issetStmt)
16452 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16454 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16456 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16457 ProcessStatement(prop->issetStmt);
16459 thisClass = (((void *)0));
16461 else if(def->type == 4 && def->propertyWatch)
16463 struct PropertyWatch * propertyWatch = def->propertyWatch;
16465 thisClass = regClass;
16466 if(propertyWatch->compound)
16468 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);
16470 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16471 curExternal = (((void *)0));
16472 ProcessStatement(propertyWatch->compound);
16474 thisClass = (((void *)0));
16479 void DeclareFunctionUtil(char * s)
16481 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16488 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16489 strcpy(name, "__ecereFunction_");
16490 FullClassNameCat(name, s, 0x0);
16491 DeclareFunction(function, name);
16495 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16497 void ComputeDataTypes()
16499 void * __ecereTemp1;
16500 struct External * external;
16501 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16502 struct External * after = (((void *)0));
16504 currentClass = (((void *)0));
16505 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16506 for(external = (*ast).first; external; external = external->next)
16508 if(external->type == 1)
16510 struct Declaration * decl = external->declaration;
16514 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16518 struct InitDeclarator * initDecl = (*decls).first;
16522 struct Declarator * declarator = initDecl->declarator;
16524 if(declarator && declarator->type == 1)
16526 struct Identifier * id = declarator->identifier;
16528 if(id && id->string)
16530 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16532 external->symbol->id = -1001, external->symbol->idCode = -1001;
16542 temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
16543 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16544 curExternal = temp;
16545 DeclareFunctionUtil("eSystem_New");
16546 DeclareFunctionUtil("eSystem_New0");
16547 DeclareFunctionUtil("eSystem_Renew");
16548 DeclareFunctionUtil("eSystem_Renew0");
16549 DeclareFunctionUtil("eClass_GetProperty");
16550 DeclareStruct("ecere::com::Class", 0x0);
16551 DeclareStruct("ecere::com::Instance", 0x0);
16552 DeclareStruct("ecere::com::Property", 0x0);
16553 DeclareStruct("ecere::com::DataMember", 0x0);
16554 DeclareStruct("ecere::com::Method", 0x0);
16555 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16556 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16557 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16558 for(external = (*ast).first; external; external = external->next)
16560 afterExternal = curExternal = external;
16561 if(external->type == 0)
16563 currentClass = external->function->_class;
16564 ProcessFunction(external->function);
16566 else if(external->type == 1)
16568 currentClass = (((void *)0));
16569 ProcessDeclaration(external->declaration);
16571 else if(external->type == 2)
16573 struct ClassDefinition * _class = external->_class;
16575 currentClass = external->symbol->registered;
16576 if(_class->definitions)
16578 ProcessClass(_class->definitions, _class->symbol);
16582 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16583 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16586 else if(external->type == 4)
16588 thisNameSpace = external->id->string;
16591 currentClass = (((void *)0));
16592 thisNameSpace = (((void *)0));
16593 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16594 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16597 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);
16599 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);
16601 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16603 struct __ecereNameSpace__ecere__com__Class * class;
16605 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16606 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16607 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16608 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16609 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16610 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16611 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16612 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16613 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16614 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16615 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16616 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16617 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16618 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16619 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16620 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16621 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16622 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16623 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16624 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16625 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16626 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16627 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16628 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16629 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16630 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16631 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16632 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16633 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16634 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16635 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16636 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16637 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16638 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16639 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16640 __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);
16641 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16642 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16643 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16644 __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);
16645 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16646 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16647 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16648 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16649 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16650 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16651 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16652 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16653 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16654 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16655 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16656 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16657 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16658 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16659 __ecereClass_Conversion = class;
16660 __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);
16661 __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);
16662 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16663 __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);
16664 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16665 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16666 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16667 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16668 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16669 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16670 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16671 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16672 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16673 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16674 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16675 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16676 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16677 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16678 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16679 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16680 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16683 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)