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 struct Symbol * symbol = prop->symbol;
3088 char propName[1024];
3090 strcpy(setName, "__ecereProp_");
3091 FullClassNameCat(setName, prop->_class->fullName, 0x0);
3092 strcat(setName, "_Set_");
3093 FullClassNameCat(setName, prop->name, 0x1);
3094 strcpy(getName, "__ecereProp_");
3095 FullClassNameCat(getName, prop->_class->fullName, 0x0);
3096 strcat(getName, "_Get_");
3097 FullClassNameCat(getName, prop->name, 0x1);
3098 strcpy(propName, "__ecereProp_");
3099 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3100 strcat(propName, "_");
3101 FullClassNameCat(propName, prop->name, 0x1);
3102 MangleClassName(getName);
3103 MangleClassName(setName);
3104 MangleClassName(propName);
3105 if(prop->_class->type == 1)
3106 DeclareStruct(prop->_class->fullName, 0x0);
3107 if(!symbol || curExternal->symbol->idCode < symbol->id)
3109 unsigned int imported = 0x0;
3110 unsigned int dllImport = 0x0;
3112 if(!symbol || symbol->_import)
3116 struct Symbol * classSym;
3118 if(!prop->_class->symbol)
3119 prop->_class->symbol = FindClass(prop->_class->fullName);
3120 classSym = prop->_class->symbol;
3121 if(classSym && !classSym->_import)
3123 struct ModuleImport * module;
3125 if(prop->_class->module)
3126 module = FindModule(prop->_class->module);
3128 module = mainModule;
3129 classSym->_import = __extension__ ({
3130 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
3132 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->_class->fullName), __ecereInstance1->isRemote = prop->_class->isRemote, __ecereInstance1;
3134 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
3136 symbol = prop->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
3137 symbol->_import = (struct ClassImport *)__extension__ ({
3138 struct PropertyImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_PropertyImport);
3140 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(prop->name), __ecereInstance1->isVirtual = 0x0, __ecereInstance1->hasSet = prop->Set ? 0x1 : 0x0, __ecereInstance1->hasGet = prop->Get ? 0x1 : 0x0, __ecereInstance1;
3143 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->properties, symbol->_import);
3146 if(prop->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)prop->_class->module + structSize_Instance)))->importType != 1)
3151 struct Context * context = SetupTemplatesContext(prop->_class);
3153 symbol->type = ProcessTypeString(prop->dataTypeString, 0x0);
3154 FinishTemplatesContext(context);
3158 if(!symbol->externalGet || symbol->externalGet->type == 0)
3160 struct Declaration * decl;
3161 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3162 struct Declarator * d;
3163 struct __ecereNameSpace__ecere__sys__OldList * params;
3164 struct Specifier * spec;
3165 struct External * external;
3166 struct Declarator * typeDecl;
3167 unsigned int simple = 0x0;
3169 specifiers = MkList();
3170 declarators = MkList();
3172 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3173 d = MkDeclaratorIdentifier(MkIdentifier(getName));
3175 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3177 struct Context * context = SetupTemplatesContext(prop->_class);
3179 typeDecl = SpecDeclFromString(prop->dataTypeString, specifiers, (((void *)0)));
3180 FinishTemplatesContext(context);
3182 for(spec = (*specifiers).first; spec; spec = spec->next)
3186 if((!typeDecl || typeDecl->type == 1))
3188 struct Symbol * classSym = spec->symbol;
3190 symbol->_class = classSym->registered;
3191 if(classSym->registered && classSym->registered->type == 1)
3193 DeclareStruct(spec->name, 0x0);
3200 d = PlugDeclarator(typeDecl, d);
3203 ListAdd(params, MkTypeName(specifiers, PlugDeclarator(typeDecl, MkDeclaratorIdentifier(MkIdentifier("value")))));
3204 specifiers = MkList();
3206 d = MkDeclaratorFunction(d, params);
3208 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3209 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3210 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3212 ListAdd(specifiers, MkSpecifier(VOID));
3213 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3214 decl = MkDeclaration(specifiers, declarators);
3215 external = MkExternalDeclaration(decl);
3216 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3217 external->symbol = symbol;
3218 symbol->externalGet = external;
3219 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3221 FreeDeclarator(typeDecl);
3225 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalGet, curExternal->prev);
3230 if(!symbol->externalSet || symbol->externalSet->type == 0)
3232 struct Declaration * decl;
3233 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
3234 struct Declarator * d;
3235 struct __ecereNameSpace__ecere__sys__OldList * params;
3236 struct Specifier * spec;
3237 struct External * external;
3238 struct Declarator * typeDecl;
3240 declarators = MkList();
3242 if(!prop->conversion || prop->_class->type == 1)
3244 ListAdd(params, MkTypeName(MkListOne(MkSpecifierName(prop->_class->fullName)), MkDeclaratorIdentifier(MkIdentifier("this"))));
3246 specifiers = MkList();
3248 struct Context * context = SetupTemplatesContext(prop->_class);
3250 typeDecl = d = SpecDeclFromString(prop->dataTypeString, specifiers, MkDeclaratorIdentifier(MkIdentifier("value")));
3251 FinishTemplatesContext(context);
3253 ListAdd(params, MkTypeName(specifiers, d));
3254 d = MkDeclaratorIdentifier(MkIdentifier(setName));
3256 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
3257 d = MkDeclaratorFunction(d, params);
3258 for(spec = (*specifiers).first; spec; spec = spec->next)
3262 if((!typeDecl || typeDecl->type == 1))
3264 struct Symbol * classSym = spec->symbol;
3266 symbol->_class = classSym->registered;
3267 if(classSym->registered && classSym->registered->type == 1)
3268 DeclareStruct(spec->name, 0x0);
3272 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
3273 specifiers = MkList();
3275 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3276 else if(prop->_class->symbol && ((struct Symbol *)prop->_class->symbol)->isStatic)
3277 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3278 if(!prop->conversion || prop->_class->type == 1)
3279 ListAdd(specifiers, MkSpecifier(VOID));
3281 ListAdd(specifiers, MkSpecifierName(prop->_class->fullName));
3282 decl = MkDeclaration(specifiers, declarators);
3283 external = MkExternalDeclaration(decl);
3284 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3285 external->symbol = symbol;
3286 symbol->externalSet = external;
3287 ReplaceThisClassSpecifiers(specifiers, prop->_class);
3291 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalSet, curExternal->prev);
3294 if(!symbol->externalPtr)
3296 struct Declaration * decl;
3297 struct External * external;
3298 struct __ecereNameSpace__ecere__sys__OldList * specifiers = MkList();
3301 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(EXTERN));
3303 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*specifiers), (((void *)0)), MkSpecifier(STATIC));
3304 ListAdd(specifiers, MkSpecifierName("Property"));
3306 struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
3308 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3311 strcpy(propName, "__ecerePropM_");
3312 FullClassNameCat(propName, prop->_class->fullName, 0x0);
3313 strcat(propName, "_");
3314 FullClassNameCat(propName, prop->name, 0x1);
3315 MangleClassName(propName);
3316 ListAdd(list, MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier(propName))), (((void *)0))));
3318 decl = MkDeclaration(specifiers, list);
3320 external = MkExternalDeclaration(decl);
3321 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
3322 external->symbol = symbol;
3323 symbol->externalPtr = external;
3327 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->externalPtr, curExternal->prev);
3329 symbol->id = curExternal->symbol->idCode;
3333 struct Type * Dereference(struct Type * source)
3335 struct Type * type = (((void *)0));
3339 if(source->kind == 13 || source->kind == 12)
3341 type = source->type;
3342 source->type->refCount++;
3344 else if(source->kind == 8 && !strcmp(source->_class->string, "String"))
3346 type = __extension__ ({
3347 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3349 __ecereInstance1->kind = 1, __ecereInstance1->refCount = 1, __ecereInstance1;
3352 else if(source->kind == 8 && source->_class && source->_class->registered && source->_class->registered->type == 5)
3358 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot dereference type\n", (((void *)0))));
3363 static struct Type * Reference(struct Type * source)
3365 struct Type * type = (((void *)0));
3369 type = __extension__ ({
3370 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
3372 __ecereInstance1->kind = 13, __ecereInstance1->type = source, __ecereInstance1->refCount = 1, __ecereInstance1;
3379 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);
3381 extern void * memcpy(void * , const void * , size_t size);
3383 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method);
3385 extern void FreeExpression(struct Expression * exp);
3387 extern void __ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2);
3389 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);
3391 static void ProcessInitializer(struct Initializer * init, struct Type * type);
3393 extern struct Type * MkClassType(char * name);
3395 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);
3397 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)
3399 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
3400 unsigned int found = 0x0;
3401 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
3402 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
3403 unsigned int freeType = 0x0;
3405 yylloc = member->loc;
3410 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, curClass, curMember, subMemberStack, subMemberStackPos);
3414 dataMember = *curMember;
3420 struct __ecereNameSpace__ecere__com__DataMember * thisMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
3421 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
3422 int _subMemberStackPos = 0;
3425 thisMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, ident->string, privateModule, _subMemberStack, &_subMemberStackPos);
3428 dataMember = thisMember;
3429 if(curMember && thisMember->memberAccess == 1)
3431 *curMember = thisMember;
3432 *curClass = thisMember->_class;
3433 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
3434 *subMemberStackPos = _subMemberStackPos;
3440 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, ident->string, privateModule);
3441 if(method && method->type == 1)
3444 method = (((void *)0));
3449 struct Type * type = (((void *)0));
3453 if(!dataMember->dataType && dataMember->dataTypeString)
3455 struct Context * context = SetupTemplatesContext(_class);
3457 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
3458 FinishTemplatesContext(context);
3460 type = dataMember->dataType;
3464 if(!method->dataType)
3465 ProcessMethodType(method);
3466 type = method->dataType;
3468 if(ident && ident->next)
3470 for(ident = ident->next; ident && type; ident = ident->next)
3474 dataMember = (struct __ecereNameSpace__ecere__com__DataMember *)__ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
3476 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMember(type->_class->registered, ident->string, privateModule, (((void *)0)), (((void *)0)));
3478 type = dataMember->dataType;
3480 else if(type->kind == 9 || type->kind == 10)
3482 struct Type * memberType;
3484 for(memberType = type->members.first; memberType; memberType = memberType->next)
3486 if(!strcmp(memberType->name, ident->string))
3495 if(type && type->kind == 20 && type->templateParameter->type == 0 && _class->templateArgs)
3498 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3499 struct __ecereNameSpace__ecere__com__Class * sClass;
3501 for(sClass = _class; sClass; sClass = sClass->base)
3504 if(sClass->templateClass)
3505 sClass = sClass->templateClass;
3506 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3508 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
3510 for(sClass = sClass->base; sClass; sClass = sClass->base)
3512 if(sClass->templateClass)
3513 sClass = sClass->templateClass;
3514 id += sClass->templateParams.count;
3525 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
3527 if(arg.dataTypeString)
3529 type = ProcessTypeString(arg.dataTypeString, 0x0);
3531 if(type && _class->templateClass)
3532 type->passAsTemplate = 0x1;
3539 if(type && type->kind == 8 && type->_class && type->_class->registered && strchr(type->_class->registered->fullName, '<'))
3541 struct __ecereNameSpace__ecere__com__Class * expClass = type->_class->registered;
3542 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
3546 char templateString[1024];
3547 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
3549 sprintf(templateString, "%s<", expClass->templateClass->fullName);
3550 for(cClass = expClass; cClass; cClass = cClass->base)
3554 if(cClass->templateClass)
3555 cClass = cClass->templateClass;
3556 for(param = cClass->templateParams.first; param; param = param->next)
3559 struct __ecereNameSpace__ecere__com__Class * sClass;
3560 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
3562 for(sClass = cClass->base; sClass; sClass = sClass->base)
3564 if(sClass->templateClass)
3565 sClass = sClass->templateClass;
3566 id += sClass->templateParams.count;
3568 arg = expClass->templateArgs[id];
3569 for(sClass = _class; sClass; sClass = sClass->base)
3571 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
3573 struct __ecereNameSpace__ecere__com__Class * nextClass;
3575 if(sClass->templateClass)
3576 sClass = sClass->templateClass;
3577 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
3579 if(nextClass->templateClass)
3580 nextClass = nextClass->templateClass;
3581 p += nextClass->templateParams.count;
3583 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
3585 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
3587 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3589 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
3590 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
3604 char expString[1024];
3605 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
3606 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
3607 struct Expression * exp;
3608 char * string = PrintHexUInt64(arg.expression.ui64);
3610 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
3611 ProcessExpressionType(exp);
3612 ComputeExpression(exp);
3613 expString[0] = '\0';
3614 PrintExpression(exp, expString);
3615 strcat(argument, expString);
3616 FreeExpression(exp);
3621 strcat(argument, arg.member->name);
3626 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
3627 strcat(argument, arg.dataTypeString);
3634 strcat(templateString, ", ");
3635 if(lastParam != p - 1)
3637 strcat(templateString, param->name);
3638 strcat(templateString, " = ");
3640 strcat(templateString, argument);
3649 int len = strlen(templateString);
3651 if(templateString[len - 1] == '<')
3655 if(templateString[len - 1] == '>')
3656 templateString[len++] = ' ';
3657 templateString[len++] = '>';
3659 templateString[len++] = '\0';
3662 struct Context * context = SetupTemplatesContext(_class);
3666 type = ProcessTypeString(templateString, 0x0);
3668 FinishTemplatesContext(context);
3671 if(method && member->initializer && member->initializer->type == 0 && member->initializer->exp)
3673 ProcessExpressionType(member->initializer->exp);
3674 if(!member->initializer->exp->expType)
3678 char expString[10240];
3680 expString[0] = '\0';
3681 PrintExpression(member->initializer->exp, expString);
3682 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
3683 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved symbol used as an instance method %s\n", (((void *)0))), expString);
3686 else if(!MatchTypes(member->initializer->exp->expType, type, (((void *)0)), (((void *)0)), _class, 0x1, 0x1, 0x0, 0x0))
3688 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible instance method %s\n", (((void *)0))), ident->string);
3691 else if(member->initializer)
3693 ProcessInitializer(member->initializer, type);
3700 if(_class && _class->type == 3)
3702 if(member->initializer)
3704 struct Type * type = MkClassType(_class->fullName);
3706 ProcessInitializer(member->initializer, type);
3712 if(member->initializer)
3714 ProcessInitializer(member->initializer, (((void *)0)));
3720 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3724 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), ident->string, _class->fullName);
3726 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, ident->string, "int", 0, 0, 1);
3730 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many initializers for instantiation of class %s\n", (((void *)0))), _class->fullName);
3735 extern struct Identifier * GetDeclId(struct Declarator * decl);
3737 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);
3739 extern void FreeSpecifier(struct Specifier * spec);
3741 static void ProcessFunction(struct FunctionDefinition * function);
3743 extern struct __ecereNameSpace__ecere__sys__OldList * CopyList(struct __ecereNameSpace__ecere__sys__OldList * source, void * (* )(void * ));
3745 extern struct Specifier * CopySpecifier(struct Specifier * spec);
3747 extern struct Declarator * CopyDeclarator(struct Declarator * declarator);
3749 extern void FreeClassFunction(struct ClassFunction * func);
3751 extern struct MemberInit * MkMemberInit(struct __ecereNameSpace__ecere__sys__OldList * ids, struct Initializer * initializer);
3753 extern struct Initializer * MkInitializerAssignment(struct Expression * exp);
3755 void ProcessInstantiationType(struct Instantiation * inst)
3760 struct MembersInit * members;
3761 struct Symbol * classSym;
3762 struct __ecereNameSpace__ecere__com__Class * _class;
3764 classSym = inst->_class->symbol;
3765 _class = classSym ? classSym->registered : (((void *)0));
3766 if(!_class || _class->type != 5)
3767 DeclareStruct(inst->_class->name, 0x0);
3768 afterExternal = afterExternal ? afterExternal : curExternal;
3770 ProcessExpressionType(inst->exp);
3771 inst->isConstant = 0x1;
3774 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
3775 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
3776 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
3777 int subMemberStackPos = 0;
3779 for(members = (*inst->members).first; members; members = members->next)
3781 switch(members->type)
3786 static unsigned int instMethodID = 0;
3787 struct External * external = curExternal;
3788 struct Context * context = curContext;
3789 struct Declarator * declarator = members->function->declarator;
3790 struct Identifier * nameID = GetDeclId(declarator);
3791 char * unmangled = nameID ? nameID->string : (((void *)0));
3792 struct Expression * exp;
3793 struct External * createdExternal = (((void *)0));
3799 strcpy(name, "__ecereInstMeth_");
3800 FullClassNameCat(name, _class ? _class->fullName : "_UNKNOWNCLASS", 0x0);
3802 strcat(name, nameID->string);
3804 sprintf(number, "_%08d", instMethodID++);
3805 strcat(name, number);
3806 nameID->string = __ecereNameSpace__ecere__sys__CopyString(name);
3810 struct Symbol * symbol = declarator->symbol;
3811 struct __ecereNameSpace__ecere__com__Method * method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, unmangled, privateModule);
3813 if(method && method->type == 1)
3815 symbol->method = method;
3816 ProcessMethodType(method);
3817 if(!symbol->type->thisClass)
3819 if(method->dataType->thisClass && currentClass && __ecereNameSpace__ecere__com__eClass_IsDerived(currentClass, method->dataType->thisClass->registered))
3821 if(!currentClass->symbol)
3822 currentClass->symbol = FindClass(currentClass->fullName);
3823 symbol->type->thisClass = currentClass->symbol;
3828 _class->symbol = FindClass(_class->fullName);
3829 symbol->type->thisClass = _class->symbol;
3832 DeclareType(symbol->type, 0x1, 0x1);
3836 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find virtual method %s in class %s\n", (((void *)0))), unmangled, classSym->string);
3839 createdExternal = ProcessClassFunction(classSym ? classSym->registered : (((void *)0)), members->function, ast, afterExternal, 0x1);
3842 FreeSpecifier(nameID->_class);
3843 nameID->_class = (((void *)0));
3847 struct Type * type = declarator->symbol->type;
3848 struct External * oldExternal = curExternal;
3850 declarator->symbol->id = declarator->symbol->idCode = curExternal->symbol->idCode;
3852 struct External * externalDecl;
3854 externalDecl = MkExternalDeclaration((((void *)0)));
3855 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), oldExternal->prev, externalDecl);
3856 if(createdExternal->function)
3858 ProcessFunction(createdExternal->function);
3860 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(declarator), (((void *)0)))));
3862 externalDecl->declaration = decl;
3863 if(decl->symbol && !decl->symbol->pointerExternal)
3864 decl->symbol->pointerExternal = externalDecl;
3865 declarator->symbol->pointerExternal = externalDecl;
3872 curExternal = declarator->symbol->pointerExternal;
3873 ProcessFunction((struct FunctionDefinition *)members->function);
3875 curExternal = external;
3876 curContext = context;
3879 FreeClassFunction(members->function);
3880 exp = QMkExpId(name);
3882 members->dataMembers = MkListOne(MkMemberInit(MkListOne(MkIdentifier(unmangled)), MkInitializerAssignment(exp)));
3883 (__ecereNameSpace__ecere__com__eSystem_Delete(unmangled), unmangled = 0);
3889 if(members->dataMembers && classSym)
3891 struct MemberInit * member;
3892 struct Location oldyyloc = yylloc;
3894 for(member = (*members->dataMembers).first; member; member = member->next)
3896 ProcessMemberInitData(member, classSym->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
3897 if(member->initializer && !member->initializer->isConstant)
3898 inst->isConstant = 0x0;
3910 static void DeclareType(struct Type * type, unsigned int declarePointers, unsigned int declareParams)
3914 if(type->kind == 11)
3916 struct Type * param;
3920 for(param = type->params.first; param; param = param->next)
3921 DeclareType(param, declarePointers, 0x1);
3923 DeclareType(type->returnType, declarePointers, 0x1);
3925 else if(type->kind == 13 && declarePointers)
3926 DeclareType(type->type, declarePointers, 0x0);
3927 else if(type->kind == 8)
3929 if(type->_class->registered && (type->_class->registered->type == 1 || type->_class->registered->type == 5) && !type->_class->declaring)
3930 DeclareStruct(type->_class->registered->fullName, type->_class->registered->type == 5);
3932 else if(type->kind == 9 || type->kind == 10)
3934 struct Type * member;
3936 for(member = type->members.first; member; member = member->next)
3937 DeclareType(member, 0x0, 0x0);
3939 else if(type->kind == 12)
3940 DeclareType(type->arrayType, declarePointers, 0x0);
3944 extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_FindClass(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
3946 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * FindTemplateArg(struct __ecereNameSpace__ecere__com__Class * _class, struct TemplateParameter * param)
3948 struct __ecereNameSpace__ecere__com__ClassTemplateArgument * arg = (((void *)0));
3950 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
3951 struct __ecereNameSpace__ecere__com__Class * sClass;
3953 for(sClass = _class; sClass; sClass = sClass->base)
3956 if(sClass->templateClass)
3957 sClass = sClass->templateClass;
3958 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
3960 if(curParam->type == 0 && !strcmp(param->identifier->string, curParam->name))
3962 for(sClass = sClass->base; sClass; sClass = sClass->base)
3964 if(sClass->templateClass)
3965 sClass = sClass->templateClass;
3966 id += sClass->templateParams.count;
3977 arg = &_class->templateArgs[id];
3978 if(arg && param->type == 0)
3979 (*arg).dataTypeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, (*arg).dataTypeString);
3984 extern struct Context * PushContext(void);
3986 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_TemplatedType;
3988 struct TemplatedType
3991 struct __ecereNameSpace__ecere__sys__BTNode * parent;
3992 struct __ecereNameSpace__ecere__sys__BTNode * left;
3993 struct __ecereNameSpace__ecere__sys__BTNode * right;
3995 struct TemplateParameter * param;
3996 } __attribute__ ((gcc_struct));
3998 unsigned int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
4000 struct Context * SetupTemplatesContext(struct __ecereNameSpace__ecere__com__Class * _class)
4002 struct Context * context = PushContext();
4004 context->templateTypesOnly = 0x1;
4005 if(_class->symbol && ((struct Symbol *)_class->symbol)->templateParams)
4007 struct TemplateParameter * param = (*((struct Symbol *)_class->symbol)->templateParams).first;
4009 for(; param; param = param->next)
4011 if(param->type == 0 && param->identifier)
4013 struct TemplatedType * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType), type->key = (uintptr_t)param->identifier->string, type->param = param, type);
4015 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4021 struct __ecereNameSpace__ecere__com__Class * sClass;
4023 for(sClass = _class; sClass; sClass = sClass->base)
4025 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * p;
4027 for(p = sClass->templateParams.first; p; p = p->next)
4031 struct TemplateParameter * param = p->param;
4032 struct TemplatedType * type;
4036 p->param = param = __extension__ ({
4037 struct TemplateParameter * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplateParameter);
4039 __ecereInstance1->identifier = MkIdentifier(p->name), __ecereInstance1->type = p->type, __ecereInstance1->dataTypeString = p->dataTypeString, __ecereInstance1;
4042 type = __extension__ ({
4043 struct TemplatedType * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TemplatedType);
4045 __ecereInstance1->key = (uintptr_t)p->name, __ecereInstance1->param = param, __ecereInstance1;
4047 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&curContext->templateTypes, (struct __ecereNameSpace__ecere__sys__BTNode *)type);
4055 extern void PopContext(struct Context * ctx);
4057 extern void FreeContext(struct Context * context);
4059 void FinishTemplatesContext(struct Context * context)
4061 PopContext(context);
4062 FreeContext(context);
4063 ((context ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(context) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(context)) : 0), context = 0);
4066 void ProcessMethodType(struct __ecereNameSpace__ecere__com__Method * method)
4068 if(!method->dataType)
4070 struct Context * context = SetupTemplatesContext(method->_class);
4072 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4073 FinishTemplatesContext(context);
4074 if(method->type != 1 && method->dataType)
4076 if(!method->dataType->thisClass && !method->dataType->staticMethod)
4078 if(!method->_class->symbol)
4079 method->_class->symbol = FindClass(method->_class->fullName);
4080 method->dataType->thisClass = method->_class->symbol;
4086 void ProcessPropertyType(struct __ecereNameSpace__ecere__com__Property * prop)
4090 struct Context * context = SetupTemplatesContext(prop->_class);
4092 prop->dataType = ProcessTypeString(prop->dataTypeString, 0x0);
4093 FinishTemplatesContext(context);
4097 extern struct Declarator * GetFuncDecl(struct Declarator * decl);
4099 extern void FreeTypeName(struct TypeName * typeName);
4101 static void ProcessDeclarator(struct Declarator * decl);
4103 extern struct __ecereNameSpace__ecere__sys__OldList * excludedSymbols;
4105 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
4109 struct MethodImport * prev;
4110 struct MethodImport * next;
4112 unsigned int isVirtual;
4113 } __attribute__ ((gcc_struct));
4115 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(struct __ecereNameSpace__ecere__sys__OldList * this, void * item);
4117 void DeclareMethod(struct __ecereNameSpace__ecere__com__Method * method, char * name)
4119 struct Symbol * symbol = method->symbol;
4121 if(!symbol || (!symbol->pointerExternal && method->type == 1) || symbol->id > (curExternal ? curExternal->symbol->idCode : -1))
4123 unsigned int imported = 0x0;
4124 unsigned int dllImport = 0x0;
4126 if(!method->dataType)
4127 method->dataType = ProcessTypeString(method->dataTypeString, 0x0);
4128 if(!symbol || symbol->_import || method->type == 1)
4130 if(!symbol || method->type == 1)
4132 struct Symbol * classSym;
4134 if(!method->_class->symbol)
4135 method->_class->symbol = FindClass(method->_class->fullName);
4136 classSym = method->_class->symbol;
4137 if(!classSym->_import)
4139 struct ModuleImport * module;
4141 if(method->_class->module && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->name)
4142 module = FindModule(method->_class->module);
4144 module = mainModule;
4145 classSym->_import = __extension__ ({
4146 struct ClassImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ClassImport);
4148 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->_class->fullName), __ecereInstance1->isRemote = method->_class->isRemote, __ecereInstance1;
4150 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->classes, classSym->_import);
4154 symbol = method->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4156 if(!symbol->_import)
4158 symbol->_import = (struct ClassImport *)__extension__ ({
4159 struct MethodImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_MethodImport);
4161 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(method->name), __ecereInstance1->isVirtual = method->type == 1, __ecereInstance1;
4163 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classSym->_import->methods, symbol->_import);
4167 symbol->type = method->dataType;
4169 symbol->type->refCount++;
4172 if(!method->dataType->dllExport)
4175 if(method->_class->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)method->_class->module + structSize_Instance)))->importType != 1)
4179 if(method->type != 1 && method->dataType)
4180 DeclareType(method->dataType, 0x1, 0x1);
4181 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4183 struct Declaration * decl;
4184 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4185 struct Declarator * d;
4186 struct Declarator * funcDecl;
4187 struct External * external;
4189 specifiers = MkList();
4190 declarators = MkList();
4192 ListAdd(specifiers, MkSpecifier(EXTERN));
4193 else if(method->_class->symbol && ((struct Symbol *)method->_class->symbol)->isStatic)
4194 ListAdd(specifiers, MkSpecifier(STATIC));
4195 if(method->type == 1)
4197 ListAdd(specifiers, MkSpecifier(INT));
4198 d = MkDeclaratorIdentifier(MkIdentifier(name));
4202 d = MkDeclaratorIdentifier(MkIdentifier(name));
4204 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4206 struct Context * context = SetupTemplatesContext(method->_class);
4208 d = SpecDeclFromString(method->dataTypeString, specifiers, d);
4209 FinishTemplatesContext(context);
4211 funcDecl = GetFuncDecl(d);
4214 struct Specifier * spec, * next;
4216 for(spec = (*specifiers).first; spec; spec = next)
4221 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4222 FreeSpecifier(spec);
4226 if(method->dataType && !method->dataType->staticMethod)
4228 if(funcDecl && funcDecl->function.parameters && (*funcDecl->function.parameters).count)
4230 struct __ecereNameSpace__ecere__com__Class * _class = method->dataType->thisClass ? method->dataType->thisClass->registered : method->_class;
4231 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")));
4232 struct TypeName * firstParam = ((struct TypeName *)(*funcDecl->function.parameters).first);
4233 struct Specifier * firstSpec = firstParam->qualifiers ? (*firstParam->qualifiers).first : (((void *)0));
4235 if(firstSpec && firstSpec->type == 0 && firstSpec->specifier == VOID && !firstParam->declarator)
4237 struct TypeName * param = (*funcDecl->function.parameters).first;
4239 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
4240 FreeTypeName(param);
4242 if(!funcDecl->function.parameters)
4243 funcDecl->function.parameters = MkList();
4244 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
4248 ProcessDeclarator(d);
4249 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4250 decl = MkDeclaration(specifiers, declarators);
4251 ReplaceThisClassSpecifiers(specifiers, method->_class);
4252 if(symbol->pointerExternal)
4254 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4257 *functionSymbol = *symbol;
4258 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4259 if(functionSymbol->type)
4260 functionSymbol->type->refCount++;
4262 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4263 symbol->pointerExternal->symbol = functionSymbol;
4265 external = MkExternalDeclaration(decl);
4267 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal ? curExternal->prev : (((void *)0)), external);
4268 external->symbol = symbol;
4269 symbol->pointerExternal = external;
4273 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4275 symbol->id = curExternal ? curExternal->symbol->idCode : (((int)0x7fffffff));
4279 char * ReplaceThisClass(struct __ecereNameSpace__ecere__com__Class * _class)
4281 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4283 unsigned int first = 0x1;
4285 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4287 char className[1024];
4289 strcpy(className, _class->fullName);
4290 for(param = _class->templateParams.first; param; param = param->next)
4294 strcat(className, "<");
4296 strcat(className, ", ");
4297 if(lastParam + 1 != p)
4299 strcat(className, param->name);
4300 strcat(className, " = ");
4302 strcat(className, param->name);
4310 int len = strlen(className);
4312 if(className[len - 1] == '>')
4313 className[len++] = ' ';
4314 className[len++] = '>';
4315 className[len++] = '\0';
4317 return __ecereNameSpace__ecere__sys__CopyString(className);
4320 return __ecereNameSpace__ecere__sys__CopyString(_class->fullName);
4323 struct Type * ReplaceThisClassType(struct __ecereNameSpace__ecere__com__Class * _class)
4325 if(thisClassParams && _class->templateParams.count && !_class->templateClass)
4327 unsigned int first = 0x1;
4329 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
4331 char className[1024];
4333 strcpy(className, _class->fullName);
4334 for(param = _class->templateParams.first; param; param = param->next)
4338 strcat(className, "<");
4340 strcat(className, ", ");
4341 if(lastParam + 1 != p)
4343 strcat(className, param->name);
4344 strcat(className, " = ");
4346 strcat(className, param->name);
4354 int len = strlen(className);
4356 if(className[len - 1] == '>')
4357 className[len++] = ' ';
4358 className[len++] = '>';
4359 className[len++] = '\0';
4361 return MkClassType(className);
4365 return MkClassType(_class->fullName);
4369 void ReplaceThisClassSpecifiers(struct __ecereNameSpace__ecere__sys__OldList * specs, struct __ecereNameSpace__ecere__com__Class * _class)
4371 if(specs != (((void *)0)) && _class)
4373 struct Specifier * spec;
4375 for(spec = specs->first; spec; spec = spec->next)
4377 if(spec->type == 0 && spec->specifier == THISCLASS)
4380 spec->name = ReplaceThisClass(_class);
4381 spec->symbol = FindClass(spec->name);
4387 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
4389 struct __ecereNameSpace__ecere__com__GlobalFunction
4391 struct __ecereNameSpace__ecere__com__GlobalFunction * prev;
4392 struct __ecereNameSpace__ecere__com__GlobalFunction * next;
4395 struct __ecereNameSpace__ecere__com__Instance * module;
4396 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
4397 char * dataTypeString;
4398 struct Type * dataType;
4400 } __attribute__ ((gcc_struct));
4402 extern struct Context * globalContext;
4404 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_FunctionImport;
4406 struct FunctionImport
4408 struct FunctionImport * prev;
4409 struct FunctionImport * next;
4411 } __attribute__ ((gcc_struct));
4413 unsigned int DeclareFunction(struct __ecereNameSpace__ecere__com__GlobalFunction * function, char * name)
4415 struct Symbol * symbol = function->symbol;
4417 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4419 unsigned int imported = 0x0;
4420 unsigned int dllImport = 0x0;
4422 if(!function->dataType)
4424 function->dataType = ProcessTypeString(function->dataTypeString, 0x0);
4425 if(!function->dataType->thisClass)
4426 function->dataType->staticMethod = 0x1;
4432 struct ModuleImport * module = FindModule(function->module);
4434 symbol = function->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4437 if(!function->dataType->dllExport)
4439 symbol->_import = (struct ClassImport *)__extension__ ({
4440 struct FunctionImport * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_FunctionImport);
4442 __ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(function->name), __ecereInstance1;
4444 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&module->functions, symbol->_import);
4448 symbol->type = ProcessTypeString(function->dataTypeString, 0x0);
4449 if(!symbol->type->thisClass)
4450 symbol->type->staticMethod = 0x1;
4453 imported = symbol->_import ? 0x1 : 0x0;
4454 if(imported && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1)
4457 DeclareType(function->dataType, 0x1, 0x1);
4460 if(!symbol->pointerExternal || symbol->pointerExternal->type == 0)
4462 struct Declaration * decl;
4463 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4464 struct Declarator * d;
4465 struct Declarator * funcDecl;
4466 struct External * external;
4468 specifiers = MkList();
4469 declarators = MkList();
4470 ListAdd(specifiers, MkSpecifier(EXTERN));
4471 d = MkDeclaratorIdentifier(MkIdentifier(imported ? name : function->name));
4473 d = MkDeclaratorBrackets(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d));
4474 d = SpecDeclFromString(function->dataTypeString, specifiers, d);
4475 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType == 1)
4477 struct Specifier * spec;
4479 for(spec = (*specifiers).first; spec; spec = spec->next)
4480 if(spec->type == 5 && spec->extDecl && spec->extDecl->type == 0 && !strcmp(spec->extDecl->s, "dllexport"))
4482 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*specifiers), spec);
4483 FreeSpecifier(spec);
4487 funcDecl = GetFuncDecl(d);
4488 if(funcDecl && !funcDecl->function.parameters)
4490 funcDecl->function.parameters = MkList();
4491 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), MkTypeName(MkListOne(MkSpecifier(VOID)), (((void *)0))));
4493 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4495 struct Context * oldCtx = curContext;
4497 curContext = globalContext;
4498 decl = MkDeclaration(specifiers, declarators);
4499 curContext = oldCtx;
4501 if(symbol->pointerExternal)
4503 struct Symbol * functionSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4506 *functionSymbol = *symbol;
4507 functionSymbol->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
4508 if(functionSymbol->type)
4509 functionSymbol->type->refCount++;
4511 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*excludedSymbols), functionSymbol);
4512 symbol->pointerExternal->symbol = functionSymbol;
4514 external = MkExternalDeclaration(decl);
4516 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4517 external->symbol = symbol;
4518 symbol->pointerExternal = external;
4522 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4525 symbol->id = curExternal->symbol->idCode;
4528 return (symbol && symbol->_import && function->module != privateModule && ((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1) ? 0x1 : 0x0;
4531 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
4536 struct __ecereNameSpace__ecere__sys__BTNode * parent;
4537 struct __ecereNameSpace__ecere__sys__BTNode * left;
4538 struct __ecereNameSpace__ecere__sys__BTNode * right;
4540 struct __ecereNameSpace__ecere__com__Instance * module;
4541 char * dataTypeString;
4542 struct Type * dataType;
4545 } __attribute__ ((gcc_struct));
4547 void DeclareGlobalData(struct GlobalData * data)
4549 struct Symbol * symbol = data->symbol;
4551 if(curExternal && (!symbol || symbol->id > curExternal->symbol->idCode))
4556 symbol = data->symbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
4559 data->dataType = ProcessTypeString(data->dataTypeString, 0x0);
4560 DeclareType(data->dataType, 0x1, 0x1);
4563 if(!symbol->pointerExternal)
4565 struct Declaration * decl;
4566 struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
4567 struct Declarator * d;
4568 struct External * external;
4570 specifiers = MkList();
4571 declarators = MkList();
4572 ListAdd(specifiers, MkSpecifier(EXTERN));
4573 d = MkDeclaratorIdentifier(MkIdentifier(data->fullName));
4574 d = SpecDeclFromString(data->dataTypeString, specifiers, d);
4575 ListAdd(declarators, MkInitDeclarator(d, (((void *)0))));
4576 decl = MkDeclaration(specifiers, declarators);
4577 external = MkExternalDeclaration(decl);
4579 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, external);
4580 external->symbol = symbol;
4581 symbol->pointerExternal = external;
4585 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
4588 symbol->id = curExternal->symbol->idCode;
4595 struct Conversion * prev, * next;
4596 struct __ecereNameSpace__ecere__com__Property * convert;
4598 struct Type * resultType;
4599 } __attribute__ ((gcc_struct));
4601 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Conversion;
4603 extern void Compiler_Warning(char * format, ...);
4605 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName);
4607 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)
4611 if(source->kind == 20 && dest->kind != 20)
4613 struct Type * type = ProcessTemplateParameterType(source->templateParameter);
4618 if(dest->kind == 20 && source->kind != 20)
4620 struct Type * type = ProcessTemplateParameterType(dest->templateParameter);
4625 if((dest->classObjectType == 2 && source->classObjectType != 3) || (dest->classObjectType == 3 && source->classObjectType != 2))
4629 if(source->classObjectType == 3 && dest->classObjectType != 2)
4633 if((dest->kind == 9 && source->kind == 9) || (dest->kind == 10 && source->kind == 10))
4635 if((dest->enumName && source->enumName && !strcmp(dest->enumName, source->enumName)) || (source->members.first && source->members.first == dest->members.first))
4638 if(dest->kind == 14 && source->kind != 0)
4640 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))
4642 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))
4644 if(((source->kind == 8 && dest->kind == 8) || (source->kind == 19 && dest->kind == 19)) && source->_class)
4646 if(source->_class->registered && source->_class->registered->type == 3)
4648 if(conversions != (((void *)0)))
4650 if(source->_class->registered == dest->_class->registered)
4655 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
4657 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
4659 for(destBase = dest->_class->registered; destBase && destBase->base->type != 1000; destBase = destBase->base)
4661 if(sourceBase == destBase)
4665 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))
4669 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4 && source->_class && source->_class->registered && source->_class->registered->type != 4)
4671 if(__ecereNameSpace__ecere__com__eClass_IsDerived(dest->_class->registered, source->_class->registered))
4678 if(source->kind == 19 && dest->kind == 8 && dest->_class && !strcmp(dest->_class->string, "ecere::com::Class"))
4682 if(source->kind == 8)
4684 struct __ecereNameSpace__ecere__com__Class * _class;
4686 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4688 struct __ecereNameSpace__ecere__com__Property * convert;
4690 for(convert = _class->conversions.first; convert; convert = convert->next)
4692 if(convert->memberAccess == 1 || _class->module == privateModule)
4694 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4696 if(!convert->dataType)
4697 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4698 if(MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x0, 0x1, 0x0, 0x1))
4700 if(!conversions && !convert->Get)
4702 else if(conversions != (((void *)0)))
4704 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))
4708 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4710 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4721 struct __ecereNameSpace__ecere__com__Class * _class;
4723 for(_class = dest->_class ? dest->_class->registered : (((void *)0)); _class; _class = _class->base)
4725 struct __ecereNameSpace__ecere__com__Property * convert;
4727 for(convert = _class->conversions.first; convert; convert = convert->next)
4729 if(convert->memberAccess == 1 || _class->module == privateModule)
4731 if(!convert->dataType)
4732 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4733 if(convert->dataType != dest && MatchTypes(source, convert->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x1))
4735 if(!conversions && !convert->Set)
4737 else if(conversions != (((void *)0)))
4739 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))
4743 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv);
4745 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, conv);
4753 if(enumBaseType && dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
4755 if(!dest->_class->registered->dataType)
4756 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
4757 if(dest->_class->registered->dataType->kind == 8 || source->truth || dest->truth)
4759 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4766 if(source->kind == 8)
4768 struct __ecereNameSpace__ecere__com__Class * _class;
4770 for(_class = source->_class ? source->_class->registered : (((void *)0)); _class; _class = _class->base)
4772 struct __ecereNameSpace__ecere__com__Property * convert;
4774 for(convert = _class->conversions.first; convert; convert = convert->next)
4776 if(convert->memberAccess == 1 || _class->module == privateModule)
4778 struct Conversion * after = (conversions != (((void *)0))) ? conversions->last : (((void *)0));
4780 if(!convert->dataType)
4781 convert->dataType = ProcessTypeString(convert->dataTypeString, 0x0);
4782 if(convert->dataType != source && MatchTypes(convert->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x1))
4784 if(!conversions && !convert->Get)
4786 else if(conversions != (((void *)0)))
4788 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))
4792 struct Conversion * conv = (conv = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Conversion), conv->convert = convert, conv->isGet = 0x1, conv);
4794 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(conversions, after, conv);
4802 if(enumBaseType && source->_class && source->_class->registered && source->_class->registered->type == 4)
4804 if(!source->_class->registered->dataType)
4805 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
4806 if(MatchTypes(source->_class->registered->dataType, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4813 if(source->kind == 8 || source->kind == 19)
4815 else if(dest->kind == source->kind && (dest->kind != 9 && dest->kind != 10 && dest->kind != 11 && dest->kind != 12 && dest->kind != 13 && dest->kind != 16))
4817 else if(dest->kind == 7 && source->kind == 6)
4819 else if(dest->kind == 2 && source->kind == 1)
4821 else if(dest->kind == 3 && (source->kind == 2 || source->kind == 1 || source->kind == 23))
4823 else if(dest->kind == 4 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 22 || source->kind == 23))
4825 else if(dest->kind == 22 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 23 || source->kind == 4))
4827 else if(dest->kind == 23 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4 || source->kind == 22))
4829 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))
4831 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))
4833 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)))
4835 struct Type * paramSource, * paramDest;
4837 if(dest->kind == 16)
4838 owningClassDest = dest->methodClass ? dest->methodClass : dest->method->_class;
4839 if(source->kind == 16)
4840 owningClassSource = source->methodClass ? source->methodClass : source->method->_class;
4841 if(dest->kind == 13 && dest->type->kind == 11)
4843 if(source->kind == 13 && source->type->kind == 11)
4844 source = source->type;
4845 if(dest->kind == 16)
4846 dest = dest->method->dataType;
4847 if(source->kind == 16)
4848 source = source->method->dataType;
4849 paramSource = source->params.first;
4850 if(paramSource && paramSource->kind == 0)
4851 paramSource = (((void *)0));
4852 paramDest = dest->params.first;
4853 if(paramDest && paramDest->kind == 0)
4854 paramDest = (((void *)0));
4855 if((dest->staticMethod || (!dest->thisClass && !owningClassDest)) && !(source->staticMethod || (!source->thisClass && !owningClassSource)))
4857 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))))
4859 if(paramDest && paramDest->kind == 8)
4860 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), paramDest->_class->string);
4862 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class should not take an object\n", (((void *)0))));
4865 paramDest = paramDest->next;
4867 else if(!dest->staticMethod && (dest->thisClass || owningClassDest))
4869 if((source->staticMethod || (!source->thisClass && !owningClassSource)))
4873 if(!paramSource || paramSource->kind != 8 || !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, dest->thisClass->registered))
4875 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4881 if(!paramSource || paramSource->kind != 8 || (owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(paramSource->_class->registered, owningClassDest)))
4884 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), owningClassDest->fullName);
4886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "overriding class expected to be derived from method class\n", (((void *)0))));
4890 paramSource = paramSource->next;
4896 if(!__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass ? source->thisClass->registered : owningClassSource, dest->thisClass->registered))
4898 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "method class must be derived from %s\n", (((void *)0))), dest->thisClass->string);
4904 if(source->thisClass && source->thisClass->registered && owningClassDest && !__ecereNameSpace__ecere__com__eClass_IsDerived(source->thisClass->registered, owningClassDest))
4906 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s expected to be derived from method class\n", (((void *)0))), source->thisClass->registered->fullName);
4912 if(!MatchTypes(source->returnType, dest->returnType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
4914 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible return type for function\n", (((void *)0))));
4917 for(; paramDest; paramDest = paramDest->next)
4921 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "not enough parameters\n", (((void *)0))));
4925 struct Type * paramDestType = paramDest;
4926 struct Type * paramSourceType = paramSource;
4927 struct Type * type = paramDestType;
4929 if(paramDest->kind == 20 && paramDest->templateParameter->type == 0 && owningClassSource && paramSource->kind != 20)
4932 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
4933 struct __ecereNameSpace__ecere__com__Class * sClass;
4935 for(sClass = owningClassSource; sClass; sClass = sClass->base)
4938 if(sClass->templateClass)
4939 sClass = sClass->templateClass;
4940 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
4942 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
4944 for(sClass = sClass->base; sClass; sClass = sClass->base)
4946 if(sClass->templateClass)
4947 sClass = sClass->templateClass;
4948 id += sClass->templateParams.count;
4959 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = owningClassSource->templateArgs[id];
4961 paramDestType = type = ProcessTypeString(arg.dataTypeString, 0x0);
4964 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)))
4969 PrintType(paramDest, type, 0x0, 0x1);
4970 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible parameter %s (expected %s)\n", (((void *)0))), paramSource->name, type);
4971 if(paramDestType != paramDest)
4972 FreeType(paramDestType);
4975 if(paramDestType != paramDest)
4976 FreeType(paramDestType);
4978 paramSource = paramSource->next;
4982 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "too many parameters\n", (((void *)0))));
4987 else if((dest->kind == 11 || (dest->kind == 13 && dest->type->kind == 11) || dest->kind == 16) && (source->kind == 13 && source->type->kind == 0))
4991 else if((dest->kind == 13 || dest->kind == 12) && (source->kind == 12 || source->kind == 13))
4993 if(MatchTypes(source->type, dest->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5000 static void FreeConvert(struct Conversion * convert)
5002 if(convert->resultType)
5003 FreeType(convert->resultType);
5006 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
5008 struct __ecereNameSpace__ecere__com__BTNamedLink
5011 struct __ecereNameSpace__ecere__com__BTNamedLink * parent;
5012 struct __ecereNameSpace__ecere__com__BTNamedLink * left;
5013 struct __ecereNameSpace__ecere__com__BTNamedLink * right;
5016 } __attribute__ ((gcc_struct));
5018 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
5020 struct __ecereNameSpace__ecere__com__EnumClassData
5022 struct __ecereNameSpace__ecere__sys__OldList values;
5024 } __attribute__ ((gcc_struct));
5026 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink;
5028 struct __ecereNameSpace__ecere__sys__NamedLink
5030 struct __ecereNameSpace__ecere__sys__NamedLink * prev;
5031 struct __ecereNameSpace__ecere__sys__NamedLink * next;
5034 } __attribute__ ((gcc_struct));
5036 extern void FreeExpContents(struct Expression * exp);
5038 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(struct __ecereNameSpace__ecere__sys__BinaryTree * this);
5040 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BinaryTree_first;
5042 struct __ecereNameSpace__ecere__sys__BTNode * __ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(struct __ecereNameSpace__ecere__sys__BTNode * this);
5044 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__sys__BTNode_next;
5046 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereNameSpace__ecere__sys__OldList * this, void (* freeFn)(void * ));
5048 unsigned int MatchWithEnums_NameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5050 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
5052 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)))
5054 struct __ecereNameSpace__ecere__com__Class * _class = link->data;
5056 if(_class->type == 4)
5058 struct __ecereNameSpace__ecere__sys__OldList converts =
5062 struct Type * type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5066 _class->symbol = FindClass(_class->fullName);
5067 type->_class = _class->symbol;
5068 if(MatchTypes(type, dest, &converts, (((void *)0)), (((void *)0)), 0x1, 0x0, 0x0, 0x0))
5070 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5071 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5075 struct __ecereNameSpace__ecere__com__Class * baseClass;
5077 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
5079 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
5081 for(value = e->values.first; value; value = value->next)
5083 if(!strcmp(value->name, string))
5088 FreeExpContents(sourceExp);
5089 FreeType(sourceExp->expType);
5090 sourceExp->isConstant = 0x1;
5091 sourceExp->expType = MkClassType(baseClass->fullName);
5095 sourceExp->type = 2;
5096 if(!strcmp(baseClass->dataTypeString, "int"))
5097 sprintf(constant, "%d", value->data);
5099 sprintf(constant, "0x%X", value->data);
5100 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5102 while(converts.first)
5104 struct Conversion * convert = converts.first;
5106 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&converts, convert);
5107 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(conversions, convert);
5109 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5116 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
5117 ((type ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(type) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(type)) : 0), type = 0);
5120 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)))
5121 if(MatchWithEnums_NameSpace(nameSpace, sourceExp, dest, string, conversions))
5126 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
5128 struct __ecereNameSpace__ecere__com__SubModule
5130 struct __ecereNameSpace__ecere__com__SubModule * prev;
5131 struct __ecereNameSpace__ecere__com__SubModule * next;
5132 struct __ecereNameSpace__ecere__com__Instance * module;
5134 } __attribute__ ((gcc_struct));
5136 unsigned int ModuleVisibility(struct __ecereNameSpace__ecere__com__Instance * searchIn, struct __ecereNameSpace__ecere__com__Instance * searchFor)
5138 struct __ecereNameSpace__ecere__com__SubModule * subModule;
5140 if(searchFor == searchIn)
5142 for(subModule = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->modules.first; subModule; subModule = subModule->next)
5144 if(subModule->importMode == 1 || searchIn == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)searchIn + structSize_Instance)))->application)
5146 if(ModuleVisibility(subModule->module, searchFor))
5153 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Application;
5155 struct __ecereNameSpace__ecere__com__Application
5160 unsigned int isGUIApp;
5161 struct __ecereNameSpace__ecere__sys__OldList allModules;
5162 char * parsedCommand;
5163 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
5164 } __attribute__ ((gcc_struct));
5166 unsigned int MatchWithEnums_Module(struct __ecereNameSpace__ecere__com__Instance * mainModule, struct Expression * sourceExp, struct Type * dest, char * string, struct __ecereNameSpace__ecere__sys__OldList * conversions)
5168 struct __ecereNameSpace__ecere__com__Instance * module;
5170 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))
5172 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))
5174 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))
5176 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)
5178 if(ModuleVisibility(mainModule, module) && MatchWithEnums_NameSpace(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->publicNameSpace, sourceExp, dest, string, conversions))
5184 extern unsigned long strtoul(const char * nptr, char * * endptr, int base);
5186 void ReadString(char * output, char * string);
5188 extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * list);
5190 extern struct TypeName * QMkClass(char * spec, struct Declarator * decl);
5192 extern struct Expression * MkExpBrackets(struct __ecereNameSpace__ecere__sys__OldList * expressions);
5194 unsigned int MatchTypeExpression(struct Expression * sourceExp, struct Type * dest, struct __ecereNameSpace__ecere__sys__OldList * conversions, unsigned int skipUnitBla)
5196 struct Type * source = sourceExp->expType;
5197 struct Type * realDest = dest;
5198 struct Type * backupSourceExpType = (((void *)0));
5200 if(dest->kind == 13 && sourceExp->type == 2 && !strtoul(sourceExp->constant, (((void *)0)), 0))
5202 if(!skipUnitBla && source && dest && source->kind == 8 && dest->kind == 8)
5204 if(source->_class && source->_class->registered && source->_class->registered->type == 3)
5206 struct __ecereNameSpace__ecere__com__Class * sourceBase, * destBase;
5208 for(sourceBase = source->_class->registered; sourceBase && sourceBase->base && sourceBase->base->type != 1000; sourceBase = sourceBase->base)
5210 for(destBase = dest->_class->registered; destBase && destBase->base && destBase->base->type != 1000; destBase = destBase->base)
5212 if(sourceBase == destBase)
5218 struct __ecereNameSpace__ecere__sys__OldList * specs;
5219 unsigned int flag = 0x0;
5220 long long value = (((int)0x7fffffff));
5224 if(sourceExp->type == 2)
5226 if(source->isSigned)
5227 value = strtoll(sourceExp->constant, (((void *)0)), 0);
5229 value = strtoull(sourceExp->constant, (((void *)0)), 0);
5231 else if(sourceExp->type == 4 && sourceExp->op.op == '-' && !sourceExp->op.exp1 && sourceExp->op.exp2 && sourceExp->op.exp2->type == 2)
5233 if(source->isSigned)
5234 value = -strtoll(sourceExp->op.exp2->constant, (((void *)0)), 0);
5236 value = -strtoull(sourceExp->op.exp2->constant, (((void *)0)), 0);
5238 if(dest->kind != 8 && source->kind == 8 && source->_class && source->_class->registered && !strcmp(source->_class->registered->fullName, "ecere::com::unichar"))
5241 source = __extension__ ({
5242 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5244 __ecereInstance1->kind = 3, __ecereInstance1->isSigned = 0x0, __ecereInstance1->refCount = 1, __ecereInstance1;
5249 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5251 if(_class && _class->type == 3)
5253 if(source->kind != 8)
5255 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5256 struct Type * tempDest, * tempSource;
5258 for(; _class->base->type != 1000; _class = _class->base)
5261 tempDest = tempType;
5264 _class->symbol = FindClass(_class->fullName);
5265 tempType->_class = _class->symbol;
5266 tempType->truth = dest->truth;
5267 if(tempType->_class)
5268 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5269 backupSourceExpType = sourceExp->expType;
5270 sourceExp->expType = dest;
5273 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5276 if(_class && _class->type == 2 && source->kind != 8)
5278 if(!dest->_class->registered->dataType)
5279 dest->_class->registered->dataType = ProcessTypeString(dest->_class->registered->dataTypeString, 0x0);
5280 if(MatchTypes(source, dest->_class->registered->dataType, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5283 FreeType(sourceExp->expType);
5284 source = sourceExp->expType = MkClassType(dest->_class->string);
5288 if(_class && !strcmp(_class->fullName, "ecere::com::Class") && source->kind == 13 && source->type && source->type->kind == 1 && sourceExp->type == 3)
5290 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
5291 struct Declarator * decl;
5294 ReadString(string, sourceExp->string);
5295 decl = SpecDeclFromString(string, specs, (((void *)0)));
5296 FreeExpContents(sourceExp);
5297 FreeType(sourceExp->expType);
5298 sourceExp->type = 26;
5299 sourceExp->_classExp.specifiers = specs;
5300 sourceExp->_classExp.decl = decl;
5301 sourceExp->expType = dest;
5305 if(backupSourceExpType)
5306 FreeType(backupSourceExpType);
5310 else if(source->kind == 8)
5312 struct __ecereNameSpace__ecere__com__Class * _class = source->_class ? source->_class->registered : (((void *)0));
5314 if(_class && (_class->type == 3 || !strcmp(_class->fullName, "bool") || _class->type == 2))
5318 struct Type * tempType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
5319 struct Type * tempDest, * tempSource;
5321 if(!source->_class->registered->dataType)
5322 source->_class->registered->dataType = ProcessTypeString(source->_class->registered->dataTypeString, 0x0);
5323 for(; _class->base->type != 1000; _class = _class->base)
5326 tempSource = tempType;
5328 tempType->_class = FindClass(_class->fullName);
5329 tempType->truth = source->truth;
5330 tempType->classObjectType = source->classObjectType;
5331 if(tempType->_class)
5332 MatchTypes(tempSource, tempDest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
5333 if(conversions->last)
5335 ((struct Conversion *)conversions->last)->resultType = dest;
5338 FreeType(sourceExp->expType);
5339 sourceExp->expType = MkClassType(_class->fullName);
5340 sourceExp->expType->truth = source->truth;
5341 sourceExp->expType->classObjectType = source->classObjectType;
5342 if(!sourceExp->destType)
5344 FreeType(sourceExp->destType);
5345 sourceExp->destType = sourceExp->expType;
5346 if(sourceExp->expType)
5347 sourceExp->expType->refCount++;
5349 if(!_class->dataType)
5350 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5352 dest = MkClassType(source->_class->string);
5353 dest->truth = source->truth;
5354 dest->classObjectType = source->classObjectType;
5356 source = _class->dataType;
5358 ((tempType ? (__ecereClass_Type->Destructor ? __ecereClass_Type->Destructor(tempType) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(tempType)) : 0), tempType = 0);
5364 if(MatchTypes(source, dest, conversions, (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0))
5373 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class ? dest->_class->registered : (((void *)0));
5375 if(_class && !dest->truth && (_class->type == 3 || !strcmp(_class->fullName, "bool") || (_class->type != 1 && !value && source->kind == 3) || _class->type == 2))
5377 if(_class->type == 0 || _class->type == 5)
5379 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5381 *newExp = *sourceExp;
5382 if(sourceExp->destType)
5383 sourceExp->destType->refCount++;
5384 if(sourceExp->expType)
5385 sourceExp->expType->refCount++;
5386 sourceExp->type = 11;
5387 sourceExp->cast.typeName = MkTypeName(MkListOne(MkSpecifier(VOID)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0))));
5388 sourceExp->cast.exp = newExp;
5389 FreeType(sourceExp->expType);
5390 sourceExp->expType = (((void *)0));
5391 ProcessExpressionType(sourceExp);
5394 FreeType(sourceExp->expType);
5395 sourceExp->expType = dest;
5400 if(backupSourceExpType)
5401 FreeType(backupSourceExpType);
5404 if(!_class->dataType)
5405 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
5407 dest = _class->dataType;
5410 if(dest->kind == 7 && (source->kind == 7 || source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5412 specs = MkListOne(MkSpecifier(DOUBLE));
5414 else if(dest->kind == 6 && (source->kind == 6 || dest->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 7))
5416 specs = MkListOne(MkSpecifier(FLOAT));
5418 else if(dest->kind == 4 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5422 ListAdd(specs, MkSpecifier(UNSIGNED));
5423 ListAdd(specs, MkSpecifier(INT64));
5425 else if(dest->kind == 3 && (source->kind == 3 || source->kind == 2 || source->kind == 1 || source->kind == 6 || source->kind == 7))
5429 ListAdd(specs, MkSpecifier(UNSIGNED));
5430 ListAdd(specs, MkSpecifier(INT));
5432 else if(dest->kind == 2 && (source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5436 ListAdd(specs, MkSpecifier(UNSIGNED));
5437 ListAdd(specs, MkSpecifier(SHORT));
5439 else if(dest->kind == 1 && (source->kind == 1 || source->kind == 2 || source->kind == 3 || source->kind == 6 || source->kind == 7))
5443 ListAdd(specs, MkSpecifier(UNSIGNED));
5444 ListAdd(specs, MkSpecifier(CHAR));
5450 if(backupSourceExpType)
5452 if(sourceExp->expType)
5453 FreeType(sourceExp->expType);
5454 sourceExp->expType = backupSourceExpType;
5459 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))
5461 specs = MkListOne(MkSpecifier(DOUBLE));
5463 else if(dest->kind == 6 && (source->kind == 6 || source->kind == 15 || source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5465 specs = MkListOne(MkSpecifier(FLOAT));
5467 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)))
5471 ListAdd(specs, MkSpecifier(UNSIGNED));
5472 ListAdd(specs, MkSpecifier(CHAR));
5474 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)))))
5478 ListAdd(specs, MkSpecifier(UNSIGNED));
5479 ListAdd(specs, MkSpecifier(SHORT));
5481 else if(dest->kind == 3 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3))
5485 ListAdd(specs, MkSpecifier(UNSIGNED));
5486 ListAdd(specs, MkSpecifier(INT));
5488 else if(dest->kind == 4 && (source->kind == 15 || source->kind == 2 || source->kind == 1 || source->kind == 3 || source->kind == 4))
5492 ListAdd(specs, MkSpecifier(UNSIGNED));
5493 ListAdd(specs, MkSpecifier(INT64));
5495 else if(dest->kind == 15 && (source->kind == 4 || source->kind == 3 || source->kind == 2 || source->kind == 1))
5497 specs = MkListOne(MkEnum(MkIdentifier(dest->enumName), (((void *)0))));
5503 if(backupSourceExpType)
5505 if(sourceExp->expType)
5506 FreeType(sourceExp->expType);
5507 sourceExp->expType = backupSourceExpType;
5513 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
5515 *newExp = *sourceExp;
5516 newExp->prev = (((void *)0));
5517 newExp->next = (((void *)0));
5518 if(sourceExp->destType)
5519 sourceExp->destType->refCount++;
5520 if(sourceExp->expType)
5521 sourceExp->expType->refCount++;
5522 sourceExp->type = 11;
5523 if(realDest->kind == 8)
5525 sourceExp->cast.typeName = QMkClass(realDest->_class->string, (((void *)0)));
5526 FreeList(specs, FreeSpecifier);
5529 sourceExp->cast.typeName = MkTypeName(specs, (((void *)0)));
5530 if(newExp->type == 4)
5532 sourceExp->cast.exp = MkExpBrackets(MkListOne(newExp));
5535 sourceExp->cast.exp = newExp;
5536 FreeType(sourceExp->expType);
5537 sourceExp->expType = (((void *)0));
5538 ProcessExpressionType(sourceExp);
5541 FreeList(specs, FreeSpecifier);
5544 if(backupSourceExpType)
5545 FreeType(backupSourceExpType);
5550 while((sourceExp->type == 5 || sourceExp->type == 34) && sourceExp->list)
5551 sourceExp = (*sourceExp->list).last;
5552 if(sourceExp->type == 0)
5554 struct Identifier * id = sourceExp->identifier;
5558 if(dest->_class && dest->_class->registered && dest->_class->registered->type == 4)
5560 struct __ecereNameSpace__ecere__com__Class * _class = dest->_class->registered;
5561 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
5565 for(; _class && _class->type == 4; _class = _class->base)
5567 struct __ecereNameSpace__ecere__sys__NamedLink * value;
5568 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
5570 for(value = e->values.first; value; value = value->next)
5572 if(!strcmp(value->name, id->string))
5577 FreeExpContents(sourceExp);
5578 FreeType(sourceExp->expType);
5579 sourceExp->isConstant = 0x1;
5580 sourceExp->expType = MkClassType(_class->fullName);
5584 sourceExp->type = 2;
5585 if(_class->dataTypeString && !strcmp(_class->dataTypeString, "int"))
5586 sprintf(constant, "%d", value->data);
5588 sprintf(constant, "0x%X", value->data);
5589 sourceExp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
5597 if(dest->classObjectType != 2 && dest->kind == 8 && MatchWithEnums_Module(privateModule, sourceExp, dest, id->string, conversions))
5604 static unsigned int IntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5606 int value2 = op2->i;
5609 exp->string = PrintInt(op1->i + value2);
5612 exp->expType = op1->type;
5614 op1->type->refCount++;
5619 static unsigned int UIntAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5621 unsigned int value2 = op2->ui;
5624 exp->string = PrintUInt(op1->ui + value2);
5627 exp->expType = op1->type;
5629 op1->type->refCount++;
5634 static unsigned int ShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5636 short value2 = op2->s;
5639 exp->string = PrintShort(op1->s + value2);
5642 exp->expType = op1->type;
5644 op1->type->refCount++;
5649 static unsigned int UShortAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5651 unsigned short value2 = op2->us;
5654 exp->string = PrintUShort(op1->us + value2);
5657 exp->expType = op1->type;
5659 op1->type->refCount++;
5664 static unsigned int CharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5666 char value2 = op2->c;
5669 exp->string = PrintChar(op1->c + value2);
5672 exp->expType = op1->type;
5674 op1->type->refCount++;
5679 static unsigned int UCharAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5681 unsigned char value2 = op2->uc;
5684 exp->string = PrintUChar(op1->uc + value2);
5687 exp->expType = op1->type;
5689 op1->type->refCount++;
5694 static unsigned int FloatAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5696 float value2 = op2->f;
5699 exp->string = PrintFloat(op1->f + value2);
5702 exp->expType = op1->type;
5704 op1->type->refCount++;
5709 static unsigned int DoubleAdd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5711 double value2 = op2->d;
5714 exp->string = PrintDouble(op1->d + value2);
5717 exp->expType = op1->type;
5719 op1->type->refCount++;
5724 static unsigned int IntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5726 int value2 = op2->i;
5729 exp->string = PrintInt(op1->i - value2);
5732 exp->expType = op1->type;
5734 op1->type->refCount++;
5739 static unsigned int UIntSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5741 unsigned int value2 = op2->ui;
5744 exp->string = PrintUInt(op1->ui - value2);
5747 exp->expType = op1->type;
5749 op1->type->refCount++;
5754 static unsigned int ShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5756 short value2 = op2->s;
5759 exp->string = PrintShort(op1->s - value2);
5762 exp->expType = op1->type;
5764 op1->type->refCount++;
5769 static unsigned int UShortSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5771 unsigned short value2 = op2->us;
5774 exp->string = PrintUShort(op1->us - value2);
5777 exp->expType = op1->type;
5779 op1->type->refCount++;
5784 static unsigned int CharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5786 char value2 = op2->c;
5789 exp->string = PrintChar(op1->c - value2);
5792 exp->expType = op1->type;
5794 op1->type->refCount++;
5799 static unsigned int UCharSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5801 unsigned char value2 = op2->uc;
5804 exp->string = PrintUChar(op1->uc - value2);
5807 exp->expType = op1->type;
5809 op1->type->refCount++;
5814 static unsigned int FloatSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5816 float value2 = op2->f;
5819 exp->string = PrintFloat(op1->f - value2);
5822 exp->expType = op1->type;
5824 op1->type->refCount++;
5829 static unsigned int DoubleSub(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5831 double value2 = op2->d;
5834 exp->string = PrintDouble(op1->d - value2);
5837 exp->expType = op1->type;
5839 op1->type->refCount++;
5844 static unsigned int IntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5846 int value2 = op2->i;
5849 exp->string = PrintInt(op1->i * value2);
5852 exp->expType = op1->type;
5854 op1->type->refCount++;
5859 static unsigned int UIntMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5861 unsigned int value2 = op2->ui;
5864 exp->string = PrintUInt(op1->ui * value2);
5867 exp->expType = op1->type;
5869 op1->type->refCount++;
5874 static unsigned int ShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5876 short value2 = op2->s;
5879 exp->string = PrintShort(op1->s * value2);
5882 exp->expType = op1->type;
5884 op1->type->refCount++;
5889 static unsigned int UShortMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5891 unsigned short value2 = op2->us;
5894 exp->string = PrintUShort(op1->us * value2);
5897 exp->expType = op1->type;
5899 op1->type->refCount++;
5904 static unsigned int CharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5906 char value2 = op2->c;
5909 exp->string = PrintChar(op1->c * value2);
5912 exp->expType = op1->type;
5914 op1->type->refCount++;
5919 static unsigned int UCharMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5921 unsigned char value2 = op2->uc;
5924 exp->string = PrintUChar(op1->uc * value2);
5927 exp->expType = op1->type;
5929 op1->type->refCount++;
5934 static unsigned int FloatMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5936 float value2 = op2->f;
5939 exp->string = PrintFloat(op1->f * value2);
5942 exp->expType = op1->type;
5944 op1->type->refCount++;
5949 static unsigned int DoubleMul(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5951 double value2 = op2->d;
5954 exp->string = PrintDouble(op1->d * value2);
5957 exp->expType = op1->type;
5959 op1->type->refCount++;
5964 static unsigned int IntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5966 int value2 = op2->i;
5969 exp->string = PrintInt(value2 ? (op1->i / value2) : 0);
5972 exp->expType = op1->type;
5974 op1->type->refCount++;
5979 static unsigned int UIntDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5981 unsigned int value2 = op2->ui;
5984 exp->string = PrintUInt(value2 ? (op1->ui / value2) : 0);
5987 exp->expType = op1->type;
5989 op1->type->refCount++;
5994 static unsigned int ShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
5996 short value2 = op2->s;
5999 exp->string = PrintShort(value2 ? (op1->s / value2) : (short)0);
6002 exp->expType = op1->type;
6004 op1->type->refCount++;
6009 static unsigned int UShortDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6011 unsigned short value2 = op2->us;
6014 exp->string = PrintUShort(value2 ? (op1->us / value2) : (unsigned short)0);
6017 exp->expType = op1->type;
6019 op1->type->refCount++;
6024 static unsigned int CharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6026 char value2 = op2->c;
6029 exp->string = PrintChar(value2 ? (op1->c / value2) : (char)0);
6032 exp->expType = op1->type;
6034 op1->type->refCount++;
6039 static unsigned int UCharDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6041 unsigned char value2 = op2->uc;
6044 exp->string = PrintUChar(value2 ? (op1->uc / value2) : (unsigned char)0);
6047 exp->expType = op1->type;
6049 op1->type->refCount++;
6054 static unsigned int FloatDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6056 float value2 = op2->f;
6059 exp->string = PrintFloat(value2 ? (op1->f / value2) : (float)0);
6062 exp->expType = op1->type;
6064 op1->type->refCount++;
6069 static unsigned int DoubleDiv(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6071 double value2 = op2->d;
6074 exp->string = PrintDouble(value2 ? (op1->d / value2) : (double)0);
6077 exp->expType = op1->type;
6079 op1->type->refCount++;
6084 static unsigned int IntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6086 int value2 = op2->i;
6089 exp->string = PrintInt(value2 ? (op1->i % value2) : 0);
6092 exp->expType = op1->type;
6094 op1->type->refCount++;
6099 static unsigned int UIntMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6101 unsigned int value2 = op2->ui;
6104 exp->string = PrintUInt(value2 ? (op1->ui % value2) : 0);
6107 exp->expType = op1->type;
6109 op1->type->refCount++;
6114 static unsigned int ShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6116 short value2 = op2->s;
6119 exp->string = PrintShort(value2 ? (op1->s % value2) : (short)0);
6122 exp->expType = op1->type;
6124 op1->type->refCount++;
6129 static unsigned int UShortMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6131 unsigned short value2 = op2->us;
6134 exp->string = PrintUShort(value2 ? (op1->us % value2) : (unsigned short)0);
6137 exp->expType = op1->type;
6139 op1->type->refCount++;
6144 static unsigned int CharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6146 char value2 = op2->c;
6149 exp->string = PrintChar(value2 ? (op1->c % value2) : (char)0);
6152 exp->expType = op1->type;
6154 op1->type->refCount++;
6159 static unsigned int UCharMod(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6161 unsigned char value2 = op2->uc;
6164 exp->string = PrintUChar(value2 ? (op1->uc % value2) : (unsigned char)0);
6167 exp->expType = op1->type;
6169 op1->type->refCount++;
6174 static unsigned int IntNeg(struct Expression * exp, struct Operand * op1)
6177 exp->string = PrintInt(-op1->i);
6180 exp->expType = op1->type;
6182 op1->type->refCount++;
6187 static unsigned int UIntNeg(struct Expression * exp, struct Operand * op1)
6190 exp->string = PrintUInt(-op1->ui);
6193 exp->expType = op1->type;
6195 op1->type->refCount++;
6200 static unsigned int ShortNeg(struct Expression * exp, struct Operand * op1)
6203 exp->string = PrintShort(-op1->s);
6206 exp->expType = op1->type;
6208 op1->type->refCount++;
6213 static unsigned int UShortNeg(struct Expression * exp, struct Operand * op1)
6216 exp->string = PrintUShort(-op1->us);
6219 exp->expType = op1->type;
6221 op1->type->refCount++;
6226 static unsigned int CharNeg(struct Expression * exp, struct Operand * op1)
6229 exp->string = PrintChar(-op1->c);
6232 exp->expType = op1->type;
6234 op1->type->refCount++;
6239 static unsigned int UCharNeg(struct Expression * exp, struct Operand * op1)
6242 exp->string = PrintUChar(-op1->uc);
6245 exp->expType = op1->type;
6247 op1->type->refCount++;
6252 static unsigned int FloatNeg(struct Expression * exp, struct Operand * op1)
6255 exp->string = PrintFloat(-op1->f);
6258 exp->expType = op1->type;
6260 op1->type->refCount++;
6265 static unsigned int DoubleNeg(struct Expression * exp, struct Operand * op1)
6268 exp->string = PrintDouble(-op1->d);
6271 exp->expType = op1->type;
6273 op1->type->refCount++;
6278 static unsigned int IntInc(struct Expression * exp, struct Operand * op1)
6281 exp->string = PrintInt(++op1->i);
6284 exp->expType = op1->type;
6286 op1->type->refCount++;
6291 static unsigned int UIntInc(struct Expression * exp, struct Operand * op1)
6294 exp->string = PrintUInt(++op1->ui);
6297 exp->expType = op1->type;
6299 op1->type->refCount++;
6304 static unsigned int ShortInc(struct Expression * exp, struct Operand * op1)
6307 exp->string = PrintShort(++op1->s);
6310 exp->expType = op1->type;
6312 op1->type->refCount++;
6317 static unsigned int UShortInc(struct Expression * exp, struct Operand * op1)
6320 exp->string = PrintUShort(++op1->us);
6323 exp->expType = op1->type;
6325 op1->type->refCount++;
6330 static unsigned int CharInc(struct Expression * exp, struct Operand * op1)
6333 exp->string = PrintChar(++op1->c);
6336 exp->expType = op1->type;
6338 op1->type->refCount++;
6343 static unsigned int UCharInc(struct Expression * exp, struct Operand * op1)
6346 exp->string = PrintUChar(++op1->uc);
6349 exp->expType = op1->type;
6351 op1->type->refCount++;
6356 static unsigned int FloatInc(struct Expression * exp, struct Operand * op1)
6359 exp->string = PrintFloat(++op1->f);
6362 exp->expType = op1->type;
6364 op1->type->refCount++;
6369 static unsigned int DoubleInc(struct Expression * exp, struct Operand * op1)
6372 exp->string = PrintDouble(++op1->d);
6375 exp->expType = op1->type;
6377 op1->type->refCount++;
6382 static unsigned int IntDec(struct Expression * exp, struct Operand * op1)
6385 exp->string = PrintInt(--op1->i);
6388 exp->expType = op1->type;
6390 op1->type->refCount++;
6395 static unsigned int UIntDec(struct Expression * exp, struct Operand * op1)
6398 exp->string = PrintUInt(--op1->ui);
6401 exp->expType = op1->type;
6403 op1->type->refCount++;
6408 static unsigned int ShortDec(struct Expression * exp, struct Operand * op1)
6411 exp->string = PrintShort(--op1->s);
6414 exp->expType = op1->type;
6416 op1->type->refCount++;
6421 static unsigned int UShortDec(struct Expression * exp, struct Operand * op1)
6424 exp->string = PrintUShort(--op1->us);
6427 exp->expType = op1->type;
6429 op1->type->refCount++;
6434 static unsigned int CharDec(struct Expression * exp, struct Operand * op1)
6437 exp->string = PrintChar(--op1->c);
6440 exp->expType = op1->type;
6442 op1->type->refCount++;
6447 static unsigned int UCharDec(struct Expression * exp, struct Operand * op1)
6450 exp->string = PrintUChar(--op1->uc);
6453 exp->expType = op1->type;
6455 op1->type->refCount++;
6460 static unsigned int FloatDec(struct Expression * exp, struct Operand * op1)
6463 exp->string = PrintFloat(--op1->f);
6466 exp->expType = op1->type;
6468 op1->type->refCount++;
6473 static unsigned int DoubleDec(struct Expression * exp, struct Operand * op1)
6476 exp->string = PrintDouble(--op1->d);
6479 exp->expType = op1->type;
6481 op1->type->refCount++;
6486 static unsigned int IntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6488 int value2 = op2->i;
6491 exp->string = PrintInt(op1->i = value2);
6494 exp->expType = op1->type;
6496 op1->type->refCount++;
6501 static unsigned int UIntAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6503 unsigned int value2 = op2->ui;
6506 exp->string = PrintUInt(op1->ui = value2);
6509 exp->expType = op1->type;
6511 op1->type->refCount++;
6516 static unsigned int ShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6518 short value2 = op2->s;
6521 exp->string = PrintShort(op1->s = value2);
6524 exp->expType = op1->type;
6526 op1->type->refCount++;
6531 static unsigned int UShortAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6533 unsigned short value2 = op2->us;
6536 exp->string = PrintUShort(op1->us = value2);
6539 exp->expType = op1->type;
6541 op1->type->refCount++;
6546 static unsigned int CharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6548 char value2 = op2->c;
6551 exp->string = PrintChar(op1->c = value2);
6554 exp->expType = op1->type;
6556 op1->type->refCount++;
6561 static unsigned int UCharAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6563 unsigned char value2 = op2->uc;
6566 exp->string = PrintUChar(op1->uc = value2);
6569 exp->expType = op1->type;
6571 op1->type->refCount++;
6576 static unsigned int FloatAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6578 float value2 = op2->f;
6581 exp->string = PrintFloat(op1->f = value2);
6584 exp->expType = op1->type;
6586 op1->type->refCount++;
6591 static unsigned int DoubleAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6593 double value2 = op2->d;
6596 exp->string = PrintDouble(op1->d = value2);
6599 exp->expType = op1->type;
6601 op1->type->refCount++;
6606 static unsigned int IntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6608 int value2 = op2->i;
6611 exp->string = PrintInt(op1->i += value2);
6614 exp->expType = op1->type;
6616 op1->type->refCount++;
6621 static unsigned int UIntAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6623 unsigned int value2 = op2->ui;
6626 exp->string = PrintUInt(op1->ui += value2);
6629 exp->expType = op1->type;
6631 op1->type->refCount++;
6636 static unsigned int ShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6638 short value2 = op2->s;
6641 exp->string = PrintShort(op1->s += value2);
6644 exp->expType = op1->type;
6646 op1->type->refCount++;
6651 static unsigned int UShortAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6653 unsigned short value2 = op2->us;
6656 exp->string = PrintUShort(op1->us += value2);
6659 exp->expType = op1->type;
6661 op1->type->refCount++;
6666 static unsigned int CharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6668 char value2 = op2->c;
6671 exp->string = PrintChar(op1->c += value2);
6674 exp->expType = op1->type;
6676 op1->type->refCount++;
6681 static unsigned int UCharAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6683 unsigned char value2 = op2->uc;
6686 exp->string = PrintUChar(op1->uc += value2);
6689 exp->expType = op1->type;
6691 op1->type->refCount++;
6696 static unsigned int FloatAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6698 float value2 = op2->f;
6701 exp->string = PrintFloat(op1->f += value2);
6704 exp->expType = op1->type;
6706 op1->type->refCount++;
6711 static unsigned int DoubleAddAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6713 double value2 = op2->d;
6716 exp->string = PrintDouble(op1->d += value2);
6719 exp->expType = op1->type;
6721 op1->type->refCount++;
6726 static unsigned int IntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6728 int value2 = op2->i;
6731 exp->string = PrintInt(op1->i -= value2);
6734 exp->expType = op1->type;
6736 op1->type->refCount++;
6741 static unsigned int UIntSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6743 unsigned int value2 = op2->ui;
6746 exp->string = PrintUInt(op1->ui -= value2);
6749 exp->expType = op1->type;
6751 op1->type->refCount++;
6756 static unsigned int ShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6758 short value2 = op2->s;
6761 exp->string = PrintShort(op1->s -= value2);
6764 exp->expType = op1->type;
6766 op1->type->refCount++;
6771 static unsigned int UShortSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6773 unsigned short value2 = op2->us;
6776 exp->string = PrintUShort(op1->us -= value2);
6779 exp->expType = op1->type;
6781 op1->type->refCount++;
6786 static unsigned int CharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6788 char value2 = op2->c;
6791 exp->string = PrintChar(op1->c -= value2);
6794 exp->expType = op1->type;
6796 op1->type->refCount++;
6801 static unsigned int UCharSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6803 unsigned char value2 = op2->uc;
6806 exp->string = PrintUChar(op1->uc -= value2);
6809 exp->expType = op1->type;
6811 op1->type->refCount++;
6816 static unsigned int FloatSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6818 float value2 = op2->f;
6821 exp->string = PrintFloat(op1->f -= value2);
6824 exp->expType = op1->type;
6826 op1->type->refCount++;
6831 static unsigned int DoubleSubAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6833 double value2 = op2->d;
6836 exp->string = PrintDouble(op1->d -= value2);
6839 exp->expType = op1->type;
6841 op1->type->refCount++;
6846 static unsigned int IntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6848 int value2 = op2->i;
6851 exp->string = PrintInt(op1->i *= value2);
6854 exp->expType = op1->type;
6856 op1->type->refCount++;
6861 static unsigned int UIntMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6863 unsigned int value2 = op2->ui;
6866 exp->string = PrintUInt(op1->ui *= value2);
6869 exp->expType = op1->type;
6871 op1->type->refCount++;
6876 static unsigned int ShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6878 short value2 = op2->s;
6881 exp->string = PrintShort(op1->s *= value2);
6884 exp->expType = op1->type;
6886 op1->type->refCount++;
6891 static unsigned int UShortMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6893 unsigned short value2 = op2->us;
6896 exp->string = PrintUShort(op1->us *= value2);
6899 exp->expType = op1->type;
6901 op1->type->refCount++;
6906 static unsigned int CharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6908 char value2 = op2->c;
6911 exp->string = PrintChar(op1->c *= value2);
6914 exp->expType = op1->type;
6916 op1->type->refCount++;
6921 static unsigned int UCharMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6923 unsigned char value2 = op2->uc;
6926 exp->string = PrintUChar(op1->uc *= value2);
6929 exp->expType = op1->type;
6931 op1->type->refCount++;
6936 static unsigned int FloatMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6938 float value2 = op2->f;
6941 exp->string = PrintFloat(op1->f *= value2);
6944 exp->expType = op1->type;
6946 op1->type->refCount++;
6951 static unsigned int DoubleMulAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6953 double value2 = op2->d;
6956 exp->string = PrintDouble(op1->d *= value2);
6959 exp->expType = op1->type;
6961 op1->type->refCount++;
6966 static unsigned int IntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6968 int value2 = op2->i;
6971 exp->string = PrintInt(value2 ? (op1->i /= value2) : 0);
6974 exp->expType = op1->type;
6976 op1->type->refCount++;
6981 static unsigned int UIntDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6983 unsigned int value2 = op2->ui;
6986 exp->string = PrintUInt(value2 ? (op1->ui /= value2) : 0);
6989 exp->expType = op1->type;
6991 op1->type->refCount++;
6996 static unsigned int ShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
6998 short value2 = op2->s;
7001 exp->string = PrintShort(value2 ? (op1->s /= value2) : (short)0);
7004 exp->expType = op1->type;
7006 op1->type->refCount++;
7011 static unsigned int UShortDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7013 unsigned short value2 = op2->us;
7016 exp->string = PrintUShort(value2 ? (op1->us /= value2) : (unsigned short)0);
7019 exp->expType = op1->type;
7021 op1->type->refCount++;
7026 static unsigned int CharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7028 char value2 = op2->c;
7031 exp->string = PrintChar(value2 ? (op1->c /= value2) : (char)0);
7034 exp->expType = op1->type;
7036 op1->type->refCount++;
7041 static unsigned int UCharDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7043 unsigned char value2 = op2->uc;
7046 exp->string = PrintUChar(value2 ? (op1->uc /= value2) : (unsigned char)0);
7049 exp->expType = op1->type;
7051 op1->type->refCount++;
7056 static unsigned int FloatDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7058 float value2 = op2->f;
7061 exp->string = PrintFloat(value2 ? (op1->f /= value2) : (float)0);
7064 exp->expType = op1->type;
7066 op1->type->refCount++;
7071 static unsigned int DoubleDivAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7073 double value2 = op2->d;
7076 exp->string = PrintDouble(value2 ? (op1->d /= value2) : (double)0);
7079 exp->expType = op1->type;
7081 op1->type->refCount++;
7086 static unsigned int IntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7088 int value2 = op2->i;
7091 exp->string = PrintInt(value2 ? (op1->i %= value2) : 0);
7094 exp->expType = op1->type;
7096 op1->type->refCount++;
7101 static unsigned int UIntModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7103 unsigned int value2 = op2->ui;
7106 exp->string = PrintUInt(value2 ? (op1->ui %= value2) : 0);
7109 exp->expType = op1->type;
7111 op1->type->refCount++;
7116 static unsigned int ShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7118 short value2 = op2->s;
7121 exp->string = PrintShort(value2 ? (op1->s %= value2) : (short)0);
7124 exp->expType = op1->type;
7126 op1->type->refCount++;
7131 static unsigned int UShortModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7133 unsigned short value2 = op2->us;
7136 exp->string = PrintUShort(value2 ? (op1->us %= value2) : (unsigned short)0);
7139 exp->expType = op1->type;
7141 op1->type->refCount++;
7146 static unsigned int CharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7148 char value2 = op2->c;
7151 exp->string = PrintChar(value2 ? (op1->c %= value2) : (char)0);
7154 exp->expType = op1->type;
7156 op1->type->refCount++;
7161 static unsigned int UCharModAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7163 unsigned char value2 = op2->uc;
7166 exp->string = PrintUChar(value2 ? (op1->uc %= value2) : (unsigned char)0);
7169 exp->expType = op1->type;
7171 op1->type->refCount++;
7176 static unsigned int IntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7178 int value2 = op2->i;
7181 exp->string = PrintInt(op1->i & value2);
7184 exp->expType = op1->type;
7186 op1->type->refCount++;
7191 static unsigned int UIntBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7193 unsigned int value2 = op2->ui;
7196 exp->string = PrintUInt(op1->ui & value2);
7199 exp->expType = op1->type;
7201 op1->type->refCount++;
7206 static unsigned int ShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7208 short value2 = op2->s;
7211 exp->string = PrintShort(op1->s & value2);
7214 exp->expType = op1->type;
7216 op1->type->refCount++;
7221 static unsigned int UShortBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7223 unsigned short value2 = op2->us;
7226 exp->string = PrintUShort(op1->us & value2);
7229 exp->expType = op1->type;
7231 op1->type->refCount++;
7236 static unsigned int CharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7238 char value2 = op2->c;
7241 exp->string = PrintChar(op1->c & value2);
7244 exp->expType = op1->type;
7246 op1->type->refCount++;
7251 static unsigned int UCharBitAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7253 unsigned char value2 = op2->uc;
7256 exp->string = PrintUChar(op1->uc & value2);
7259 exp->expType = op1->type;
7261 op1->type->refCount++;
7266 static unsigned int IntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7268 int value2 = op2->i;
7271 exp->string = PrintInt(op1->i | value2);
7274 exp->expType = op1->type;
7276 op1->type->refCount++;
7281 static unsigned int UIntBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7283 unsigned int value2 = op2->ui;
7286 exp->string = PrintUInt(op1->ui | value2);
7289 exp->expType = op1->type;
7291 op1->type->refCount++;
7296 static unsigned int ShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7298 short value2 = op2->s;
7301 exp->string = PrintShort(op1->s | value2);
7304 exp->expType = op1->type;
7306 op1->type->refCount++;
7311 static unsigned int UShortBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7313 unsigned short value2 = op2->us;
7316 exp->string = PrintUShort(op1->us | value2);
7319 exp->expType = op1->type;
7321 op1->type->refCount++;
7326 static unsigned int CharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7328 char value2 = op2->c;
7331 exp->string = PrintChar(op1->c | value2);
7334 exp->expType = op1->type;
7336 op1->type->refCount++;
7341 static unsigned int UCharBitOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7343 unsigned char value2 = op2->uc;
7346 exp->string = PrintUChar(op1->uc | value2);
7349 exp->expType = op1->type;
7351 op1->type->refCount++;
7356 static unsigned int IntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7358 int value2 = op2->i;
7361 exp->string = PrintInt(op1->i ^ value2);
7364 exp->expType = op1->type;
7366 op1->type->refCount++;
7371 static unsigned int UIntBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7373 unsigned int value2 = op2->ui;
7376 exp->string = PrintUInt(op1->ui ^ value2);
7379 exp->expType = op1->type;
7381 op1->type->refCount++;
7386 static unsigned int ShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7388 short value2 = op2->s;
7391 exp->string = PrintShort(op1->s ^ value2);
7394 exp->expType = op1->type;
7396 op1->type->refCount++;
7401 static unsigned int UShortBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7403 unsigned short value2 = op2->us;
7406 exp->string = PrintUShort(op1->us ^ value2);
7409 exp->expType = op1->type;
7411 op1->type->refCount++;
7416 static unsigned int CharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7418 char value2 = op2->c;
7421 exp->string = PrintChar(op1->c ^ value2);
7424 exp->expType = op1->type;
7426 op1->type->refCount++;
7431 static unsigned int UCharBitXor(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7433 unsigned char value2 = op2->uc;
7436 exp->string = PrintUChar(op1->uc ^ value2);
7439 exp->expType = op1->type;
7441 op1->type->refCount++;
7446 static unsigned int IntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7448 int value2 = op2->i;
7451 exp->string = PrintInt(op1->i << value2);
7454 exp->expType = op1->type;
7456 op1->type->refCount++;
7461 static unsigned int UIntLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7463 unsigned int value2 = op2->ui;
7466 exp->string = PrintUInt(op1->ui << value2);
7469 exp->expType = op1->type;
7471 op1->type->refCount++;
7476 static unsigned int ShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7478 short value2 = op2->s;
7481 exp->string = PrintShort(op1->s << value2);
7484 exp->expType = op1->type;
7486 op1->type->refCount++;
7491 static unsigned int UShortLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7493 unsigned short value2 = op2->us;
7496 exp->string = PrintUShort(op1->us << value2);
7499 exp->expType = op1->type;
7501 op1->type->refCount++;
7506 static unsigned int CharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7508 char value2 = op2->c;
7511 exp->string = PrintChar(op1->c << value2);
7514 exp->expType = op1->type;
7516 op1->type->refCount++;
7521 static unsigned int UCharLShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7523 unsigned char value2 = op2->uc;
7526 exp->string = PrintUChar(op1->uc << value2);
7529 exp->expType = op1->type;
7531 op1->type->refCount++;
7536 static unsigned int IntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7538 int value2 = op2->i;
7541 exp->string = PrintInt(op1->i >> value2);
7544 exp->expType = op1->type;
7546 op1->type->refCount++;
7551 static unsigned int UIntRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7553 unsigned int value2 = op2->ui;
7556 exp->string = PrintUInt(op1->ui >> value2);
7559 exp->expType = op1->type;
7561 op1->type->refCount++;
7566 static unsigned int ShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7568 short value2 = op2->s;
7571 exp->string = PrintShort(op1->s >> value2);
7574 exp->expType = op1->type;
7576 op1->type->refCount++;
7581 static unsigned int UShortRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7583 unsigned short value2 = op2->us;
7586 exp->string = PrintUShort(op1->us >> value2);
7589 exp->expType = op1->type;
7591 op1->type->refCount++;
7596 static unsigned int CharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7598 char value2 = op2->c;
7601 exp->string = PrintChar(op1->c >> value2);
7604 exp->expType = op1->type;
7606 op1->type->refCount++;
7611 static unsigned int UCharRShift(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7613 unsigned char value2 = op2->uc;
7616 exp->string = PrintUChar(op1->uc >> value2);
7619 exp->expType = op1->type;
7621 op1->type->refCount++;
7626 static unsigned int IntBitNot(struct Expression * exp, struct Operand * op1)
7629 exp->string = PrintInt(~op1->i);
7632 exp->expType = op1->type;
7634 op1->type->refCount++;
7639 static unsigned int UIntBitNot(struct Expression * exp, struct Operand * op1)
7642 exp->string = PrintUInt(~op1->ui);
7645 exp->expType = op1->type;
7647 op1->type->refCount++;
7652 static unsigned int ShortBitNot(struct Expression * exp, struct Operand * op1)
7655 exp->string = PrintShort(~op1->s);
7658 exp->expType = op1->type;
7660 op1->type->refCount++;
7665 static unsigned int UShortBitNot(struct Expression * exp, struct Operand * op1)
7668 exp->string = PrintUShort(~op1->us);
7671 exp->expType = op1->type;
7673 op1->type->refCount++;
7678 static unsigned int CharBitNot(struct Expression * exp, struct Operand * op1)
7681 exp->string = PrintChar(~op1->c);
7684 exp->expType = op1->type;
7686 op1->type->refCount++;
7691 static unsigned int UCharBitNot(struct Expression * exp, struct Operand * op1)
7694 exp->string = PrintUChar(~op1->uc);
7697 exp->expType = op1->type;
7699 op1->type->refCount++;
7704 static unsigned int IntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7706 int value2 = op2->i;
7709 exp->string = PrintInt(op1->i &= value2);
7712 exp->expType = op1->type;
7714 op1->type->refCount++;
7719 static unsigned int UIntAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7721 unsigned int value2 = op2->ui;
7724 exp->string = PrintUInt(op1->ui &= value2);
7727 exp->expType = op1->type;
7729 op1->type->refCount++;
7734 static unsigned int ShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7736 short value2 = op2->s;
7739 exp->string = PrintShort(op1->s &= value2);
7742 exp->expType = op1->type;
7744 op1->type->refCount++;
7749 static unsigned int UShortAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7751 unsigned short value2 = op2->us;
7754 exp->string = PrintUShort(op1->us &= value2);
7757 exp->expType = op1->type;
7759 op1->type->refCount++;
7764 static unsigned int CharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7766 char value2 = op2->c;
7769 exp->string = PrintChar(op1->c &= value2);
7772 exp->expType = op1->type;
7774 op1->type->refCount++;
7779 static unsigned int UCharAndAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7781 unsigned char value2 = op2->uc;
7784 exp->string = PrintUChar(op1->uc &= value2);
7787 exp->expType = op1->type;
7789 op1->type->refCount++;
7794 static unsigned int IntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7796 int value2 = op2->i;
7799 exp->string = PrintInt(op1->i |= value2);
7802 exp->expType = op1->type;
7804 op1->type->refCount++;
7809 static unsigned int UIntOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7811 unsigned int value2 = op2->ui;
7814 exp->string = PrintUInt(op1->ui |= value2);
7817 exp->expType = op1->type;
7819 op1->type->refCount++;
7824 static unsigned int ShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7826 short value2 = op2->s;
7829 exp->string = PrintShort(op1->s |= value2);
7832 exp->expType = op1->type;
7834 op1->type->refCount++;
7839 static unsigned int UShortOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7841 unsigned short value2 = op2->us;
7844 exp->string = PrintUShort(op1->us |= value2);
7847 exp->expType = op1->type;
7849 op1->type->refCount++;
7854 static unsigned int CharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7856 char value2 = op2->c;
7859 exp->string = PrintChar(op1->c |= value2);
7862 exp->expType = op1->type;
7864 op1->type->refCount++;
7869 static unsigned int UCharOrAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7871 unsigned char value2 = op2->uc;
7874 exp->string = PrintUChar(op1->uc |= value2);
7877 exp->expType = op1->type;
7879 op1->type->refCount++;
7884 static unsigned int IntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7886 int value2 = op2->i;
7889 exp->string = PrintInt(op1->i ^= value2);
7892 exp->expType = op1->type;
7894 op1->type->refCount++;
7899 static unsigned int UIntXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7901 unsigned int value2 = op2->ui;
7904 exp->string = PrintUInt(op1->ui ^= value2);
7907 exp->expType = op1->type;
7909 op1->type->refCount++;
7914 static unsigned int ShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7916 short value2 = op2->s;
7919 exp->string = PrintShort(op1->s ^= value2);
7922 exp->expType = op1->type;
7924 op1->type->refCount++;
7929 static unsigned int UShortXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7931 unsigned short value2 = op2->us;
7934 exp->string = PrintUShort(op1->us ^= value2);
7937 exp->expType = op1->type;
7939 op1->type->refCount++;
7944 static unsigned int CharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7946 char value2 = op2->c;
7949 exp->string = PrintChar(op1->c ^= value2);
7952 exp->expType = op1->type;
7954 op1->type->refCount++;
7959 static unsigned int UCharXorAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7961 unsigned char value2 = op2->uc;
7964 exp->string = PrintUChar(op1->uc ^= value2);
7967 exp->expType = op1->type;
7969 op1->type->refCount++;
7974 static unsigned int IntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7976 int value2 = op2->i;
7979 exp->string = PrintInt(op1->i <<= value2);
7982 exp->expType = op1->type;
7984 op1->type->refCount++;
7989 static unsigned int UIntLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
7991 unsigned int value2 = op2->ui;
7994 exp->string = PrintUInt(op1->ui <<= value2);
7997 exp->expType = op1->type;
7999 op1->type->refCount++;
8004 static unsigned int ShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8006 short value2 = op2->s;
8009 exp->string = PrintShort(op1->s <<= value2);
8012 exp->expType = op1->type;
8014 op1->type->refCount++;
8019 static unsigned int UShortLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8021 unsigned short value2 = op2->us;
8024 exp->string = PrintUShort(op1->us <<= value2);
8027 exp->expType = op1->type;
8029 op1->type->refCount++;
8034 static unsigned int CharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8036 char value2 = op2->c;
8039 exp->string = PrintChar(op1->c <<= value2);
8042 exp->expType = op1->type;
8044 op1->type->refCount++;
8049 static unsigned int UCharLShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8051 unsigned char value2 = op2->uc;
8054 exp->string = PrintUChar(op1->uc <<= value2);
8057 exp->expType = op1->type;
8059 op1->type->refCount++;
8064 static unsigned int IntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8066 int value2 = op2->i;
8069 exp->string = PrintInt(op1->i >>= value2);
8072 exp->expType = op1->type;
8074 op1->type->refCount++;
8079 static unsigned int UIntRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8081 unsigned int value2 = op2->ui;
8084 exp->string = PrintUInt(op1->ui >>= value2);
8087 exp->expType = op1->type;
8089 op1->type->refCount++;
8094 static unsigned int ShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8096 short value2 = op2->s;
8099 exp->string = PrintShort(op1->s >>= value2);
8102 exp->expType = op1->type;
8104 op1->type->refCount++;
8109 static unsigned int UShortRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8111 unsigned short value2 = op2->us;
8114 exp->string = PrintUShort(op1->us >>= value2);
8117 exp->expType = op1->type;
8119 op1->type->refCount++;
8124 static unsigned int CharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8126 char value2 = op2->c;
8129 exp->string = PrintChar(op1->c >>= value2);
8132 exp->expType = op1->type;
8134 op1->type->refCount++;
8139 static unsigned int UCharRShiftAsign(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8141 unsigned char value2 = op2->uc;
8144 exp->string = PrintUChar(op1->uc >>= value2);
8147 exp->expType = op1->type;
8149 op1->type->refCount++;
8154 static unsigned int IntNot(struct Expression * exp, struct Operand * op1)
8157 exp->string = PrintInt(!op1->i);
8160 exp->expType = op1->type;
8162 op1->type->refCount++;
8167 static unsigned int UIntNot(struct Expression * exp, struct Operand * op1)
8170 exp->string = PrintUInt(!op1->ui);
8173 exp->expType = op1->type;
8175 op1->type->refCount++;
8180 static unsigned int ShortNot(struct Expression * exp, struct Operand * op1)
8183 exp->string = PrintShort(!op1->s);
8186 exp->expType = op1->type;
8188 op1->type->refCount++;
8193 static unsigned int UShortNot(struct Expression * exp, struct Operand * op1)
8196 exp->string = PrintUShort(!op1->us);
8199 exp->expType = op1->type;
8201 op1->type->refCount++;
8206 static unsigned int CharNot(struct Expression * exp, struct Operand * op1)
8209 exp->string = PrintChar(!op1->c);
8212 exp->expType = op1->type;
8214 op1->type->refCount++;
8219 static unsigned int UCharNot(struct Expression * exp, struct Operand * op1)
8222 exp->string = PrintUChar(!op1->uc);
8225 exp->expType = op1->type;
8227 op1->type->refCount++;
8232 static unsigned int IntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8234 int value2 = op2->i;
8237 exp->string = PrintInt(op1->i == value2);
8240 exp->expType = op1->type;
8242 op1->type->refCount++;
8247 static unsigned int UIntEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8249 unsigned int value2 = op2->ui;
8252 exp->string = PrintUInt(op1->ui == value2);
8255 exp->expType = op1->type;
8257 op1->type->refCount++;
8262 static unsigned int ShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8264 short value2 = op2->s;
8267 exp->string = PrintShort(op1->s == value2);
8270 exp->expType = op1->type;
8272 op1->type->refCount++;
8277 static unsigned int UShortEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8279 unsigned short value2 = op2->us;
8282 exp->string = PrintUShort(op1->us == value2);
8285 exp->expType = op1->type;
8287 op1->type->refCount++;
8292 static unsigned int CharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8294 char value2 = op2->c;
8297 exp->string = PrintChar(op1->c == value2);
8300 exp->expType = op1->type;
8302 op1->type->refCount++;
8307 static unsigned int UCharEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8309 unsigned char value2 = op2->uc;
8312 exp->string = PrintUChar(op1->uc == value2);
8315 exp->expType = op1->type;
8317 op1->type->refCount++;
8322 static unsigned int FloatEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8324 float value2 = op2->f;
8327 exp->string = PrintFloat(op1->f == value2);
8330 exp->expType = op1->type;
8332 op1->type->refCount++;
8337 static unsigned int DoubleEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8339 double value2 = op2->d;
8342 exp->string = PrintDouble(op1->d == value2);
8345 exp->expType = op1->type;
8347 op1->type->refCount++;
8352 static unsigned int IntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8354 int value2 = op2->i;
8357 exp->string = PrintInt(op1->i != value2);
8360 exp->expType = op1->type;
8362 op1->type->refCount++;
8367 static unsigned int UIntNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8369 unsigned int value2 = op2->ui;
8372 exp->string = PrintUInt(op1->ui != value2);
8375 exp->expType = op1->type;
8377 op1->type->refCount++;
8382 static unsigned int ShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8384 short value2 = op2->s;
8387 exp->string = PrintShort(op1->s != value2);
8390 exp->expType = op1->type;
8392 op1->type->refCount++;
8397 static unsigned int UShortNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8399 unsigned short value2 = op2->us;
8402 exp->string = PrintUShort(op1->us != value2);
8405 exp->expType = op1->type;
8407 op1->type->refCount++;
8412 static unsigned int CharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8414 char value2 = op2->c;
8417 exp->string = PrintChar(op1->c != value2);
8420 exp->expType = op1->type;
8422 op1->type->refCount++;
8427 static unsigned int UCharNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8429 unsigned char value2 = op2->uc;
8432 exp->string = PrintUChar(op1->uc != value2);
8435 exp->expType = op1->type;
8437 op1->type->refCount++;
8442 static unsigned int FloatNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8444 float value2 = op2->f;
8447 exp->string = PrintFloat(op1->f != value2);
8450 exp->expType = op1->type;
8452 op1->type->refCount++;
8457 static unsigned int DoubleNqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8459 double value2 = op2->d;
8462 exp->string = PrintDouble(op1->d != value2);
8465 exp->expType = op1->type;
8467 op1->type->refCount++;
8472 static unsigned int IntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8474 int value2 = op2->i;
8477 exp->string = PrintInt(op1->i && value2);
8480 exp->expType = op1->type;
8482 op1->type->refCount++;
8487 static unsigned int UIntAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8489 unsigned int value2 = op2->ui;
8492 exp->string = PrintUInt(op1->ui && value2);
8495 exp->expType = op1->type;
8497 op1->type->refCount++;
8502 static unsigned int ShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8504 short value2 = op2->s;
8507 exp->string = PrintShort(op1->s && value2);
8510 exp->expType = op1->type;
8512 op1->type->refCount++;
8517 static unsigned int UShortAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8519 unsigned short value2 = op2->us;
8522 exp->string = PrintUShort(op1->us && value2);
8525 exp->expType = op1->type;
8527 op1->type->refCount++;
8532 static unsigned int CharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8534 char value2 = op2->c;
8537 exp->string = PrintChar(op1->c && value2);
8540 exp->expType = op1->type;
8542 op1->type->refCount++;
8547 static unsigned int UCharAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8549 unsigned char value2 = op2->uc;
8552 exp->string = PrintUChar(op1->uc && value2);
8555 exp->expType = op1->type;
8557 op1->type->refCount++;
8562 static unsigned int FloatAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8564 float value2 = op2->f;
8567 exp->string = PrintFloat(op1->f && value2);
8570 exp->expType = op1->type;
8572 op1->type->refCount++;
8577 static unsigned int DoubleAnd(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8579 double value2 = op2->d;
8582 exp->string = PrintDouble(op1->d && value2);
8585 exp->expType = op1->type;
8587 op1->type->refCount++;
8592 static unsigned int IntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8594 int value2 = op2->i;
8597 exp->string = PrintInt(op1->i || value2);
8600 exp->expType = op1->type;
8602 op1->type->refCount++;
8607 static unsigned int UIntOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8609 unsigned int value2 = op2->ui;
8612 exp->string = PrintUInt(op1->ui || value2);
8615 exp->expType = op1->type;
8617 op1->type->refCount++;
8622 static unsigned int ShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8624 short value2 = op2->s;
8627 exp->string = PrintShort(op1->s || value2);
8630 exp->expType = op1->type;
8632 op1->type->refCount++;
8637 static unsigned int UShortOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8639 unsigned short value2 = op2->us;
8642 exp->string = PrintUShort(op1->us || value2);
8645 exp->expType = op1->type;
8647 op1->type->refCount++;
8652 static unsigned int CharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8654 char value2 = op2->c;
8657 exp->string = PrintChar(op1->c || value2);
8660 exp->expType = op1->type;
8662 op1->type->refCount++;
8667 static unsigned int UCharOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8669 unsigned char value2 = op2->uc;
8672 exp->string = PrintUChar(op1->uc || value2);
8675 exp->expType = op1->type;
8677 op1->type->refCount++;
8682 static unsigned int FloatOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8684 float value2 = op2->f;
8687 exp->string = PrintFloat(op1->f || value2);
8690 exp->expType = op1->type;
8692 op1->type->refCount++;
8697 static unsigned int DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8699 double value2 = op2->d;
8702 exp->string = PrintDouble(op1->d || value2);
8705 exp->expType = op1->type;
8707 op1->type->refCount++;
8712 static unsigned int IntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8714 int value2 = op2->i;
8717 exp->string = PrintInt(op1->i > value2);
8720 exp->expType = op1->type;
8722 op1->type->refCount++;
8727 static unsigned int UIntGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8729 unsigned int value2 = op2->ui;
8732 exp->string = PrintUInt(op1->ui > value2);
8735 exp->expType = op1->type;
8737 op1->type->refCount++;
8742 static unsigned int ShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8744 short value2 = op2->s;
8747 exp->string = PrintShort(op1->s > value2);
8750 exp->expType = op1->type;
8752 op1->type->refCount++;
8757 static unsigned int UShortGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8759 unsigned short value2 = op2->us;
8762 exp->string = PrintUShort(op1->us > value2);
8765 exp->expType = op1->type;
8767 op1->type->refCount++;
8772 static unsigned int CharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8774 char value2 = op2->c;
8777 exp->string = PrintChar(op1->c > value2);
8780 exp->expType = op1->type;
8782 op1->type->refCount++;
8787 static unsigned int UCharGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8789 unsigned char value2 = op2->uc;
8792 exp->string = PrintUChar(op1->uc > value2);
8795 exp->expType = op1->type;
8797 op1->type->refCount++;
8802 static unsigned int FloatGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8804 float value2 = op2->f;
8807 exp->string = PrintFloat(op1->f > value2);
8810 exp->expType = op1->type;
8812 op1->type->refCount++;
8817 static unsigned int DoubleGrt(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8819 double value2 = op2->d;
8822 exp->string = PrintDouble(op1->d > value2);
8825 exp->expType = op1->type;
8827 op1->type->refCount++;
8832 static unsigned int IntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8834 int value2 = op2->i;
8837 exp->string = PrintInt(op1->i < value2);
8840 exp->expType = op1->type;
8842 op1->type->refCount++;
8847 static unsigned int UIntSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8849 unsigned int value2 = op2->ui;
8852 exp->string = PrintUInt(op1->ui < value2);
8855 exp->expType = op1->type;
8857 op1->type->refCount++;
8862 static unsigned int ShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8864 short value2 = op2->s;
8867 exp->string = PrintShort(op1->s < value2);
8870 exp->expType = op1->type;
8872 op1->type->refCount++;
8877 static unsigned int UShortSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8879 unsigned short value2 = op2->us;
8882 exp->string = PrintUShort(op1->us < value2);
8885 exp->expType = op1->type;
8887 op1->type->refCount++;
8892 static unsigned int CharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8894 char value2 = op2->c;
8897 exp->string = PrintChar(op1->c < value2);
8900 exp->expType = op1->type;
8902 op1->type->refCount++;
8907 static unsigned int UCharSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8909 unsigned char value2 = op2->uc;
8912 exp->string = PrintUChar(op1->uc < value2);
8915 exp->expType = op1->type;
8917 op1->type->refCount++;
8922 static unsigned int FloatSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8924 float value2 = op2->f;
8927 exp->string = PrintFloat(op1->f < value2);
8930 exp->expType = op1->type;
8932 op1->type->refCount++;
8937 static unsigned int DoubleSma(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8939 double value2 = op2->d;
8942 exp->string = PrintDouble(op1->d < value2);
8945 exp->expType = op1->type;
8947 op1->type->refCount++;
8952 static unsigned int IntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8954 int value2 = op2->i;
8957 exp->string = PrintInt(op1->i >= value2);
8960 exp->expType = op1->type;
8962 op1->type->refCount++;
8967 static unsigned int UIntGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8969 unsigned int value2 = op2->ui;
8972 exp->string = PrintUInt(op1->ui >= value2);
8975 exp->expType = op1->type;
8977 op1->type->refCount++;
8982 static unsigned int ShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8984 short value2 = op2->s;
8987 exp->string = PrintShort(op1->s >= value2);
8990 exp->expType = op1->type;
8992 op1->type->refCount++;
8997 static unsigned int UShortGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
8999 unsigned short value2 = op2->us;
9002 exp->string = PrintUShort(op1->us >= value2);
9005 exp->expType = op1->type;
9007 op1->type->refCount++;
9012 static unsigned int CharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9014 char value2 = op2->c;
9017 exp->string = PrintChar(op1->c >= value2);
9020 exp->expType = op1->type;
9022 op1->type->refCount++;
9027 static unsigned int UCharGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9029 unsigned char value2 = op2->uc;
9032 exp->string = PrintUChar(op1->uc >= value2);
9035 exp->expType = op1->type;
9037 op1->type->refCount++;
9042 static unsigned int FloatGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9044 float value2 = op2->f;
9047 exp->string = PrintFloat(op1->f >= value2);
9050 exp->expType = op1->type;
9052 op1->type->refCount++;
9057 static unsigned int DoubleGrtEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9059 double value2 = op2->d;
9062 exp->string = PrintDouble(op1->d >= value2);
9065 exp->expType = op1->type;
9067 op1->type->refCount++;
9072 static unsigned int IntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9074 int value2 = op2->i;
9077 exp->string = PrintInt(op1->i <= value2);
9080 exp->expType = op1->type;
9082 op1->type->refCount++;
9087 static unsigned int UIntSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9089 unsigned int value2 = op2->ui;
9092 exp->string = PrintUInt(op1->ui <= value2);
9095 exp->expType = op1->type;
9097 op1->type->refCount++;
9102 static unsigned int ShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9104 short value2 = op2->s;
9107 exp->string = PrintShort(op1->s <= value2);
9110 exp->expType = op1->type;
9112 op1->type->refCount++;
9117 static unsigned int UShortSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9119 unsigned short value2 = op2->us;
9122 exp->string = PrintUShort(op1->us <= value2);
9125 exp->expType = op1->type;
9127 op1->type->refCount++;
9132 static unsigned int CharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9134 char value2 = op2->c;
9137 exp->string = PrintChar(op1->c <= value2);
9140 exp->expType = op1->type;
9142 op1->type->refCount++;
9147 static unsigned int UCharSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9149 unsigned char value2 = op2->uc;
9152 exp->string = PrintUChar(op1->uc <= value2);
9155 exp->expType = op1->type;
9157 op1->type->refCount++;
9162 static unsigned int FloatSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9164 float value2 = op2->f;
9167 exp->string = PrintFloat(op1->f <= value2);
9170 exp->expType = op1->type;
9172 op1->type->refCount++;
9177 static unsigned int DoubleSmaEqu(struct Expression * exp, struct Operand * op1, struct Operand * op2)
9179 double value2 = op2->d;
9182 exp->string = PrintDouble(op1->d <= value2);
9185 exp->expType = op1->type;
9187 op1->type->refCount++;
9192 static unsigned int IntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9195 exp->string = PrintInt(op1->i ? op2->i : op3->i);
9198 exp->expType = op1->type;
9200 op1->type->refCount++;
9205 static unsigned int UIntCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9208 exp->string = PrintUInt(op1->ui ? op2->ui : op3->ui);
9211 exp->expType = op1->type;
9213 op1->type->refCount++;
9218 static unsigned int ShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9221 exp->string = PrintShort(op1->s ? op2->s : op3->s);
9224 exp->expType = op1->type;
9226 op1->type->refCount++;
9231 static unsigned int UShortCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9234 exp->string = PrintUShort(op1->us ? op2->us : op3->us);
9237 exp->expType = op1->type;
9239 op1->type->refCount++;
9244 static unsigned int CharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9247 exp->string = PrintChar(op1->c ? op2->c : op3->c);
9250 exp->expType = op1->type;
9252 op1->type->refCount++;
9257 static unsigned int UCharCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9260 exp->string = PrintUChar(op1->uc ? op2->uc : op3->uc);
9263 exp->expType = op1->type;
9265 op1->type->refCount++;
9270 static unsigned int FloatCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9273 exp->string = PrintFloat(op1->f ? op2->f : op3->f);
9276 exp->expType = op1->type;
9278 op1->type->refCount++;
9283 static unsigned int DoubleCond(struct Expression * exp, struct Operand * op1, struct Operand * op2, struct Operand * op3)
9286 exp->string = PrintDouble(op1->d ? op2->d : op3->d);
9289 exp->expType = op1->type;
9291 op1->type->refCount++;
9296 struct OpTable intOps =
9298 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
9301 struct OpTable uintOps =
9303 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
9306 struct OpTable shortOps =
9308 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
9311 struct OpTable ushortOps =
9313 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
9316 struct OpTable floatOps =
9318 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
9321 struct OpTable doubleOps =
9323 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
9326 struct OpTable charOps =
9328 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
9331 struct OpTable ucharOps =
9333 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
9336 void ReadString(char * output, char * string)
9338 int len = strlen(string);
9340 unsigned int quoted = 0x0, escaped = 0x0;
9342 for(c = 0; c < len; c++)
9344 char ch = string[c];
9400 extern long long __ecereNameSpace__ecere__com___strtoi64(char * string, char * * endString, int base);
9402 extern uint64 __ecereNameSpace__ecere__com___strtoui64(char * string, char * * endString, int base);
9404 extern double strtod(char * , char * * );
9406 struct Operand GetOperand(struct Expression * exp)
9412 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9415 struct Type * type = exp->expType;
9419 while(type->kind == 8 && type->_class->registered && (type->_class->registered->type == 2 || type->_class->registered->type == 3 || type->_class->registered->type == 4))
9421 if(!type->_class->registered->dataType)
9422 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
9423 type = type->_class->registered->dataType;
9425 op.kind = type->kind;
9426 op.type = exp->expType;
9427 if(exp->isConstant && exp->type == 2)
9433 if(exp->constant[0] == '\'')
9434 op.c = exp->constant[1];
9435 else if(type->isSigned)
9437 op.c = (char)strtol(exp->constant, (((void *)0)), 0);
9442 op.uc = (unsigned char)strtoul(exp->constant, (((void *)0)), 0);
9450 op.s = (short)strtol(exp->constant, (((void *)0)), 0);
9455 op.us = (unsigned short)strtoul(exp->constant, (((void *)0)), 0);
9463 op.i = strtol(exp->constant, (((void *)0)), 0);
9468 op.ui = strtoul(exp->constant, (((void *)0)), 0);
9476 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9481 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9489 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9494 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9502 op.i64 = __ecereNameSpace__ecere__com___strtoi64(exp->constant, (((void *)0)), 0);
9507 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9513 op.f = (float)strtod(exp->constant, (((void *)0)));
9517 op.d = (double)strtod(exp->constant, (((void *)0)));
9523 op.ui64 = __ecereNameSpace__ecere__com___strtoui64(exp->constant, (((void *)0)), 0);
9533 int __ecereVMethodID_class_OnGetString;
9535 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_int;
9537 static void UnusedFunction()
9541 ((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);
9544 extern int __ecereVMethodID_class_OnGetString;
9546 static void PopulateInstanceProcessMember(struct Instantiation * inst, struct __ecereNameSpace__ecere__sys__OldList * memberList, struct __ecereNameSpace__ecere__com__DataMember * parentDataMember, unsigned int offset)
9548 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9550 for(dataMember = parentDataMember->members.first; dataMember; dataMember = dataMember->next)
9552 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9553 PopulateInstanceProcessMember(inst, memberList, dataMember, offset + dataMember->offset);
9556 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9557 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9559 void * ptr = inst->data + dataMember->offset + offset;
9560 char * result = (((void *)0));
9562 exp->loc = member->loc = inst->loc;
9563 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9564 if(!dataMember->dataType)
9565 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9566 type = dataMember->dataType;
9569 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9571 if(_class->type == 4)
9573 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9577 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9578 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9580 for(item = e->values.first; item; item = item->next)
9582 if((int)item->data == *(int *)ptr)
9584 result = item->name;
9590 exp->identifier = MkIdentifier(result);
9592 exp->destType = MkClassType(_class->fullName);
9593 ProcessExpressionType(exp);
9597 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9599 if(!_class->dataType)
9600 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9601 type = _class->dataType;
9610 FreeExpContents(exp);
9611 exp->constant = PrintFloat(*(float *)ptr);
9617 FreeExpContents(exp);
9618 exp->constant = PrintDouble(*(double *)ptr);
9624 FreeExpContents(exp);
9625 exp->constant = PrintInt(*(int *)ptr);
9631 FreeExpContents(exp);
9632 exp->constant = PrintInt64(*(long long *)ptr);
9638 FreeExpContents(exp);
9639 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9645 FreeExpContents(exp);
9646 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9651 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9654 ListAdd(memberList, member);
9656 if(parentDataMember->type == 1)
9661 extern struct MembersInit * MkMembersInitList(struct __ecereNameSpace__ecere__sys__OldList * dataMembers);
9663 void PopulateInstance(struct Instantiation * inst)
9665 struct Symbol * classSym = inst->_class->symbol;
9666 struct __ecereNameSpace__ecere__com__Class * _class = classSym->registered;
9667 struct __ecereNameSpace__ecere__com__DataMember * dataMember;
9668 struct __ecereNameSpace__ecere__sys__OldList * memberList = MkList();
9670 inst->members = MkListOne(MkMembersInitList(memberList));
9671 for(dataMember = _class->membersAndProperties.first; dataMember; dataMember = dataMember->next)
9673 if(!dataMember->isProperty)
9675 if(!dataMember->name && (dataMember->type == 2 || dataMember->type == 1))
9676 PopulateInstanceProcessMember(inst, memberList, dataMember, dataMember->offset);
9679 struct Expression * exp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
9680 struct MemberInit * member = MkMemberInit(MkListOne(MkIdentifier(dataMember->name)), MkInitializerAssignment(exp));
9682 void * ptr = inst->data + dataMember->offset;
9683 char * result = (((void *)0));
9685 exp->loc = member->loc = inst->loc;
9686 ((struct Identifier *)(*member->identifiers).first)->loc = inst->loc;
9687 if(!dataMember->dataType)
9688 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9689 type = dataMember->dataType;
9692 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9694 if(_class->type == 4)
9696 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
9700 struct __ecereNameSpace__ecere__com__EnumClassData * e = (_class ? ((void *)(((char *)_class->data) + enumClass->offsetClass)) : (((void *)0)));
9701 struct __ecereNameSpace__ecere__sys__NamedLink * item;
9703 for(item = e->values.first; item; item = item->next)
9705 if((int)item->data == *(int *)ptr)
9707 result = item->name;
9714 exp->identifier = MkIdentifier(result);
9716 exp->destType = MkClassType(_class->fullName);
9717 ProcessExpressionType(exp);
9720 if(_class->type == 4 || _class->type == 3 || _class->type == 2)
9722 if(!_class->dataType)
9723 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9724 type = _class->dataType;
9733 exp->constant = PrintFloat(*(float *)ptr);
9739 exp->constant = PrintDouble(*(double *)ptr);
9745 exp->constant = PrintInt(*(int *)ptr);
9751 exp->constant = PrintInt64(*(long long *)ptr);
9757 exp->constant = PrintInt64((long long)*(intptr_t *)ptr);
9762 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unhandled type populating instance\n", (((void *)0))));
9765 ListAdd(memberList, member);
9771 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);
9773 extern void FreeInstance(struct Instantiation * inst);
9775 void ComputeInstantiation(struct Expression * exp)
9777 struct Instantiation * inst = exp->instance;
9778 struct MembersInit * members;
9779 struct Symbol * classSym = inst->_class ? inst->_class->symbol : (((void *)0));
9780 struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));
9781 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
9782 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
9783 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
9784 int subMemberStackPos = 0;
9787 if(_class && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9791 if(_class->type == 0 || _class->type == 5)
9792 inst->data = (unsigned char *)__ecereNameSpace__ecere__com__eInstance_New(_class);
9794 inst->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
9798 for(members = (*inst->members).first; members; members = members->next)
9800 switch(members->type)
9804 if(members->dataMembers)
9806 struct MemberInit * member;
9808 for(member = (*members->dataMembers).first; member; member = member->next)
9810 struct Identifier * ident = member->identifiers ? (*member->identifiers).first : (((void *)0));
9811 unsigned int found = 0x0;
9812 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
9813 struct __ecereNameSpace__ecere__com__DataMember * dataMember = (((void *)0));
9814 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
9815 unsigned int dataMemberOffset;
9819 __ecereNameSpace__ecere__com__eClass_FindNextMember(_class, &curClass, &curMember, subMemberStack, &subMemberStackPos);
9822 if(curMember->isProperty)
9823 prop = (struct __ecereNameSpace__ecere__com__Property *)curMember;
9826 dataMember = curMember;
9827 __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, dataMember->name, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9834 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, ident->string, privateModule);
9838 if(prop->memberAccess == 1)
9840 curMember = (struct __ecereNameSpace__ecere__com__DataMember *)prop;
9841 curClass = prop->_class;
9846 struct __ecereNameSpace__ecere__com__DataMember * _subMemberStack[256];
9847 int _subMemberStackPos = 0;
9849 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(_class, ident->string, &dataMemberOffset, privateModule, _subMemberStack, &_subMemberStackPos);
9853 if(dataMember->memberAccess == 1)
9855 curMember = dataMember;
9856 curClass = dataMember->_class;
9857 memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
9858 subMemberStackPos = _subMemberStackPos;
9863 if(found && member->initializer && member->initializer->type == 0)
9865 struct Expression * value = member->initializer->exp;
9866 struct Type * type = (((void *)0));
9870 type = prop->dataType;
9874 if(!dataMember->dataType)
9875 dataMember->dataType = ProcessTypeString(dataMember->dataTypeString, 0x0);
9876 type = dataMember->dataType;
9878 if(ident && ident->next)
9880 for(ident = ident->next; ident && type; ident = ident->next)
9884 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(type->_class->registered, ident->string, privateModule);
9886 type = prop->dataType;
9889 dataMember = __ecereNameSpace__ecere__com__eClass_FindDataMemberAndOffset(type->_class->registered, ident->string, &dataMemberOffset, privateModule, (((void *)0)), (((void *)0)));
9891 type = dataMember->dataType;
9894 else if(type->kind == 9 || type->kind == 10)
9896 struct Type * memberType;
9898 for(memberType = type->members.first; memberType; memberType = memberType->next)
9900 if(!strcmp(memberType->name, ident->string))
9911 FreeType(value->destType);
9912 value->destType = type;
9915 ComputeExpression(value);
9917 if(value && (_class->type == 1 || _class->type == 0 || _class->type == 5))
9921 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9923 if(_class->type == 2 || _class->type == 3 || _class->type == 4)
9925 if(!_class->dataType)
9926 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
9927 type = _class->dataType;
9932 void * ptr = inst->data + dataMemberOffset;
9934 if(value->type == 2)
9940 GetInt(value, (int *)ptr);
9945 GetInt64(value, (long long *)ptr);
9950 GetIntPtr(value, (intptr_t *)ptr);
9955 GetIntSize(value, (ssize_t *)ptr);
9960 GetFloat(value, (float *)ptr);
9965 GetDouble(value, (double *)ptr);
9970 else if(value->type == 1)
9974 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
9976 if(_class->type == 1)
9978 ComputeTypeSize(type);
9979 if(value->instance->data)
9980 memcpy(ptr, value->instance->data, type->size);
9987 if(value->type == 1 && value->instance->data)
9989 void (* Set)(void *, void *) = (void *)prop->Set;
9991 Set(inst->data, value->instance->data);
9992 PopulateInstance(inst);
9994 else if(value->type == 2)
10000 void (* Set)(void *, double) = (void *)prop->Set;
10002 Set(inst->data, strtod(value->constant, (((void *)0))));
10007 void (* Set)(void *, float) = (void *)prop->Set;
10009 Set(inst->data, (float)(strtod(value->constant, (((void *)0)))));
10014 void (* Set)(void *, int) = (void *)prop->Set;
10016 Set(inst->data, strtol(value->constant, (((void *)0)), 0));
10021 void (* Set)(void *, long long) = (void *)prop->Set;
10023 Set(inst->data, __ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10028 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10030 Set(inst->data, (intptr_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10035 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10037 Set(inst->data, (ssize_t)__ecereNameSpace__ecere__com___strtoi64(value->constant, (((void *)0)), 0));
10042 else if(value->type == 3)
10046 ReadString(temp, value->string);
10047 ((void (*)(void *, void *))(void *)prop->Set)(inst->data, temp);
10051 else if(_class->type == 3)
10055 if(value->type == 2)
10057 if(type->kind == 8)
10059 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10061 if(_class->type == 3)
10063 if(!_class->dataType)
10064 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10065 type = _class->dataType;
10073 float (* Set)(float) = (void *)prop->Set;
10075 GetFloat(member->initializer->exp, &fValue);
10076 exp->constant = PrintFloat(Set(fValue));
10083 double (* Set)(double) = (void *)prop->Set;
10085 GetDouble(member->initializer->exp, &dValue);
10086 exp->constant = PrintDouble(Set(dValue));
10094 else if(_class->type == 2)
10098 if(value->type == 1 && value->instance->data)
10100 unsigned int (* Set)(void *) = (void *)prop->Set;
10102 bits = Set(value->instance->data);
10104 else if(value->type == 2)
10108 else if(dataMember)
10110 struct __ecereNameSpace__ecere__com__BitMember * bitMember = (struct __ecereNameSpace__ecere__com__BitMember *)dataMember;
10111 struct Type * type;
10114 GetInt(value, &part);
10115 bits = (bits & ~bitMember->mask);
10116 if(!bitMember->dataType)
10117 bitMember->dataType = ProcessTypeString(bitMember->dataTypeString, 0x0);
10118 type = bitMember->dataType;
10119 if(type->kind == 8 && type->_class && type->_class->registered)
10121 if(!type->_class->registered->dataType)
10122 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
10123 type = type->_class->registered->dataType;
10129 bits |= ((char)part << bitMember->pos);
10131 bits |= ((unsigned char)part << bitMember->pos);
10135 bits |= ((short)part << bitMember->pos);
10137 bits |= ((unsigned short)part << bitMember->pos);
10142 bits |= (part << bitMember->pos);
10144 bits |= ((unsigned int)part << bitMember->pos);
10148 bits |= ((long long)part << bitMember->pos);
10150 bits |= ((uint64)part << bitMember->pos);
10155 bits |= ((intptr_t)part << bitMember->pos);
10159 bits |= ((uintptr_t)part << bitMember->pos);
10165 bits |= ((ssize_t)part << bitMember->pos);
10169 bits |= ((size_t)part << bitMember->pos);
10178 if(_class && _class->type == 3)
10180 ComputeExpression(member->initializer->exp);
10181 exp->constant = member->initializer->exp->constant;
10183 member->initializer->exp->constant = (((void *)0));
10193 if(_class && _class->type == 2)
10195 exp->constant = PrintHexUInt(bits);
10200 FreeInstance(inst);
10204 void CallOperator(struct Expression * exp, struct Expression * exp1, struct Expression * exp2, struct Operand * op1, struct Operand * op2)
10206 if(exp->op.op == SIZEOF)
10208 FreeExpContents(exp);
10210 exp->constant = PrintUInt(ComputeTypeSize(op1->type));
10220 struct Expression * exp2 = exp->op.exp2;
10222 exp->op.exp2 = (((void *)0));
10223 FreeExpContents(exp);
10224 FreeType(exp->expType);
10225 FreeType(exp->destType);
10227 ((exp2 ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(exp2) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(exp2)) : 0), exp2 = 0);
10233 FreeExpContents(exp);
10234 op1->ops.Neg(exp, op1);
10238 if(op1->ops.BitNot)
10240 FreeExpContents(exp);
10241 op1->ops.BitNot(exp, op1);
10247 FreeExpContents(exp);
10248 op1->ops.Not(exp, op1);
10260 FreeExpContents(exp);
10261 op1->ops.Add(exp, op1, op2);
10267 FreeExpContents(exp);
10268 op1->ops.Sub(exp, op1, op2);
10274 FreeExpContents(exp);
10275 op1->ops.Mul(exp, op1, op2);
10281 FreeExpContents(exp);
10282 op1->ops.Div(exp, op1, op2);
10288 FreeExpContents(exp);
10289 op1->ops.Mod(exp, op1, op2);
10295 if(op1->ops.BitAnd)
10297 FreeExpContents(exp);
10298 op1->ops.BitAnd(exp, op1, op2);
10305 FreeExpContents(exp);
10306 op1->ops.BitOr(exp, op1, op2);
10310 if(op1->ops.BitXor)
10312 FreeExpContents(exp);
10313 op1->ops.BitXor(exp, op1, op2);
10317 if(op1->ops.LShift)
10319 FreeExpContents(exp);
10320 op1->ops.LShift(exp, op1, op2);
10324 if(op1->ops.RShift)
10326 FreeExpContents(exp);
10327 op1->ops.RShift(exp, op1, op2);
10333 FreeExpContents(exp);
10334 op1->ops.Equ(exp, op1, op2);
10340 FreeExpContents(exp);
10341 op1->ops.Nqu(exp, op1, op2);
10347 FreeExpContents(exp);
10348 op1->ops.And(exp, op1, op2);
10354 FreeExpContents(exp);
10355 op1->ops.Or(exp, op1, op2);
10361 FreeExpContents(exp);
10362 op1->ops.Grt(exp, op1, op2);
10368 FreeExpContents(exp);
10369 op1->ops.Sma(exp, op1, op2);
10373 if(op1->ops.GrtEqu)
10375 FreeExpContents(exp);
10376 op1->ops.GrtEqu(exp, op1, op2);
10380 if(op1->ops.SmaEqu)
10382 FreeExpContents(exp);
10383 op1->ops.SmaEqu(exp, op1, op2);
10391 extern struct Expression * MkExpIdentifier(struct Identifier * id);
10393 void ComputeExpression(struct Expression * exp)
10395 char expString[10240];
10397 expString[0] = '\0';
10402 ComputeInstantiation(exp);
10407 struct Expression * exp1, * exp2 = (((void *)0));
10408 struct Operand op1 =
10412 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10415 struct Operand op2 =
10419 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
10424 ComputeExpression(exp->op.exp2);
10427 ComputeExpression(exp->op.exp1);
10428 exp1 = exp->op.exp1;
10429 exp2 = exp->op.exp2;
10430 op1 = GetOperand(exp1);
10432 op1.type->refCount++;
10435 op2 = GetOperand(exp2);
10437 op2.type->refCount++;
10442 exp1 = exp->op.exp2;
10443 op1 = GetOperand(exp1);
10445 op1.type->refCount++;
10447 CallOperator(exp, exp1, exp2, &op1, &op2);
10449 FreeType(op1.type);
10451 FreeType(op2.type);
10457 struct Expression * e, * n;
10459 for(e = (*exp->list).first; e; e = n)
10464 struct __ecereNameSpace__ecere__sys__OldList * list = exp->list;
10466 ComputeExpression(e);
10467 FreeType(exp->expType);
10468 FreeType(exp->destType);
10470 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
10471 (__ecereNameSpace__ecere__com__eSystem_Delete(list), list = 0);
10482 struct Expression * memberExp = exp->member.exp;
10483 struct Identifier * memberID = exp->member.member;
10484 struct Type * type;
10486 ComputeExpression(exp->member.exp);
10487 type = exp->member.exp->expType;
10490 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)));
10491 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
10492 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
10493 struct __ecereNameSpace__ecere__com__Class * convertTo = (((void *)0));
10495 if(type->kind == 19 && exp->member.exp->type == 26)
10496 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
10500 struct Symbol * classSym;
10503 PrintType(type, string, 0x0, 0x1);
10504 classSym = FindClass(string);
10505 _class = classSym ? classSym->registered : (((void *)0));
10507 if(exp->member.member)
10509 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, exp->member.member->string, privateModule);
10511 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, exp->member.member->string, privateModule, (((void *)0)), (((void *)0)));
10513 if(!prop && !member && _class && exp->member.member)
10515 struct Symbol * classSym = FindClass(exp->member.member->string);
10517 convertTo = _class;
10518 _class = classSym ? classSym->registered : (((void *)0));
10519 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, convertTo->fullName, privateModule);
10525 struct Type * type = prop->dataType;
10527 if(_class->type == 3)
10529 if(type->kind == 8)
10531 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10533 if(_class->type == 3)
10535 if(!_class->dataType)
10536 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10537 type = _class->dataType;
10545 float (* Get)(float) = (void *)prop->Get;
10547 GetFloat(exp->member.exp, &value);
10548 exp->constant = PrintFloat(Get ? Get(value) : value);
10555 double (* Get)(double);
10557 GetDouble(exp->member.exp, &value);
10559 Get = (void *)prop->Set;
10561 Get = (void *)prop->Get;
10562 exp->constant = PrintDouble(Get ? Get(value) : value);
10572 struct Expression * value = exp->member.exp;
10573 struct Type * type;
10575 if(!prop->dataType)
10576 ProcessPropertyType(prop);
10577 type = prop->dataType;
10581 else if(_class->type == 1)
10587 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10589 if(propertyClass->type == 1 && value->type == 1)
10591 void (* Set)(void *, void *) = (void *)prop->Set;
10593 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10594 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10595 exp->instance->_class = MkSpecifierName(_class->fullName);
10596 exp->instance->loc = exp->loc;
10598 Set(exp->instance->data, value->instance->data);
10599 PopulateInstance(exp->instance);
10606 void (* Set)(void *, int) = (void *)prop->Set;
10608 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10609 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10610 exp->instance->_class = MkSpecifierName(_class->fullName);
10611 exp->instance->loc = exp->loc;
10613 GetInt(value, &intValue);
10614 Set(exp->instance->data, intValue);
10615 PopulateInstance(exp->instance);
10620 long long intValue;
10621 void (* Set)(void *, long long) = (void *)prop->Set;
10623 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10624 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10625 exp->instance->_class = MkSpecifierName(_class->fullName);
10626 exp->instance->loc = exp->loc;
10628 GetInt64(value, &intValue);
10629 Set(exp->instance->data, intValue);
10630 PopulateInstance(exp->instance);
10636 void (* Set)(void *, intptr_t) = (void *)prop->Set;
10638 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10639 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10640 exp->instance->_class = MkSpecifierName(_class->fullName);
10641 exp->instance->loc = exp->loc;
10643 GetIntPtr(value, &intValue);
10644 Set(exp->instance->data, intValue);
10645 PopulateInstance(exp->instance);
10651 void (* Set)(void *, ssize_t) = (void *)prop->Set;
10653 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10654 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10655 exp->instance->_class = MkSpecifierName(_class->fullName);
10656 exp->instance->loc = exp->loc;
10658 GetIntSize(value, &intValue);
10659 Set(exp->instance->data, intValue);
10660 PopulateInstance(exp->instance);
10665 double doubleValue;
10666 void (* Set)(void *, double) = (void *)prop->Set;
10668 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10669 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10670 exp->instance->_class = MkSpecifierName(_class->fullName);
10671 exp->instance->loc = exp->loc;
10673 GetDouble(value, &doubleValue);
10674 Set(exp->instance->data, doubleValue);
10675 PopulateInstance(exp->instance);
10680 else if(_class->type == 2)
10686 struct __ecereNameSpace__ecere__com__Class * propertyClass = type->_class->registered;
10688 if(propertyClass->type == 1 && value->instance->data)
10690 unsigned int (* Set)(void *) = (void *)prop->Set;
10691 unsigned int bits = Set(value->instance->data);
10693 exp->constant = PrintHexUInt(bits);
10697 else if(_class->type == 2)
10699 unsigned int value;
10700 unsigned int (* Set)(unsigned int) = (void *)prop->Set;
10703 GetUInt(exp->member.exp, &value);
10705 exp->constant = PrintHexUInt(bits);
10714 if(_class->type == 2)
10716 unsigned int value;
10718 GetUInt(exp->member.exp, &value);
10723 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10725 if(_class->type == 1)
10727 void (* Get)(unsigned int, void *) = (void *)prop->Get;
10729 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10730 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10731 exp->instance->_class = MkSpecifierName(_class->fullName);
10732 exp->instance->loc = exp->loc;
10734 Get(value, exp->instance->data);
10735 PopulateInstance(exp->instance);
10737 else if(_class->type == 2)
10739 unsigned int (* Get)(unsigned int) = (void *)prop->Get;
10740 uint64 bits = Get(value);
10742 exp->constant = PrintHexUInt64(bits);
10749 else if(_class->type == 1)
10751 char * value = (exp->member.exp->type == 1) ? exp->member.exp->instance->data : (((void *)0));
10757 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10759 if(_class->type == 1 && value)
10761 void (* Get)(void *, void *) = (void *)prop->Get;
10763 exp->instance = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Instantiation);
10764 exp->instance->data = __ecereNameSpace__ecere__com__eSystem_New0(sizeof(unsigned char) * (_class->structSize));
10765 exp->instance->_class = MkSpecifierName(_class->fullName);
10766 exp->instance->loc = exp->loc;
10768 Get(value, exp->instance->data);
10769 PopulateInstance(exp->instance);
10780 exp->isConstant = 0x0;
10789 FreeExpression(memberExp);
10790 FreeIdentifier(memberID);
10796 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
10798 FreeExpContents(exp);
10799 exp->constant = PrintUInt(ComputeTypeSize(type));
10806 struct Symbol * classSym = exp->_class->symbol;
10808 if(classSym && classSym->registered)
10810 if(classSym->registered->fixed)
10812 FreeSpecifier(exp->_class);
10813 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
10818 char className[1024];
10820 strcpy(className, "__ecereClass_");
10821 FullClassNameCat(className, classSym->string, 0x1);
10822 MangleClassName(className);
10823 FreeExpContents(exp);
10825 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
10826 exp->member.member = MkIdentifier("structSize");
10833 struct Type * type;
10834 struct Expression * e = exp;
10836 if(exp->type == 11)
10839 ComputeExpression(exp->cast.exp);
10842 if(e && exp->expType)
10844 type = exp->expType;
10845 if(type->kind == 8)
10847 struct __ecereNameSpace__ecere__com__Class * _class = type->_class->registered;
10849 if(_class && (_class->type == 3 || _class->type == 2))
10851 if(!_class->dataType)
10852 _class->dataType = ProcessTypeString(_class->dataTypeString, 0x0);
10853 type = _class->dataType;
10863 GetChar(e, &value);
10864 FreeExpContents(exp);
10865 exp->constant = PrintChar(value);
10870 unsigned char value;
10872 GetUChar(e, &value);
10873 FreeExpContents(exp);
10874 exp->constant = PrintUChar(value);
10883 GetShort(e, &value);
10884 FreeExpContents(exp);
10885 exp->constant = PrintShort(value);
10890 unsigned short value;
10892 GetUShort(e, &value);
10893 FreeExpContents(exp);
10894 exp->constant = PrintUShort(value);
10904 FreeExpContents(exp);
10905 exp->constant = PrintInt(value);
10910 unsigned int value;
10912 GetUInt(e, &value);
10913 FreeExpContents(exp);
10914 exp->constant = PrintUInt(value);
10923 GetInt64(e, &value);
10924 FreeExpContents(exp);
10925 exp->constant = PrintInt64(value);
10932 GetUInt64(e, &value);
10933 FreeExpContents(exp);
10934 exp->constant = PrintUInt64(value);
10943 GetIntPtr(e, &value);
10944 FreeExpContents(exp);
10945 exp->constant = PrintInt64((long long)value);
10952 GetUIntPtr(e, &value);
10953 FreeExpContents(exp);
10954 exp->constant = PrintUInt64((uint64)value);
10963 GetIntSize(e, &value);
10964 FreeExpContents(exp);
10965 exp->constant = PrintInt64((long long)value);
10972 GetUIntSize(e, &value);
10973 FreeExpContents(exp);
10974 exp->constant = PrintUInt64((uint64)value);
10982 GetFloat(e, &value);
10983 FreeExpContents(exp);
10984 exp->constant = PrintFloat(value);
10992 GetDouble(e, &value);
10993 FreeExpContents(exp);
10994 exp->constant = PrintDouble(value);
11004 struct Operand op1 =
11008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11011 struct Operand op2 =
11015 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11018 struct Operand op3 =
11022 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
11027 ComputeExpression((*exp->cond.exp).last);
11028 if(exp->cond.elseExp)
11029 ComputeExpression(exp->cond.elseExp);
11031 ComputeExpression(exp->cond.cond);
11032 op1 = GetOperand(exp->cond.cond);
11034 op1.type->refCount++;
11035 op2 = GetOperand((*exp->cond.exp).last);
11037 op2.type->refCount++;
11038 op3 = GetOperand(exp->cond.elseExp);
11040 op3.type->refCount++;
11043 FreeExpContents(exp);
11044 op1.ops.Cond(exp, &op1, &op2, &op3);
11047 FreeType(op1.type);
11049 FreeType(op2.type);
11051 FreeType(op3.type);
11057 void ApplyAnyObjectLogic(struct Expression * e);
11059 extern void CopyTypeInto(struct Type * type, struct Type * src);
11061 static unsigned int CheckExpressionType(struct Expression * exp, struct Type * destType, unsigned int skipUnitBla)
11063 unsigned int result = 0x1;
11067 struct __ecereNameSpace__ecere__sys__OldList converts =
11071 struct Conversion * convert;
11073 if(destType->kind == 0)
11075 if(!MatchTypeExpression(exp, destType, &converts, skipUnitBla))
11079 for(convert = converts.first; convert; convert = convert->next)
11081 unsigned int empty = !(convert->isGet ? (void *)convert->convert->Get : (void *)convert->convert->Set);
11085 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11086 int objectType = exp->expType ? exp->expType->classObjectType : 0;
11089 newExp->destType = (((void *)0));
11093 exp->addedThis = 0x1;
11094 exp->member.exp = newExp;
11095 FreeType(exp->member.exp->expType);
11096 exp->member.exp->expType = MkClassType(convert->convert->_class->fullName);
11097 exp->member.exp->expType->classObjectType = objectType;
11098 exp->member.member = MkIdentifier(convert->convert->dataTypeString);
11099 exp->member.memberType = 1;
11100 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11101 exp->needCast = 0x1;
11103 exp->expType->refCount++;
11104 ApplyAnyObjectLogic(exp->member.exp);
11110 exp->addedThis = 0x1;
11111 exp->member.exp = newExp;
11112 if(newExp->expType && newExp->expType->kind == 8 && newExp->expType->_class && newExp->expType->_class->registered && newExp->expType->_class->registered->type == 5)
11114 newExp->byReference = 0x1;
11116 FreeType(exp->member.exp->expType);
11117 exp->member.exp->expType = (((void *)0));
11118 if(convert->convert->dataType)
11120 exp->member.exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11121 CopyTypeInto(exp->member.exp->expType, convert->convert->dataType);
11122 exp->member.exp->expType->refCount = 1;
11123 exp->member.exp->expType->classObjectType = objectType;
11124 ApplyAnyObjectLogic(exp->member.exp);
11126 exp->member.member = MkIdentifier(convert->convert->_class->fullName);
11127 exp->member.memberType = 4;
11128 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11129 exp->needCast = 0x1;
11130 if(convert->resultType)
11131 convert->resultType->refCount++;
11137 FreeType(exp->expType);
11140 exp->expType = convert->resultType ? convert->resultType : convert->convert->dataType;
11141 exp->needCast = 0x1;
11143 exp->expType->refCount++;
11147 exp->expType = convert->resultType ? convert->resultType : MkClassType(convert->convert->_class->fullName);
11148 exp->needCast = 0x1;
11149 if(convert->resultType)
11150 convert->resultType->refCount++;
11154 if(exp->isConstant && inCompiler)
11155 ComputeExpression(exp);
11156 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(&converts, FreeConvert);
11158 if(!result && exp->expType && converts.count)
11160 result = MatchTypes(exp->expType, exp->destType, (((void *)0)), (((void *)0)), (((void *)0)), 0x1, 0x1, 0x0, 0x0);
11162 if(!result && exp->expType && exp->destType)
11164 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))
11171 extern struct Statement * MkCompoundStmt(struct __ecereNameSpace__ecere__sys__OldList * declarations, struct __ecereNameSpace__ecere__sys__OldList * statements);
11173 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
11175 extern struct Expression * MkExpMember(struct Expression * expression, struct Identifier * member);
11177 void CheckTemplateTypes(struct Expression * exp)
11179 if(exp->destType && exp->destType->passAsTemplate && exp->expType && exp->expType->kind != 20 && !exp->expType->passAsTemplate)
11181 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11182 struct Statement * compound;
11183 struct Context * context;
11187 exp->destType->refCount++;
11189 exp->expType->refCount++;
11190 newExp->prev = (((void *)0));
11191 newExp->next = (((void *)0));
11192 switch(exp->expType->kind)
11195 if(exp->destType->classObjectType)
11198 exp->destType->refCount--;
11200 exp->expType->refCount--;
11201 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11205 struct __ecereNameSpace__ecere__sys__OldList * specs;
11206 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11207 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11209 context = PushContext();
11210 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11211 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11212 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11214 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11215 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")), '=', newExp))));
11216 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")))));
11217 exp->compound->compound.context = context;
11218 PopContext(context);
11223 exp->cast.typeName = MkTypeName(MkListOne(MkSpecifierName("uint64")), (((void *)0)));
11224 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11228 else if(exp->expType && exp->expType->passAsTemplate && exp->destType && ((unsigned int)((exp->usage & 0x1) >> 0)) && exp->destType->kind != 20 && !exp->destType->passAsTemplate)
11230 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
11231 struct Statement * compound;
11232 struct Context * context;
11236 exp->destType->refCount++;
11238 exp->expType->refCount++;
11239 newExp->prev = (((void *)0));
11240 newExp->next = (((void *)0));
11241 switch(exp->expType->kind)
11244 if(exp->destType->classObjectType)
11247 exp->destType->refCount--;
11249 exp->expType->refCount--;
11250 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11254 struct __ecereNameSpace__ecere__sys__OldList * specs;
11255 struct __ecereNameSpace__ecere__sys__OldList * unionDefs = MkList();
11256 struct __ecereNameSpace__ecere__sys__OldList * statements = MkList();
11258 context = PushContext();
11259 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifier(DOUBLE)), MkListOne(MkDeclaratorIdentifier(MkIdentifier("d"))), (((void *)0)))));
11260 ListAdd(unionDefs, MkClassDefDeclaration(MkStructDeclaration(MkListOne(MkSpecifierName("uint64")), MkListOne(MkDeclaratorIdentifier(MkIdentifier("i"))), (((void *)0)))));
11261 specs = MkListOne(MkStructOrUnion(4, (((void *)0)), unionDefs));
11263 exp->compound = MkCompoundStmt(MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internal_union")), (((void *)0)))))), statements);
11264 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpOp(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("i")), '=', newExp))));
11265 ListAdd(statements, MkExpressionStmt(MkListOne(MkExpMember(MkExpIdentifier(MkIdentifier("__internal_union")), MkIdentifier("d")))));
11266 exp->compound->compound.context = context;
11267 PopContext(context);
11272 if(exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 1)
11275 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), newExp)));
11276 ProcessExpressionType((*exp->list).first);
11282 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(exp->expType->_class->string)), (((void *)0))), newExp));
11283 newExp->needCast = 0x1;
11284 ProcessExpressionType((*exp->list).first);
11290 if(exp->expType->kind == 20)
11292 struct Type * type = ProcessTemplateParameterType(exp->expType->templateParameter);
11296 FreeType(exp->destType);
11297 FreeType(exp->expType);
11298 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11302 if(newExp->type == 8 && newExp->member.memberType == 3)
11306 exp->op.exp1 = (((void *)0));
11307 exp->op.exp2 = MkExpCast(MkTypeName(MkListOne(MkSpecifierName("uint64")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '&', newExp))));
11311 char typeString[1024];
11312 struct Declarator * decl;
11313 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
11315 typeString[0] = '\0';
11316 PrintType(exp->expType, typeString, 0x0, 0x0);
11317 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
11319 exp->cast.typeName = MkTypeName(specs, decl);
11320 exp->cast.exp = MkExpBrackets(MkListOne(newExp));
11321 exp->cast.exp->needCast = 0x1;
11329 extern int strncmp(const char * , const char * , size_t n);
11331 struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindPrefix(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char * key);
11333 static struct Symbol * ScanWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * nameSpace, char * name)
11335 int nsLen = strlen(nameSpace);
11336 struct Symbol * symbol;
11338 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)))
11340 char * s = symbol->string;
11342 if(!strncmp(s, nameSpace, nsLen))
11347 for(c = strlen(s) - 1; c >= 0; c--)
11350 namePart = s + c + 1;
11351 if(!strcmp(namePart, name))
11359 return (((void *)0));
11362 static struct Symbol * FindWithNameSpace(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, char * name)
11365 char nameSpace[1024];
11367 unsigned int gotColon = 0x0;
11369 nameSpace[0] = '\0';
11370 for(c = strlen(name) - 1; c >= 0; c--)
11376 namePart = name + c + 1;
11377 while(c >= 0 && name[c] == ':')
11381 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, name);
11385 memcpy(nameSpace, name, c + 1);
11386 nameSpace[c + 1] = (char)0;
11387 return ScanWithNameSpace(tree, nameSpace, namePart);
11391 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11397 struct Symbol * symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(tree, namePart);
11401 return ScanWithNameSpace(tree, "", namePart);
11403 return (((void *)0));
11406 static void ProcessDeclaration(struct Declaration * decl);
11408 struct Symbol * FindSymbol(char * name, struct Context * startContext, struct Context * endContext, unsigned int isStruct, unsigned int globalNameSpace)
11410 struct Context * ctx;
11411 struct Symbol * symbol = (((void *)0));
11413 for(ctx = startContext; ctx && !symbol; ctx = ctx->parent)
11415 if(ctx == globalContext && !globalNameSpace && ctx->hasNameSpace)
11417 symbol = (((void *)0));
11420 char curName[1024];
11422 strcpy(curName, thisNameSpace);
11423 strcat(curName, "::");
11424 strcat(curName, name);
11425 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, curName);
11428 symbol = FindWithNameSpace(isStruct ? &ctx->structSymbols : &ctx->symbols, name);
11431 symbol = (struct Symbol *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((isStruct ? &ctx->structSymbols : &ctx->symbols), name);
11432 if(symbol || ctx == endContext)
11435 if(inCompiler && curExternal && symbol && ctx == globalContext && curExternal->symbol && symbol->id > curExternal->symbol->idCode && symbol->pointerExternal)
11437 if(symbol->pointerExternal->type == 0)
11439 struct FunctionDefinition * function = symbol->pointerExternal->function;
11440 struct Context * tmpContext = curContext;
11442 curContext = (((void *)0));
11443 symbol->pointerExternal = MkExternalDeclaration(MkDeclaration(CopyList(function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(function->declarator), (((void *)0))))));
11444 curContext = tmpContext;
11445 symbol->pointerExternal->symbol = symbol;
11446 DeclareType(symbol->type, 0x1, 0x1);
11447 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, symbol->pointerExternal);
11448 symbol->id = curExternal->symbol->idCode;
11450 else if(symbol->pointerExternal->type == 1 && curExternal->symbol->idCode < symbol->pointerExternal->symbol->id)
11452 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Move((&*ast), symbol->pointerExternal, curExternal->prev);
11453 symbol->id = curExternal->symbol->idCode;
11459 static void GetTypeSpecs(struct Type * type, struct __ecereNameSpace__ecere__sys__OldList * specs)
11461 if(!type->isSigned && type->kind != 22 && type->kind != 23)
11462 ListAdd(specs, MkSpecifier(UNSIGNED));
11467 if(type->_class->registered)
11469 if(!type->_class->registered->dataType)
11470 type->_class->registered->dataType = ProcessTypeString(type->_class->registered->dataTypeString, 0x0);
11471 GetTypeSpecs(type->_class->registered->dataType, specs);
11476 ListAdd(specs, MkSpecifier(DOUBLE));
11479 ListAdd(specs, MkSpecifier(FLOAT));
11482 ListAdd(specs, MkSpecifier(CHAR));
11485 ListAdd(specs, MkSpecifier(SHORT));
11488 ListAdd(specs, MkSpecifier(INT64));
11491 ListAdd(specs, MkSpecifierName(type->isSigned ? "intptr" : "uintptr"));
11494 ListAdd(specs, MkSpecifierName(type->isSigned ? "intsize" : "uintsize"));
11498 ListAdd(specs, MkSpecifier(INT));
11503 extern char * __ecereNameSpace__ecere__sys__RSearchString(char * buffer, char * subStr, int maxLen, unsigned int matchCase, unsigned int matchWord);
11505 static void _PrintType(struct Type * type, char * string, unsigned int printName, unsigned int printFunction, unsigned int fullName)
11512 if(type->_class && type->_class->string)
11514 if(type->classObjectType == 2)
11515 strcat(string, "typed_object");
11517 strcat(string, type->_class->string);
11520 if(type->_class->registered)
11521 strcat(string, type->_class->registered->name);
11523 strcat(string, type->_class->string);
11530 _PrintType(type->type, string, 0x0, printFunction, fullName);
11531 strcat(string, " *");
11536 strcat(string, "void");
11539 strcat(string, type->isSigned ? "int" : "uint");
11542 strcat(string, type->isSigned ? "int64" : "uint64");
11545 strcat(string, type->isSigned ? "intptr" : "uintptr");
11548 strcat(string, type->isSigned ? "intsize" : "uintsize");
11551 strcat(string, type->isSigned ? "char" : "byte");
11554 strcat(string, type->isSigned ? "short" : "uint16");
11557 strcat(string, "float");
11560 strcat(string, "double");
11565 strcat(string, "struct ");
11566 strcat(string, type->enumName);
11568 else if(type->typeName)
11570 strcat(string, type->typeName);
11574 struct Type * member;
11576 strcat(string, "struct {");
11577 for(member = type->members.first; member; member = member->next)
11579 PrintType(member, string, 0x1, fullName);
11580 strcat(string, "; ");
11582 strcat(string, "}");
11588 strcat(string, "union ");
11589 strcat(string, type->enumName);
11591 else if(type->typeName)
11593 strcat(string, type->typeName);
11597 strcat(string, "union ");
11598 strcat(string, "(unnamed)");
11604 strcat(string, "enum ");
11605 strcat(string, type->enumName);
11607 else if(type->typeName)
11609 strcat(string, type->typeName);
11612 strcat(string, "enum");
11618 if(type->dllExport)
11619 strcat(string, "dllexport ");
11620 PrintType(type->returnType, string, 0x0, fullName);
11621 strcat(string, " ");
11628 strcat(string, type->name);
11631 char * name = __ecereNameSpace__ecere__sys__RSearchString(type->name, "::", strlen(type->name), 0x1, 0x0);
11637 strcat(string, name);
11643 struct Type * param;
11645 strcat(string, "(");
11646 for(param = type->params.first; param; param = param->next)
11648 PrintType(param, string, 0x1, fullName);
11650 strcat(string, ", ");
11652 strcat(string, ")");
11659 char baseType[1024], size[256];
11660 struct Type * arrayType = type;
11662 baseType[0] = '\0';
11664 while(arrayType->kind == 12)
11667 if(arrayType->enumClass)
11668 strcat(size, arrayType->enumClass->string);
11669 else if(arrayType->arraySizeExp)
11670 PrintExpression(arrayType->arraySizeExp, size);
11672 arrayType = arrayType->arrayType;
11674 _PrintType(arrayType, baseType, printName, printFunction, fullName);
11675 strcat(string, baseType);
11676 strcat(string, size);
11682 strcat(string, "...");
11685 _PrintType(type->method->dataType, string, 0x0, printFunction, fullName);
11688 strcat(string, "subclass(");
11689 strcat(string, type->_class ? type->_class->string : "int");
11690 strcat(string, ")");
11693 strcat(string, type->templateParameter->identifier->string);
11696 strcat(string, "thisclass");
11699 strcat(string, "__builtin_va_list");
11702 if(type->name && printName && type->kind != 11 && (type->kind != 13 || type->type->kind != 11))
11704 strcat(string, " ");
11705 strcat(string, type->name);
11710 void PrintType(struct Type * type, char * string, unsigned int printName, unsigned int fullName)
11712 struct Type * funcType;
11714 for(funcType = type; funcType && (funcType->kind == 13 || funcType->kind == 12); funcType = funcType->type)
11716 if(funcType && funcType->kind == 11 && type != funcType)
11718 char typeString[1024];
11719 struct Type * param;
11721 PrintType(funcType->returnType, string, 0x0, fullName);
11722 strcat(string, "(");
11723 _PrintType(type, string, printName, 0x0, fullName);
11724 strcat(string, ")");
11725 strcat(string, "(");
11726 for(param = funcType->params.first; param; param = param->next)
11728 PrintType(param, string, 0x1, fullName);
11730 strcat(string, ", ");
11732 strcat(string, ")");
11735 _PrintType(type, string, printName, 0x1, fullName);
11736 if(type->bitFieldCount)
11740 sprintf(count, ":%d", type->bitFieldCount);
11741 strcat(string, count);
11745 static struct Type * FindMember(struct Type * type, char * string)
11747 struct Type * memberType;
11749 for(memberType = type->members.first; memberType; memberType = memberType->next)
11751 if(!memberType->name)
11753 struct Type * subType = FindMember(memberType, string);
11758 else if(!strcmp(memberType->name, string))
11761 return (((void *)0));
11764 struct Type * FindMemberAndOffset(struct Type * type, char * string, unsigned int * offset)
11766 struct Type * memberType;
11768 for(memberType = type->members.first; memberType; memberType = memberType->next)
11770 if(!memberType->name)
11772 struct Type * subType = FindMember(memberType, string);
11776 *offset += memberType->offset;
11780 else if(!strcmp(memberType->name, string))
11782 *offset += memberType->offset;
11786 return (((void *)0));
11789 extern struct __ecereNameSpace__ecere__com__Instance * fileInput;
11791 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
11793 struct Expression * ParseExpressionString(char * expression)
11795 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
11796 ((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));
11797 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
11799 parsedExpression = (((void *)0));
11801 expression_yyparse();
11802 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
11803 return parsedExpression;
11806 extern char * QMkString(char * source);
11808 static unsigned int ResolveIdWithClass(struct Expression * exp, struct __ecereNameSpace__ecere__com__Class * _class, unsigned int skipIDClassCheck)
11810 struct Identifier * id = exp->identifier;
11811 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
11812 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
11813 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
11814 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
11816 if(_class && _class->type == 4)
11818 struct __ecereNameSpace__ecere__sys__NamedLink * value = (((void *)0));
11819 struct __ecereNameSpace__ecere__com__Class * enumClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "enum");
11823 struct __ecereNameSpace__ecere__com__Class * baseClass;
11825 for(baseClass = _class; baseClass && baseClass->type == 4; baseClass = baseClass->base)
11827 struct __ecereNameSpace__ecere__com__EnumClassData * e = (baseClass ? ((void *)(((char *)baseClass->data) + enumClass->offsetClass)) : (((void *)0)));
11829 for(value = e->values.first; value; value = value->next)
11831 if(!strcmp(value->name, id->string))
11836 char constant[256];
11838 FreeExpContents(exp);
11840 exp->isConstant = 0x1;
11841 if(!strcmp(baseClass->dataTypeString, "int"))
11842 sprintf(constant, "%d", value->data);
11844 sprintf(constant, "0x%X", value->data);
11845 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11846 exp->expType = MkClassType(baseClass->fullName);
11854 if((method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule)))
11856 ProcessMethodType(method);
11857 exp->expType = __extension__ ({
11858 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
11860 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1->methodClass = (skipIDClassCheck || (id && id->_class)) ? _class : (((void *)0)), __ecereInstance1;
11864 else if((prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule)))
11866 if(!prop->dataType)
11867 ProcessPropertyType(prop);
11868 exp->expType = prop->dataType;
11870 prop->dataType->refCount++;
11873 else if((member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)))))
11875 if(!member->dataType)
11876 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
11877 exp->expType = member->dataType;
11878 if(member->dataType)
11879 member->dataType->refCount++;
11882 else if((classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, id->string)))
11884 if(!classProp->dataType)
11885 classProp->dataType = ProcessTypeString(classProp->dataTypeString, 0x0);
11886 if(classProp->constant)
11888 FreeExpContents(exp);
11889 exp->isConstant = 0x1;
11890 if(classProp->dataType->kind == 13 && classProp->dataType->type->kind == 1)
11893 exp->constant = QMkString((char *)classProp->Get(_class));
11897 char constant[256];
11900 sprintf(constant, "%d", (int)classProp->Get(_class));
11901 exp->constant = __ecereNameSpace__ecere__sys__CopyString(constant);
11907 exp->expType = classProp->dataType;
11908 if(classProp->dataType)
11909 classProp->dataType->refCount++;
11915 static struct GlobalData * ScanGlobalData(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name)
11917 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = &nameSpace->functions;
11918 struct GlobalData * data = (struct GlobalData *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString((&*tree), name);
11919 struct __ecereNameSpace__ecere__com__NameSpace * child;
11923 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)))
11925 data = ScanGlobalData(child, name);
11933 extern struct __ecereNameSpace__ecere__com__NameSpace * globalData;
11935 extern char * strncpy(char * , const char * , size_t n);
11937 static struct GlobalData * FindGlobalData(char * name)
11940 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
11942 nameSpace = globalData;
11943 for(c = 0; name[c]; c++)
11945 if(name[c] == '.' || (name[c] == ':' && name[c + 1] == ':'))
11947 struct __ecereNameSpace__ecere__com__NameSpace * newSpace;
11948 char * spaceName = __ecereNameSpace__ecere__com__eSystem_New(sizeof(char) * (c - start + 1));
11950 strncpy(spaceName, name + start, c - start);
11951 spaceName[c - start] = '\0';
11952 newSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_FindString(&(*nameSpace).nameSpaces, spaceName);
11953 (__ecereNameSpace__ecere__com__eSystem_Delete(spaceName), spaceName = 0);
11955 return (((void *)0));
11956 nameSpace = newSpace;
11964 return ScanGlobalData(nameSpace, name + start);
11966 return (((void *)0));
11969 static int definedExpStackPos;
11971 static void * definedExpStack[512];
11973 void ReplaceExpContents(struct Expression * checkedExp, struct Expression * newExp)
11975 struct Expression * prev = checkedExp->prev, * next = checkedExp->next;
11977 FreeExpContents(checkedExp);
11978 FreeType(checkedExp->expType);
11979 FreeType(checkedExp->destType);
11980 *checkedExp = *newExp;
11981 ((newExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(newExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newExp)) : 0), newExp = 0);
11982 checkedExp->prev = prev;
11983 checkedExp->next = next;
11986 extern struct Expression * MkExpCall(struct Expression * expression, struct __ecereNameSpace__ecere__sys__OldList * arguments);
11988 extern int printf(char * , ...);
11990 void __ecereMethod_Expression_Clear();
11992 void ApplyAnyObjectLogic(struct Expression * e)
11994 struct Type * destType = e->destType;
11996 if(destType && (destType->classObjectType == 3))
11998 if(e && e->expType)
12000 struct Type * type = e->expType;
12001 struct __ecereNameSpace__ecere__com__Class * _class = (((void *)0));
12003 if(type->kind == 8 && type->_class && type->_class->registered)
12005 _class = type->_class->registered;
12007 else if(type->kind == 19)
12009 _class = FindClass("ecere::com::Class")->registered;
12013 char string[1024] = "";
12014 struct Symbol * classSym;
12016 PrintType(type, string, 0x0, 0x1);
12017 classSym = FindClass(string);
12019 _class = classSym->registered;
12021 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)))
12023 if(!_class || strcmp(_class->fullName, "char *"))
12025 struct Expression * checkedExp = e, * newExp;
12027 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12029 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12031 if(checkedExp->type == 25)
12033 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12036 checkedExp = (*checkedExp->list).last;
12038 else if(checkedExp->type == 11)
12039 checkedExp = checkedExp->cast.exp;
12041 if(checkedExp && checkedExp->type == 4 && checkedExp->op.op == '*' && !checkedExp->op.exp1)
12043 newExp = checkedExp->op.exp2;
12044 checkedExp->op.exp2 = (((void *)0));
12045 FreeExpContents(checkedExp);
12046 if(e->expType && e->expType->passAsTemplate)
12050 ComputeTypeSize(e->expType);
12051 sprintf(size, "%d", e->expType->size);
12052 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))))));
12054 ReplaceExpContents(checkedExp, newExp);
12055 e->byReference = 0x1;
12057 else if(!e->byReference || (_class && _class->type == 5))
12059 struct Expression * checkedExp, * newExp;
12062 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;
12064 if(_class && _class->type != 5 && _class->type != 0 && _class->type != 1 && !hasAddress)
12066 struct Context * context = PushContext();
12067 struct Declarator * decl;
12068 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12069 char typeString[1024];
12070 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12072 typeString[0] = '\0';
12074 newExp->prev = (((void *)0));
12075 newExp->next = (((void *)0));
12076 newExp->expType = (((void *)0));
12077 PrintType(e->expType, typeString, 0x0, 0x1);
12078 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12079 newExp->destType = ProcessType(specs, decl);
12080 curContext = context;
12085 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
12087 sprintf(name, "__internalValue%03X", internalValueCounter++);
12088 if(!curCompound->compound.declarations)
12089 curCompound->compound.declarations = MkList();
12090 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(name)), (((void *)0))))));
12091 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpOp(MkExpIdentifier(MkIdentifier(name)), '=', newExp))));
12092 ListAdd(stmts, MkExpressionStmt(MkListOne(MkExpIdentifier(MkIdentifier(name)))));
12093 e->compound = MkCompoundStmt((((void *)0)), stmts);
12096 printf("libec: compiler error, curCompound is null in ApplyAnyObjectLogic\n");
12098 struct Type * type = e->destType;
12100 e->destType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12101 CopyTypeInto(e->destType, type);
12102 e->destType->refCount = 1;
12103 e->destType->classObjectType = 0;
12106 e->compound->compound.context = context;
12107 PopContext(context);
12108 curContext = context->parent;
12112 while(((checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25) && checkedExp->list) || checkedExp->type == 11)
12114 if(checkedExp->type == 5 || checkedExp->type == 34 || checkedExp->type == 25)
12116 if(checkedExp->type == 25)
12118 checkedExp = (*((struct Statement *)(*checkedExp->compound->compound.statements).last)->expressions).last;
12121 checkedExp = (*checkedExp->list).last;
12123 else if(checkedExp->type == 11)
12124 checkedExp = checkedExp->cast.exp;
12127 struct Expression * operand = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12129 *operand = *checkedExp;
12130 checkedExp->destType = (((void *)0));
12131 checkedExp->expType = (((void *)0));
12132 __ecereMethod_Expression_Clear(checkedExp);
12133 checkedExp->type = 4;
12134 checkedExp->op.op = '&';
12135 checkedExp->op.exp1 = (((void *)0));
12136 checkedExp->op.exp2 = operand;
12145 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))))
12147 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && !strcmp(e->expType->_class->registered->name, "class"))
12153 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12156 thisExp->prev = (((void *)0));
12157 thisExp->next = (((void *)0));
12158 __ecereMethod_Expression_Clear(e);
12160 e->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpBrackets(MkListOne(thisExp))));
12161 if(thisExp->expType->kind == 8 && thisExp->expType->_class && thisExp->expType->_class->registered && thisExp->expType->_class->registered->type == 5)
12162 ((struct Expression *)(*e->list).first)->byReference = 0x1;
12164 e->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12165 CopyTypeInto(e->expType, thisExp->expType);
12166 e->expType->byReference = 0x0;
12167 e->expType->refCount = 1;
12168 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))
12170 e->expType->classObjectType = 0;
12175 else if(destType && e->expType && (e->expType->classObjectType == 3 || e->expType->classObjectType == 2) && !destType->classObjectType && destType->kind != 0)
12177 if(destType->kind == 14)
12179 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Unspecified type\n", (((void *)0))));
12181 else if(!(destType->truth && e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && e->expType->_class->registered->type == 1))
12183 unsigned int byReference = e->expType->byReference;
12184 struct Expression * thisExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
12185 struct Declarator * decl;
12186 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
12187 char typeString[1024];
12188 struct Type * type;
12189 int backupClassObjectType;
12191 if(e->expType->kind == 8 && e->expType->_class && e->expType->_class->registered && strcmp(e->expType->_class->registered->name, "class"))
12195 backupClassObjectType = type->classObjectType;
12196 type->classObjectType = 0;
12197 typeString[0] = '\0';
12198 PrintType(type, typeString, 0x0, 0x1);
12199 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
12200 type->classObjectType = backupClassObjectType;
12202 thisExp->prev = (((void *)0));
12203 thisExp->next = (((void *)0));
12204 __ecereMethod_Expression_Clear(e);
12205 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)))
12209 e->op.exp1 = (((void *)0));
12210 e->op.exp2 = MkExpCast(MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl)), thisExp);
12215 e->cast.typeName = MkTypeName(specs, decl);
12216 e->cast.exp = thisExp;
12217 e->byReference = 0x1;
12220 e->destType = destType;
12222 destType->refCount++;
12227 extern char * strstr(const char * , const char * );
12229 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
12231 struct __ecereNameSpace__ecere__com__DefinedExpression
12233 struct __ecereNameSpace__ecere__com__DefinedExpression * prev;
12234 struct __ecereNameSpace__ecere__com__DefinedExpression * next;
12237 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
12238 } __attribute__ ((gcc_struct));
12240 extern struct __ecereNameSpace__ecere__com__DefinedExpression * __ecereNameSpace__ecere__com__eSystem_FindDefine(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12242 extern struct __ecereNameSpace__ecere__com__GlobalFunction * __ecereNameSpace__ecere__com__eSystem_FindFunction(struct __ecereNameSpace__ecere__com__Instance * module, char * name);
12244 extern unsigned int __ecereNameSpace__ecere__sys__UTF8GetChar(char * string, int * numBytes);
12246 extern struct Expression * GetTemplateArgExp(struct TemplateParameter * param, struct __ecereNameSpace__ecere__com__Class * curClass, unsigned int pointer);
12248 extern struct Expression * MkExpCondition(struct Expression * cond, struct __ecereNameSpace__ecere__sys__OldList * expressions, struct Expression * elseExp);
12250 extern struct Expression * CopyExpression(struct Expression * exp);
12252 extern struct Expression * MkExpTypeSize(struct TypeName * typeName);
12254 extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Declarator * decl);
12256 static void ProcessStatement(struct Statement * stmt);
12258 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
12260 extern struct Initializer * MkInitializerList(struct __ecereNameSpace__ecere__sys__OldList * list);
12262 extern char * __ecereNameSpace__ecere__com__PrintString(struct __ecereNameSpace__ecere__com__Class * class, void * object, ...);
12264 extern char * sourceFile;
12266 void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear(struct __ecereNameSpace__ecere__sys__OldList * this);
12268 void ProcessExpressionType(struct Expression * exp)
12270 unsigned int unresolved = 0x0;
12271 struct Location oldyylloc = yylloc;
12272 unsigned int notByReference = 0x0;
12274 if(!exp || exp->expType)
12281 struct Identifier * id = exp->identifier;
12285 if(id->_class && id->_class->name)
12287 id->classSym = id->_class->symbol;
12289 if(strstr(id->string, "__ecereClass") == id->string)
12291 exp->expType = ProcessTypeString("ecere::com::Class", 0x1);
12294 else if(id->_class && (id->classSym || (id->_class->name && !strcmp(id->_class->name, "property"))))
12296 ReplaceClassMembers(exp, thisClass);
12299 ProcessExpressionType(exp);
12302 if(id->classSym && ResolveIdWithClass(exp, id->classSym->registered, 0x0))
12307 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12311 if(exp->destType && CheckExpressionType(exp, exp->destType, 0x0))
12317 ReplaceClassMembers(exp, thisClass ? thisClass : currentClass);
12320 ProcessExpressionType(exp);
12324 else if(currentClass && !id->_class)
12326 if(ResolveIdWithClass(exp, currentClass, 0x1))
12329 symbol = FindSymbol(id->string, topContext->parent, globalContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12334 struct Type * type = symbol->type;
12335 struct __ecereNameSpace__ecere__com__Class * _class = (type && type->kind == 8 && type->_class) ? type->_class->registered : (((void *)0));
12337 if(_class && !strcmp(id->string, "this") && !type->classObjectType)
12339 struct Context * context = SetupTemplatesContext(_class);
12341 type = ReplaceThisClassType(_class);
12342 FinishTemplatesContext(context);
12344 type->refCount = 0;
12346 FreeSpecifier(id->_class);
12347 id->_class = (((void *)0));
12348 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12349 id->string = __ecereNameSpace__ecere__sys__CopyString(symbol->string);
12350 id->classSym = (((void *)0));
12351 exp->expType = type;
12354 if(type && (type->kind == 15 || (_class && _class->type == 4)))
12355 exp->isConstant = 0x1;
12356 if(symbol->isParam || !strcmp(id->string, "this"))
12358 if(_class && _class->type == 1)
12359 exp->byReference = 0x1;
12361 if(symbol->isIterator)
12363 if(symbol->isIterator == 3)
12366 exp->list = MkListOne(MkExpOp((((void *)0)), '*', MkExpIdentifier(exp->identifier)));
12367 ((struct Expression *)(*exp->list).first)->op.exp2->expType = exp->expType;
12368 exp->expType = (((void *)0));
12369 ProcessExpressionType(exp);
12371 else if(symbol->isIterator != 4)
12374 exp->member.exp = MkExpIdentifier(exp->identifier);
12375 exp->member.exp->expType = exp->expType;
12376 exp->member.member = MkIdentifier("data");
12377 exp->expType = (((void *)0));
12378 ProcessExpressionType(exp);
12385 struct __ecereNameSpace__ecere__com__DefinedExpression * definedExp = (((void *)0));
12387 if(thisNameSpace && !(id->_class && !id->_class->name))
12391 strcpy(name, thisNameSpace);
12392 strcat(name, "::");
12393 strcat(name, id->string);
12394 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, name);
12397 definedExp = __ecereNameSpace__ecere__com__eSystem_FindDefine(privateModule, id->string);
12402 for(c = 0; c < definedExpStackPos; c++)
12403 if(definedExpStack[c] == definedExp)
12405 if(c == definedExpStackPos && c < sizeof definedExpStack / sizeof(void *))
12407 struct Location backupYylloc = yylloc;
12409 definedExpStack[definedExpStackPos++] = definedExp;
12410 fileInput = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass___ecereNameSpace__ecere__sys__TempFile);
12411 ((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));
12412 ((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
12414 parsedExpression = (((void *)0));
12416 expression_yyparse();
12417 (__ecereNameSpace__ecere__com__eInstance_DecRef(fileInput), fileInput = 0);
12418 yylloc = backupYylloc;
12419 if(parsedExpression)
12421 FreeIdentifier(id);
12423 exp->list = MkListOne(parsedExpression);
12424 parsedExpression->loc = yylloc;
12425 ProcessExpressionType(exp);
12426 definedExpStackPos--;
12429 definedExpStackPos--;
12435 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Recursion in defined expression %s\n", (((void *)0))), id->string);
12441 struct GlobalData * data = (((void *)0));
12443 if(thisNameSpace && !(id->_class && !id->_class->name))
12447 strcpy(name, thisNameSpace);
12448 strcat(name, "::");
12449 strcat(name, id->string);
12450 data = FindGlobalData(name);
12453 data = FindGlobalData(id->string);
12456 DeclareGlobalData(data);
12457 exp->expType = data->dataType;
12459 data->dataType->refCount++;
12460 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12461 id->string = __ecereNameSpace__ecere__sys__CopyString(data->fullName);
12462 FreeSpecifier(id->_class);
12463 id->_class = (((void *)0));
12468 struct __ecereNameSpace__ecere__com__GlobalFunction * function = (((void *)0));
12470 if(thisNameSpace && !(id->_class && !id->_class->name))
12474 strcpy(name, thisNameSpace);
12475 strcat(name, "::");
12476 strcat(name, id->string);
12477 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, name);
12480 function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, id->string);
12485 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12486 id->string = __ecereNameSpace__ecere__sys__CopyString(function->name);
12488 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
12489 strcpy(name, "__ecereFunction_");
12490 FullClassNameCat(name, id->string, 0x0);
12491 if(DeclareFunction(function, name))
12493 (__ecereNameSpace__ecere__com__eSystem_Delete(id->string), id->string = 0);
12494 id->string = __ecereNameSpace__ecere__sys__CopyString(name);
12496 exp->expType = function->dataType;
12497 if(function->dataType)
12498 function->dataType->refCount++;
12499 FreeSpecifier(id->_class);
12500 id->_class = (((void *)0));
12512 struct __ecereNameSpace__ecere__com__Class * _class;
12514 if(!exp->instance->_class)
12516 if(exp->destType && exp->destType->kind == 8 && exp->destType->_class)
12518 exp->instance->_class = MkSpecifierName(exp->destType->_class->string);
12521 ProcessInstantiationType(exp->instance);
12522 exp->isConstant = exp->instance->isConstant;
12523 if(exp->instance->_class)
12525 exp->expType = MkClassType(exp->instance->_class->name);
12533 struct Type * type = (type = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), type->refCount = 1, type->constant = 0x1, type);
12535 exp->expType = type;
12536 if(exp->constant[0] == '\'')
12538 if((int)((unsigned char *)exp->constant)[1] > 127)
12541 unsigned int ch = __ecereNameSpace__ecere__sys__UTF8GetChar(exp->constant + 1, &nb);
12544 ch = exp->constant[1];
12545 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->constant), exp->constant = 0);
12546 exp->constant = PrintUInt(ch);
12548 type->_class = FindClass("unichar");
12549 type->isSigned = 0x0;
12554 type->isSigned = 0x1;
12557 else if(strchr(exp->constant, '.'))
12559 char ch = exp->constant[strlen(exp->constant) - 1];
12565 type->isSigned = 0x1;
12569 if(exp->constant[0] == '0' && exp->constant[1])
12570 type->isSigned = 0x0;
12571 else if(strchr(exp->constant, 'L') || strchr(exp->constant, 'l'))
12572 type->isSigned = 0x0;
12573 else if(strtoll(exp->constant, (((void *)0)), 0) > (((int)0x7fffffff)))
12574 type->isSigned = 0x0;
12576 type->isSigned = 0x1;
12579 exp->isConstant = 0x1;
12585 exp->isConstant = 0x1;
12586 exp->expType = __extension__ ({
12587 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12589 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
12590 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12592 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 1, __ecereInstance1->constant = 0x1, __ecereInstance1;
12593 }), __ecereInstance2;
12599 ProcessExpressionType(exp->_new.size);
12600 exp->expType = __extension__ ({
12601 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12603 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_new.typeName->qualifiers, exp->_new.typeName->declarator), __ecereInstance1;
12605 DeclareType(exp->expType->type, 0x0, 0x0);
12609 ProcessExpressionType(exp->_renew.size);
12610 ProcessExpressionType(exp->_renew.exp);
12611 exp->expType = __extension__ ({
12612 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12614 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = ProcessType(exp->_renew.typeName->qualifiers, exp->_renew.typeName->declarator), __ecereInstance1;
12616 DeclareType(exp->expType->type, 0x0, 0x0);
12620 unsigned int assign = 0x0, boolResult = 0x0, boolOps = 0x0;
12621 struct Type * type1 = (((void *)0)), * type2 = (((void *)0));
12622 unsigned int useDestType = 0x0, useSideType = 0x0;
12623 struct Location oldyylloc = yylloc;
12624 unsigned int useSideUnit = 0x0;
12625 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
12667 if(exp->op.op != '*' || exp->op.exp1)
12674 if(exp->op.op == '&')
12676 if(!exp->op.exp1 && exp->op.exp2 && exp->op.exp2->type == 0 && exp->op.exp2->identifier)
12678 struct Identifier * id = exp->op.exp2->identifier;
12679 struct Symbol * symbol = FindSymbol(id->string, curContext, topContext, 0x0, id->_class && id->_class->name == (((void *)0)));
12681 if(symbol && symbol->isIterator == 2)
12684 exp->member.exp = exp->op.exp2;
12685 exp->member.member = MkIdentifier("key");
12686 exp->expType = (((void *)0));
12687 exp->op.exp2->expType = symbol->type;
12688 symbol->type->refCount++;
12689 ProcessExpressionType(exp);
12697 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))
12699 if(exp->op.exp1->destType)
12700 FreeType(exp->op.exp1->destType);
12701 exp->op.exp1->destType = exp->destType;
12703 exp->destType->refCount++;
12707 if(exp->op.exp1->destType)
12708 FreeType(exp->op.exp1->destType);
12709 exp->op.exp1->destType = dummy;
12712 if(exp->op.exp1->destType && exp->op.op != '=')
12713 exp->op.exp1->destType->count++;
12714 ProcessExpressionType(exp->op.exp1);
12715 if(exp->op.exp1->destType && exp->op.op != '=')
12716 exp->op.exp1->destType->count--;
12717 if(exp->op.exp1->destType == dummy)
12720 exp->op.exp1->destType = (((void *)0));
12722 type1 = exp->op.exp1->expType;
12726 char expString[10240];
12728 expString[0] = '\0';
12729 if(exp->op.exp2->type == 1 && !exp->op.exp2->instance->_class)
12733 exp->op.exp2->destType = exp->op.exp1->expType;
12734 if(exp->op.exp1->expType)
12735 exp->op.exp1->expType->refCount++;
12739 exp->op.exp2->destType = exp->destType;
12741 exp->destType->refCount++;
12745 exp->expType = type1;
12750 PrintExpression(exp->op.exp2, expString);
12751 if(type1 && type1->kind == 13)
12753 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)
12754 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "operator %s illegal on pointer\n", (((void *)0))), exp->op.op);
12755 else if(exp->op.op == '=')
12757 if(exp->op.exp2->destType)
12758 FreeType(exp->op.exp2->destType);
12759 exp->op.exp2->destType = type1;
12766 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)
12770 if(exp->op.exp2->destType)
12771 FreeType(exp->op.exp2->destType);
12772 exp->op.exp2->destType = type1;
12779 exp->expType = type1;
12781 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)))
12783 if(exp->op.exp2->destType)
12784 FreeType(exp->op.exp2->destType);
12785 exp->op.exp2->destType = exp->destType;
12787 exp->destType->refCount++;
12791 if(exp->op.exp2->destType)
12792 FreeType(exp->op.exp2->destType);
12793 exp->op.exp2->destType = dummy;
12796 if(type1 && boolResult && useSideType && type1->kind == 8 && type1->_class && type1->_class->registered && (type1->_class->registered->type == 2 || type1->_class->registered->type == 4))
12798 FreeType(exp->op.exp2->destType);
12799 exp->op.exp2->destType = type1;
12802 if(exp->op.exp2->destType && exp->op.op != '=')
12803 exp->op.exp2->destType->count++;
12804 ProcessExpressionType(exp->op.exp2);
12805 if(exp->op.exp2->destType && exp->op.op != '=')
12806 exp->op.exp2->destType->count--;
12807 if(assign && type1 && type1->kind == 13 && exp->op.exp2->expType)
12809 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)
12811 if(exp->op.op != '=' && type1->type->kind == 0)
12812 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12814 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)))
12816 if(exp->op.op == ADD_ASSIGN)
12817 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12819 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))
12821 if(exp->op.op == ADD_ASSIGN)
12822 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12824 else if(inCompiler)
12826 char type1String[1024];
12827 char type2String[1024];
12829 type1String[0] = '\0';
12830 type2String[0] = '\0';
12831 PrintType(exp->op.exp2->expType, type1String, 0x0, 0x1);
12832 PrintType(type1, type2String, 0x0, 0x1);
12833 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
12834 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1String, type2String);
12837 if(exp->op.exp2->destType == dummy)
12840 exp->op.exp2->destType = (((void *)0));
12842 type2 = exp->op.exp2->expType;
12845 if(exp->op.op == SIZEOF)
12847 exp->expType = __extension__ ({
12848 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12850 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
12852 exp->isConstant = 0x1;
12854 else if(exp->op.op == '*' && !exp->op.exp1)
12856 exp->expType = Dereference(type2);
12857 if(type2 && type2->kind == 8)
12858 notByReference = 0x1;
12860 else if(exp->op.op == '&' && !exp->op.exp1)
12861 exp->expType = Reference(type2);
12868 if(exp->op.exp1->destType)
12869 FreeType(exp->op.exp1->destType);
12870 exp->op.exp1->destType = MkClassType("bool");
12871 exp->op.exp1->destType->truth = 0x1;
12872 if(!exp->op.exp1->expType)
12873 ProcessExpressionType(exp->op.exp1);
12875 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
12876 FreeType(exp->op.exp1->expType);
12877 exp->op.exp1->expType = MkClassType("bool");
12878 exp->op.exp1->expType->truth = 0x1;
12882 if(exp->op.exp2->destType)
12883 FreeType(exp->op.exp2->destType);
12884 exp->op.exp2->destType = MkClassType("bool");
12885 exp->op.exp2->destType->truth = 0x1;
12886 if(!exp->op.exp2->expType)
12887 ProcessExpressionType(exp->op.exp2);
12889 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
12890 FreeType(exp->op.exp2->expType);
12891 exp->op.exp2->expType = MkClassType("bool");
12892 exp->op.exp2->expType->truth = 0x1;
12895 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")))))
12897 if(type1 && type2 && ((type1->kind == 8 && type1->_class && strcmp(type1->_class->string, "String")) == (type2->kind == 8 && type2->_class && strcmp(type2->_class->string, "String"))))
12899 if(exp->op.exp2->destType)
12900 FreeType(exp->op.exp2->destType);
12901 exp->op.exp2->destType = type1;
12903 if(exp->op.exp1->destType)
12904 FreeType(exp->op.exp1->destType);
12905 exp->op.exp1->destType = type2;
12907 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)
12908 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);
12909 if(type1->kind == 13 && type1->type->kind == 20 && type2->kind != 13)
12911 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12915 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12917 exp->op.exp1 = MkExpBrackets(MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName("byte")), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp->op.exp1)));
12918 ProcessExpressionType(exp->op.exp1);
12919 if(type2->kind != 13)
12921 ProcessExpressionType(classExp);
12922 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"))))))));
12923 if(!exp->op.exp2->expType)
12924 type2 = exp->op.exp2->expType = ProcessTypeString("int", 0x0);
12925 ProcessExpressionType(exp->op.exp2);
12929 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)))
12931 if(type1->kind != 8 && type1->type->kind == 0)
12932 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12933 exp->expType = type1;
12937 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)))
12939 if(type2->kind != 8 && type2->type->kind == 0)
12940 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "void *: unknown size\n", (((void *)0))));
12941 exp->expType = type2;
12945 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))
12947 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "different levels of indirection\n", (((void *)0))));
12951 unsigned int success = 0x0;
12953 if(type1->kind == 13 && type2->kind == 13)
12955 if(exp->op.op == '+')
12956 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "cannot add two pointers\n", (((void *)0))));
12957 else if(exp->op.op == '-')
12959 if(MatchTypes(type1->type, type2->type, (((void *)0)), (((void *)0)), (((void *)0)), 0x0, 0x0, 0x0, 0x0))
12961 exp->expType = __extension__ ({
12962 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
12964 __ecereInstance1->kind = 3, __ecereInstance1->refCount = 1, __ecereInstance1;
12967 if(type1->type->kind == 20)
12969 struct Expression * argExp = GetTemplateArgExp(type1->type->templateParameter, thisClass, 0x1);
12973 struct Expression * classExp = MkExpMember(argExp, MkIdentifier("dataTypeClass"));
12975 ProcessExpressionType(classExp);
12977 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")))))));
12978 ProcessExpressionType(((struct Expression *)(*exp->list).first)->op.exp2);
12986 if(!success && exp->op.exp1->type == 2)
12988 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
12991 FreeType(exp->expType);
12992 exp->expType = exp->op.exp1->destType;
12993 if(exp->op.exp1->destType)
12994 exp->op.exp1->destType->refCount++;
12997 else if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13000 FreeType(exp->expType);
13001 exp->expType = exp->op.exp2->destType;
13002 if(exp->op.exp2->destType)
13003 exp->op.exp2->destType->refCount++;
13009 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13012 FreeType(exp->expType);
13013 exp->expType = exp->op.exp2->destType;
13014 if(exp->op.exp2->destType)
13015 exp->op.exp2->destType->refCount++;
13018 else if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13021 FreeType(exp->expType);
13022 exp->expType = exp->op.exp1->destType;
13023 if(exp->op.exp1->destType)
13024 exp->op.exp1->destType->refCount++;
13030 char expString1[10240];
13031 char expString2[10240];
13035 expString1[0] = '\0';
13036 expString2[0] = '\0';
13041 PrintExpression(exp->op.exp1, expString1);
13042 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13043 PrintExpression(exp->op.exp2, expString2);
13044 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13045 PrintType(exp->op.exp1->expType, type1, 0x0, 0x1);
13046 PrintType(exp->op.exp2->expType, type2, 0x0, 0x1);
13048 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1, expString2, type2);
13052 else if(!boolResult && (!useSideUnit) && type2 && type1 && type2->kind == 8 && type1->kind != 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13054 if(exp->op.exp1->destType)
13055 FreeType(exp->op.exp1->destType);
13056 exp->op.exp1->destType = type2->_class->registered->dataType;
13057 if(type2->_class->registered->dataType)
13058 type2->_class->registered->dataType->refCount++;
13059 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13060 exp->expType = type2;
13064 else if(!boolResult && (!useSideUnit) && type1 && type2 && type1->kind == 8 && type2->kind != 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13066 if(exp->op.exp2->destType)
13067 FreeType(exp->op.exp2->destType);
13068 exp->op.exp2->destType = type1->_class->registered->dataType;
13069 if(type1->_class->registered->dataType)
13070 type1->_class->registered->dataType->refCount++;
13071 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13072 exp->expType = type1;
13078 unsigned int valid = 0x0;
13080 if(!boolResult && useSideUnit && type1 && type1->kind == 8 && type1->_class->registered && type1->_class->registered->type == 3 && type2 && type2->kind != 8)
13082 if(exp->op.exp2->destType)
13083 FreeType(exp->op.exp2->destType);
13084 if(!type1->_class->registered->dataType)
13085 type1->_class->registered->dataType = ProcessTypeString(type1->_class->registered->dataTypeString, 0x0);
13086 exp->op.exp2->destType = type1->_class->registered->dataType;
13087 exp->op.exp2->destType->refCount++;
13088 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13089 type2 = exp->op.exp2->destType;
13090 exp->expType = type2;
13093 if(!boolResult && useSideUnit && type2 && type2->kind == 8 && type2->_class->registered && type2->_class->registered->type == 3 && type1 && type1->kind != 8)
13095 if(exp->op.exp1->destType)
13096 FreeType(exp->op.exp1->destType);
13097 if(!type2->_class->registered->dataType)
13098 type2->_class->registered->dataType = ProcessTypeString(type2->_class->registered->dataTypeString, 0x0);
13099 exp->op.exp1->destType = type2->_class->registered->dataType;
13100 exp->op.exp1->destType->refCount++;
13101 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13102 type1 = exp->op.exp1->destType;
13103 exp->expType = type1;
13106 if(!boolResult || exp->op.op == '>' || exp->op.op == '<')
13108 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4 && exp->op.exp2->expType)
13110 if(CheckExpressionType(exp->op.exp1, exp->op.exp2->expType, 0x0))
13113 FreeType(exp->expType);
13114 exp->expType = exp->op.exp1->expType;
13115 if(exp->op.exp2->expType)
13116 exp->op.exp1->expType->refCount++;
13120 else if(type2 && (type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4 && exp->op.exp1->expType))
13122 if(CheckExpressionType(exp->op.exp2, exp->op.exp1->expType, 0x0))
13125 FreeType(exp->expType);
13126 exp->expType = exp->op.exp2->expType;
13127 if(exp->op.exp2->expType)
13128 exp->op.exp2->expType->refCount++;
13135 if(exp->op.exp2->destType)
13136 FreeType(exp->op.exp2->destType);
13137 exp->op.exp2->destType = type1;
13139 if(CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0))
13142 FreeType(exp->expType);
13143 exp->expType = exp->op.exp2->destType;
13144 if(exp->op.exp2->destType)
13145 exp->op.exp2->destType->refCount++;
13147 else if(type1 && type2)
13149 char expString1[10240];
13150 char expString2[10240];
13151 char type1String[1024];
13152 char type2String[1024];
13154 expString1[0] = '\0';
13155 expString2[0] = '\0';
13156 type1String[0] = '\0';
13157 type2String[0] = '\0';
13160 PrintExpression(exp->op.exp1, expString1);
13161 __ecereNameSpace__ecere__sys__ChangeCh(expString1, '\n', ' ');
13162 PrintExpression(exp->op.exp2, expString2);
13163 __ecereNameSpace__ecere__sys__ChangeCh(expString2, '\n', ' ');
13164 PrintType(exp->op.exp1->expType, type1String, 0x0, 0x1);
13165 PrintType(exp->op.exp2->expType, type2String, 0x0, 0x1);
13167 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expressions %s (%s) and %s (%s)\n", (((void *)0))), expString1, type1String, expString2, type2String);
13168 if(type1->kind == 8 && type1->_class && type1->_class->registered && type1->_class->registered->type == 4)
13170 exp->expType = exp->op.exp1->expType;
13171 if(exp->op.exp1->expType)
13172 exp->op.exp1->expType->refCount++;
13174 else if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13176 exp->expType = exp->op.exp2->expType;
13177 if(exp->op.exp2->expType)
13178 exp->op.exp2->expType->refCount++;
13185 if(type2->kind == 8 && type2->_class && type2->_class->registered && type2->_class->registered->type == 4)
13187 struct Type * oldType = exp->op.exp1->expType;
13189 exp->op.exp1->expType = (((void *)0));
13190 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13193 exp->op.exp1->expType = oldType;
13195 if(exp->op.exp1->destType)
13196 FreeType(exp->op.exp1->destType);
13197 exp->op.exp1->destType = type2;
13199 if(CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0))
13202 FreeType(exp->expType);
13203 exp->expType = exp->op.exp1->destType;
13204 if(exp->op.exp1->destType)
13205 exp->op.exp1->destType->refCount++;
13209 else if(type2 && (!type1 || (type2->kind == 8 && type1->kind != 8)))
13211 if(type1 && type2->_class && type2->_class->registered && type2->_class->registered->type == 3)
13213 if(exp->op.exp1->destType)
13214 FreeType(exp->op.exp1->destType);
13215 exp->op.exp1->destType = type2->_class->registered->dataType;
13216 if(type2->_class->registered->dataType)
13217 type2->_class->registered->dataType->refCount++;
13218 CheckExpressionType(exp->op.exp1, exp->op.exp1->destType, 0x0);
13220 if(exp->op.op == '!')
13222 exp->expType = MkClassType("bool");
13223 exp->expType->truth = 0x1;
13227 exp->expType = type2;
13232 else if(type1 && (!type2 || (type1->kind == 8 && type2->kind != 8)))
13234 if(type2 && type1->_class && type1->_class->registered && type1->_class->registered->type == 3)
13236 if(exp->op.exp2->destType)
13237 FreeType(exp->op.exp2->destType);
13238 exp->op.exp2->destType = type1->_class->registered->dataType;
13239 if(type1->_class->registered->dataType)
13240 type1->_class->registered->dataType->refCount++;
13241 CheckExpressionType(exp->op.exp2, exp->op.exp2->destType, 0x0);
13243 exp->expType = type1;
13249 if(exp->op.exp1 && !exp->op.exp1->expType)
13251 char expString[10000];
13253 expString[0] = '\0';
13256 PrintExpression(exp->op.exp1, expString);
13257 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13260 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13262 if(exp->op.exp2 && !exp->op.exp2->expType)
13264 char expString[10240];
13266 expString[0] = '\0';
13269 PrintExpression(exp->op.exp2, expString);
13270 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
13273 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
13277 FreeType(exp->expType);
13278 exp->expType = MkClassType("bool");
13279 exp->expType->truth = 0x1;
13281 if(exp->op.op != SIZEOF)
13282 exp->isConstant = (!exp->op.exp1 || exp->op.exp1->isConstant) && (!exp->op.exp2 || exp->op.exp2->isConstant);
13283 if(exp->op.op == SIZEOF && exp->op.exp2->expType)
13285 DeclareType(exp->op.exp2->expType, 0x0, 0x0);
13287 yylloc = oldyylloc;
13294 struct Expression * e;
13296 exp->isConstant = 0x1;
13297 for(e = (*exp->list).first; e; e = e->next)
13299 unsigned int inced = 0x0;
13303 FreeType(e->destType);
13304 e->destType = exp->destType;
13307 exp->destType->refCount++;
13308 e->destType->count++;
13312 ProcessExpressionType(e);
13314 exp->destType->count--;
13315 if(!exp->expType && !e->next)
13317 exp->expType = e->expType;
13319 e->expType->refCount++;
13322 exp->isConstant = 0x0;
13324 e = (*exp->list).first;
13325 if(!e->next && e->type == 8)
13327 struct Expression * next = exp->next, * prev = exp->prev;
13329 FreeType(exp->expType);
13330 FreeType(exp->destType);
13331 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
13335 ((e ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(e) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(e)) : 0), e = 0);
13336 ProcessExpressionType(exp);
13342 struct Expression * e;
13344 exp->isConstant = 0x1;
13345 ProcessExpressionType(exp->index.exp);
13346 if(!exp->index.exp->isConstant)
13347 exp->isConstant = 0x0;
13348 if(exp->index.exp->expType)
13350 struct Type * source = exp->index.exp->expType;
13352 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)
13354 struct __ecereNameSpace__ecere__com__Class * _class = source->_class->registered;
13356 exp->expType = ProcessTypeString(_class->templateArgs[2].dataTypeString, 0x0);
13357 if(exp->index.index && (*exp->index.index).last)
13359 ((struct Expression *)(*exp->index.index).last)->destType = ProcessTypeString(_class->templateArgs[1].dataTypeString, 0x0);
13363 for(e = (*exp->index.index).first; e; e = e->next)
13365 if(!e->next && exp->index.exp->expType && exp->index.exp->expType->kind == 12 && exp->index.exp->expType->enumClass)
13368 FreeType(e->destType);
13369 e->destType = MkClassType(exp->index.exp->expType->enumClass->string);
13371 ProcessExpressionType(e);
13376 exp->isConstant = 0x0;
13379 exp->expType = Dereference(exp->index.exp->expType);
13381 DeclareType(exp->expType, 0x0, 0x0);
13386 struct Expression * e;
13387 struct Type * functionType;
13388 struct Type * methodType = (((void *)0));
13394 PrintExpression(exp->call.exp, name);
13395 if(exp->call.exp->expType && !exp->call.exp->expType->returnType)
13397 PrintExpression(exp->call.exp, name);
13400 if(exp->call.exp->type == 0)
13402 struct Expression * idExp = exp->call.exp;
13403 struct Identifier * id = idExp->identifier;
13405 if(!strcmp(id->string, "__builtin_frame_address"))
13407 exp->expType = ProcessTypeString("void *", 0x1);
13408 if(exp->call.arguments && (*exp->call.arguments).first)
13409 ProcessExpressionType((*exp->call.arguments).first);
13412 else if(!strcmp(id->string, "__ENDIAN_PAD"))
13414 exp->expType = ProcessTypeString("int", 0x1);
13415 if(exp->call.arguments && (*exp->call.arguments).first)
13416 ProcessExpressionType((*exp->call.arguments).first);
13419 else if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min") || !strcmp(id->string, "Sgn") || !strcmp(id->string, "Abs"))
13421 struct Expression * a = (((void *)0));
13422 struct Expression * b = (((void *)0));
13423 struct Expression * tempExp1 = (((void *)0)), * tempExp2 = (((void *)0));
13425 if((!strcmp(id->string, "Max") || !strcmp(id->string, "Min")) && (*exp->call.arguments).count == 2)
13427 a = (*exp->call.arguments).first;
13428 b = (*exp->call.arguments).last;
13432 else if((*exp->call.arguments).count == 1)
13434 a = (*exp->call.arguments).first;
13439 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Clear((&*exp->call.arguments));
13440 idExp->identifier = (((void *)0));
13441 FreeExpContents(exp);
13442 ProcessExpressionType(a);
13444 ProcessExpressionType(b);
13446 exp->list = MkList();
13447 if(a->expType && (!b || b->expType))
13449 if((!a->isConstant && a->type != 0) || (b && !b->isConstant && b->type != 0))
13453 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13454 struct __ecereNameSpace__ecere__sys__OldList * decls = MkList();
13455 struct Declaration * decl;
13456 char temp1[1024], temp2[1024];
13458 GetTypeSpecs(a->expType, specs);
13459 if(a && !a->isConstant && a->type != 0)
13461 sprintf(temp1, "__simpleStruct%d", curContext->simpleID++);
13462 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp1)), (((void *)0))));
13463 tempExp1 = QMkExpId(temp1);
13464 tempExp1->expType = a->expType;
13466 a->expType->refCount++;
13467 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp1), '=', a));
13469 if(b && !b->isConstant && b->type != 0)
13471 sprintf(temp2, "__simpleStruct%d", curContext->simpleID++);
13472 ListAdd(decls, MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier(temp2)), (((void *)0))));
13473 tempExp2 = QMkExpId(temp2);
13474 tempExp2->expType = b->expType;
13476 b->expType->refCount++;
13477 ListAdd(exp->list, MkExpOp(CopyExpression(tempExp2), '=', b));
13479 decl = MkDeclaration(specs, decls);
13480 if(!curCompound->compound.declarations)
13481 curCompound->compound.declarations = MkList();
13482 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*curCompound->compound.declarations), (((void *)0)), decl);
13486 if(!strcmp(id->string, "Max") || !strcmp(id->string, "Min"))
13488 int op = (!strcmp(id->string, "Max")) ? '>' : '<';
13490 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), op, CopyExpression(tempExp2)))), MkListOne(CopyExpression(tempExp1)), CopyExpression(tempExp2)));
13491 exp->expType = a->expType;
13493 a->expType->refCount++;
13495 else if(!strcmp(id->string, "Abs"))
13497 ListAdd(exp->list, MkExpCondition(MkExpBrackets(MkListOne(MkExpOp(CopyExpression(tempExp1), '<', MkExpConstant("0")))), MkListOne(MkExpOp((((void *)0)), '-', CopyExpression(tempExp1))), CopyExpression(tempExp1)));
13498 exp->expType = a->expType;
13500 a->expType->refCount++;
13502 else if(!strcmp(id->string, "Sgn"))
13504 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"))))));
13505 exp->expType = ProcessTypeString("int", 0x0);
13507 FreeExpression(tempExp1);
13509 FreeExpression(tempExp2);
13510 FreeIdentifier(id);
13516 struct Type * dummy = (dummy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type), dummy->count = (unsigned int)1, dummy->refCount = 1, dummy);
13518 if(!exp->call.exp->destType)
13520 exp->call.exp->destType = dummy;
13523 ProcessExpressionType(exp->call.exp);
13524 if(exp->call.exp->destType == dummy)
13527 exp->call.exp->destType = (((void *)0));
13531 functionType = exp->call.exp->expType;
13532 if(functionType && functionType->kind == 16)
13534 methodType = functionType;
13535 functionType = methodType->method->dataType;
13536 if(exp->call.exp->expType->usedClass)
13538 char typeString[1024];
13540 typeString[0] = '\0';
13541 PrintType(functionType, typeString, 0x1, 0x1);
13542 if(strstr(typeString, "thisclass"))
13544 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13545 struct Declarator * decl;
13548 struct Context * context = SetupTemplatesContext(exp->call.exp->expType->usedClass);
13550 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
13551 if(thisClass != (exp->call.exp->expType->usedClass->templateClass ? exp->call.exp->expType->usedClass->templateClass : exp->call.exp->expType->usedClass))
13552 thisClassParams = 0x0;
13553 ReplaceThisClassSpecifiers(specs, exp->call.exp->expType->usedClass);
13555 struct __ecereNameSpace__ecere__com__Class * backupThisClass = thisClass;
13557 thisClass = exp->call.exp->expType->usedClass;
13558 ProcessDeclarator(decl);
13559 thisClass = backupThisClass;
13561 thisClassParams = 0x1;
13562 functionType = ProcessType(specs, decl);
13563 functionType->refCount = 0;
13564 FinishTemplatesContext(context);
13566 FreeList(specs, FreeSpecifier);
13567 FreeDeclarator(decl);
13571 if(functionType && functionType->kind == 13 && functionType->type && functionType->type->kind == 11)
13573 struct Type * type = functionType->type;
13575 if(!functionType->refCount)
13577 functionType->type = (((void *)0));
13578 FreeType(functionType);
13580 functionType = type;
13582 if(functionType && functionType->kind != 11)
13584 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "called object %s is not a function\n", (((void *)0))), name);
13586 else if(functionType)
13588 unsigned int emptyParams = 0x0, noParams = 0x0;
13589 struct Expression * e = exp->call.arguments ? (*exp->call.arguments).first : (((void *)0));
13590 struct Type * type = functionType->params.first;
13591 struct Expression * memberExp = (exp->call.exp->type == 8) ? exp->call.exp : (((void *)0));
13593 struct Location oldyylloc = yylloc;
13597 if(functionType->extraParam && e && functionType->thisClass)
13599 e->destType = MkClassType(functionType->thisClass->string);
13602 if(!functionType->staticMethod)
13604 if(memberExp && memberExp->member.exp && memberExp->member.exp->expType && memberExp->member.exp->expType->kind == 19 && memberExp->member.exp->expType->_class)
13606 type = MkClassType(memberExp->member.exp->expType->_class->string);
13609 e->destType = type;
13611 type = functionType->params.first;
13614 type->refCount = 0;
13616 else if(!memberExp && (functionType->thisClass || (methodType && methodType->methodClass)))
13618 type = MkClassType(functionType->thisClass ? functionType->thisClass->string : (methodType ? methodType->methodClass->fullName : (((void *)0))));
13621 e->destType = type;
13623 type = functionType->params.first;
13626 type->refCount = 0;
13629 if(type && type->kind == 0)
13632 if(!type->refCount)
13634 type = (((void *)0));
13636 for(; e; e = e->next)
13638 if(!type && !emptyParams)
13641 if(methodType && methodType->methodClass)
13642 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);
13644 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);
13647 if(methodType && type && type->kind == 20 && type->templateParameter->type == 0)
13649 struct Type * templatedType = (((void *)0));
13650 struct __ecereNameSpace__ecere__com__Class * _class = methodType->usedClass;
13651 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
13654 if(_class && _class->templateArgs)
13656 struct __ecereNameSpace__ecere__com__Class * sClass;
13658 for(sClass = _class; sClass; sClass = sClass->base)
13660 if(sClass->templateClass)
13661 sClass = sClass->templateClass;
13663 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
13665 if(curParam->type == 0 && !strcmp(type->templateParameter->identifier->string, curParam->name))
13667 struct __ecereNameSpace__ecere__com__Class * nextClass;
13669 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13671 if(nextClass->templateClass)
13672 nextClass = nextClass->templateClass;
13673 id += nextClass->templateParams.count;
13683 if(curParam && _class->templateArgs[id].dataTypeString)
13685 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = _class->templateArgs[id];
13688 struct Context * context = SetupTemplatesContext(_class);
13690 templatedType = ProcessTypeString(arg.dataTypeString, 0x0);
13691 FinishTemplatesContext(context);
13693 e->destType = templatedType;
13696 templatedType->passAsTemplate = 0x1;
13701 e->destType = type;
13708 if(type && type->kind == 14 && type->prev && type->prev->kind == 8 && type->prev->classObjectType)
13710 e->destType = type->prev;
13711 e->destType->refCount++;
13715 e->destType = type;
13720 if(type && type->kind != 14)
13722 struct Type * next = type->next;
13724 if(!type->refCount)
13729 if(type && type->kind != 14)
13731 if(methodType && methodType->methodClass)
13732 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);
13734 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);
13736 yylloc = oldyylloc;
13737 if(type && !type->refCount)
13742 functionType = __extension__ ({
13743 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13745 __ecereInstance1->refCount = 0, __ecereInstance1->kind = 11, __ecereInstance1;
13747 if(exp->call.exp->type == 0)
13749 char * string = exp->call.exp->identifier->string;
13753 struct Symbol * symbol;
13754 struct Location oldyylloc = yylloc;
13756 yylloc = exp->call.exp->identifier->loc;
13757 if(strstr(string, "__builtin_") == string)
13760 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "%s undefined; assuming extern returning int\n", (((void *)0))), string);
13761 symbol = __extension__ ({
13762 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
13764 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString(string), __ecereInstance1->type = ProcessTypeString("int()", 0x1), __ecereInstance1;
13766 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)symbol);
13767 if(strstr(symbol->string, "::"))
13768 globalContext->hasNameSpace = 0x1;
13769 yylloc = oldyylloc;
13772 else if(exp->call.exp->type == 8)
13776 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "callable object undefined; extern assuming returning int\n", (((void *)0))));
13777 if(!functionType->returnType)
13779 functionType->returnType = __extension__ ({
13780 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
13782 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
13786 if(functionType && functionType->kind == 11)
13788 exp->expType = functionType->returnType;
13789 if(functionType->returnType)
13790 functionType->returnType->refCount++;
13791 if(!functionType->refCount)
13792 FreeType(functionType);
13794 if(exp->call.arguments)
13796 for(e = (*exp->call.arguments).first; e; e = e->next)
13798 struct Type * destType = e->destType;
13800 ProcessExpressionType(e);
13807 struct Type * type;
13808 struct Location oldyylloc = yylloc;
13809 unsigned int thisPtr = (exp->member.exp && exp->member.exp->type == 0 && !strcmp(exp->member.exp->identifier->string, "this"));
13811 exp->thisPtr = thisPtr;
13812 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
13814 exp->member.member->classSym = exp->member.member->_class->symbol;
13816 ProcessExpressionType(exp->member.exp);
13817 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)
13819 exp->isConstant = 0x0;
13822 exp->isConstant = exp->member.exp->isConstant;
13823 type = exp->member.exp->expType;
13825 if(type && (type->kind == 20))
13827 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
13828 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param = (((void *)0));
13832 for(param = _class->templateParams.first; param; param = param->next)
13834 if(param->type == 1 && exp->member.member && exp->member.member->string && !strcmp(param->name, exp->member.member->string))
13838 if(param && param->defaultArg.member)
13840 struct Expression * argExp = GetTemplateArgExpByName(param->name, thisClass, 1);
13844 struct Expression * expMember = exp->member.exp;
13845 struct Declarator * decl;
13846 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13847 char thisClassTypeString[1024];
13849 FreeIdentifier(exp->member.member);
13850 ProcessExpressionType(argExp);
13852 char * colon = strstr(param->defaultArg.memberString, "::");
13856 char className[1024];
13857 struct __ecereNameSpace__ecere__com__Class * sClass;
13859 memcpy(thisClassTypeString, param->defaultArg.memberString, colon - param->defaultArg.memberString);
13860 thisClassTypeString[colon - param->defaultArg.memberString] = '\0';
13863 strcpy(thisClassTypeString, _class->fullName);
13865 decl = SpecDeclFromString(param->defaultArg.member->dataTypeString, specs, (((void *)0)));
13866 exp->expType = ProcessType(specs, decl);
13867 if(exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->templateClass)
13869 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
13870 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
13872 int paramCount = 0;
13873 int lastParam = -1;
13874 char templateString[1024];
13875 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
13877 sprintf(templateString, "%s<", expClass->templateClass->fullName);
13878 for(cClass = expClass; cClass; cClass = cClass->base)
13882 for(param = cClass->templateParams.first; param; param = param->next)
13885 struct __ecereNameSpace__ecere__com__Class * sClass;
13886 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
13888 for(sClass = cClass->base; sClass; sClass = sClass->base)
13889 id += sClass->templateParams.count;
13890 arg = expClass->templateArgs[id];
13891 for(sClass = _class; sClass; sClass = sClass->base)
13893 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * cParam;
13895 struct __ecereNameSpace__ecere__com__Class * nextClass;
13897 for(nextClass = sClass->base; nextClass; nextClass = nextClass->base)
13898 p += nextClass->templateParams.count;
13899 for(cParam = sClass->templateParams.first; cParam; cParam = cParam->next, p++)
13901 if(cParam->type == 0 && arg.dataTypeString && !strcmp(cParam->name, arg.dataTypeString))
13903 if(_class->templateArgs && arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13905 arg.dataTypeString = _class->templateArgs[p].dataTypeString;
13906 arg.dataTypeClass = _class->templateArgs[p].dataTypeClass;
13913 char argument[256];
13915 argument[0] = '\0';
13916 switch(param->type)
13920 char expString[1024];
13921 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
13922 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
13923 struct Expression * exp;
13924 char * string = PrintHexUInt64(arg.expression.ui64);
13926 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
13927 ProcessExpressionType(exp);
13928 ComputeExpression(exp);
13929 expString[0] = '\0';
13930 PrintExpression(exp, expString);
13931 strcat(argument, expString);
13932 FreeExpression(exp);
13937 strcat(argument, arg.member->name);
13942 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
13944 if(!strcmp(arg.dataTypeString, "thisclass"))
13945 strcat(argument, thisClassTypeString);
13947 strcat(argument, arg.dataTypeString);
13955 strcat(templateString, ", ");
13956 if(lastParam != p - 1)
13958 strcat(templateString, param->name);
13959 strcat(templateString, " = ");
13961 strcat(templateString, argument);
13970 int len = strlen(templateString);
13972 if(templateString[len - 1] == '>')
13973 templateString[len++] = ' ';
13974 templateString[len++] = '>';
13975 templateString[len++] = '\0';
13978 struct Context * context = SetupTemplatesContext(_class);
13980 FreeType(exp->expType);
13981 exp->expType = ProcessTypeString(templateString, 0x0);
13982 FinishTemplatesContext(context);
13986 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")))))))));
13989 else if(type->templateParameter && type->templateParameter->type == 0 && (type->templateParameter->dataType || type->templateParameter->dataTypeString))
13991 type = ProcessTemplateParameterType(type->templateParameter);
13994 if(type && (type->kind == 20))
13996 else if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
13998 struct Identifier * id = exp->member.member;
13999 int typeKind = type->kind;
14000 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));
14002 if(typeKind == 19 && exp->member.exp->type == 26)
14004 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "ecere::com::Class");
14007 if(id && (typeKind == 3 || typeKind == 15))
14008 _class = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "int");
14011 struct __ecereNameSpace__ecere__com__Property * prop = (((void *)0));
14012 struct __ecereNameSpace__ecere__com__Method * method = (((void *)0));
14013 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
14014 struct __ecereNameSpace__ecere__com__Property * revConvert = (((void *)0));
14015 struct __ecereNameSpace__ecere__com__ClassProperty * classProp = (((void *)0));
14017 if(id && id->_class && id->_class->name && !strcmp(id->_class->name, "property"))
14018 exp->member.memberType = 1;
14019 if(id && id->_class && type->_class && !__ecereNameSpace__ecere__com__eClass_IsDerived(type->_class->registered, _class))
14020 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "invalid class specifier %s for object of class %s\n", (((void *)0))), _class->fullName, type->_class->string);
14023 if((exp->member.memberType == 0 && thisPtr) || exp->member.memberType == 3)
14025 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14026 if(member && member->_class != (_class->templateClass ? _class->templateClass : _class) && exp->member.memberType != 3)
14028 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14030 member = (((void *)0));
14032 if(!member && !prop)
14033 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14034 if((member && member->_class == (_class->templateClass ? _class->templateClass : _class)) || (prop && prop->_class == (_class->templateClass ? _class->templateClass : _class)))
14035 exp->member.thisPtr = 0x1;
14041 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, (((void *)0)));
14042 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14043 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, (((void *)0)), (((void *)0)), (((void *)0)));
14045 if(!prop && !member)
14047 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, (((void *)0)));
14050 prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, id->string, privateModule);
14051 if(!id->_class || !id->_class->name || strcmp(id->_class->name, "property"))
14052 member = __ecereNameSpace__ecere__com__eClass_FindDataMember(_class, id->string, privateModule, (((void *)0)), (((void *)0)));
14057 if(member->_class != prop->_class && !id->_class && __ecereNameSpace__ecere__com__eClass_IsDerived(member->_class, prop->_class))
14058 prop = (((void *)0));
14060 member = (((void *)0));
14064 if(!prop && !member)
14065 method = __ecereNameSpace__ecere__com__eClass_FindMethod(_class, id->string, privateModule);
14066 if(!prop && !member && !method)
14070 classProp = __ecereNameSpace__ecere__com__eClass_FindClassProperty(type->_class->registered, exp->member.member->string);
14073 exp->member.memberType = 5;
14074 exp->expType = ProcessTypeString(classProp->dataTypeString, 0x0);
14078 char structName[1024];
14079 struct Identifier * id = exp->member.member;
14080 struct Expression * classExp = exp->member.exp;
14083 FreeType(classExp->expType);
14084 classExp->expType = ProcessTypeString("ecere::com::Class", 0x0);
14085 strcpy(structName, "__ecereClassData_");
14086 FullClassNameCat(structName, type->_class->string, 0x0);
14088 exp->member.member = id;
14089 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"))))))));
14091 ProcessExpressionType(exp);
14097 struct Symbol * classSym = FindClass(id->string);
14101 struct __ecereNameSpace__ecere__com__Class * convertClass = classSym->registered;
14104 revConvert = __ecereNameSpace__ecere__com__eClass_FindProperty(convertClass, _class->fullName, privateModule);
14110 exp->member.memberType = 1;
14111 if(!prop->dataType)
14112 ProcessPropertyType(prop);
14113 exp->expType = prop->dataType;
14115 prop->dataType->refCount++;
14119 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14121 FreeExpContents(exp);
14123 exp->identifier = MkIdentifier("class");
14124 ProcessExpressionType(exp);
14127 exp->member.memberType = 3;
14128 DeclareStruct(_class->fullName, 0x0);
14129 if(!member->dataType)
14131 struct Context * context = SetupTemplatesContext(_class);
14133 member->dataType = ProcessTypeString(member->dataTypeString, 0x0);
14134 FinishTemplatesContext(context);
14136 exp->expType = member->dataType;
14137 if(member->dataType)
14138 member->dataType->refCount++;
14140 else if(revConvert)
14142 exp->member.memberType = 4;
14143 exp->expType = MkClassType(revConvert->_class->fullName);
14149 exp->member.memberType = 2;
14151 if(!method->dataType)
14152 ProcessMethodType(method);
14153 exp->expType = __extension__ ({
14154 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14156 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 16, __ecereInstance1->method = method, __ecereInstance1;
14158 exp->expType->methodClass = (id && id->_class) ? _class : (((void *)0));
14159 exp->expType->usedClass = _class;
14161 else if(!classProp)
14163 if(exp->member.exp->expType->classObjectType == 2 && !strcmp(exp->member.member->string, "_class"))
14165 FreeExpContents(exp);
14167 exp->identifier = MkIdentifier("class");
14168 ProcessExpressionType(exp);
14171 yylloc = exp->member.member->loc;
14172 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't find member %s in class %s\n", (((void *)0))), id->string, _class->fullName);
14174 __ecereNameSpace__ecere__com__eClass_AddDataMember(_class, id->string, "int", 0, 0, 1);
14176 if(_class && exp->expType)
14178 struct __ecereNameSpace__ecere__com__Class * tClass;
14181 while(tClass && !tClass->templateClass)
14182 tClass = tClass->base;
14183 if(tClass && exp->expType->kind == 20 && exp->expType->templateParameter->type == 0)
14186 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14187 struct __ecereNameSpace__ecere__com__Class * sClass;
14189 for(sClass = tClass; sClass; sClass = sClass->base)
14192 if(sClass->templateClass)
14193 sClass = sClass->templateClass;
14194 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14196 if(curParam->type == 0 && !strcmp(exp->expType->templateParameter->identifier->string, curParam->name))
14198 for(sClass = sClass->base; sClass; sClass = sClass->base)
14199 id += sClass->templateParams.count;
14207 if(curParam && tClass->templateArgs[id].dataTypeString)
14209 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14210 struct Context * context = SetupTemplatesContext(tClass);
14212 FreeType(exp->expType);
14213 exp->expType = ProcessTypeString(arg.dataTypeString, 0x0);
14216 if(exp->expType->kind == 21)
14218 FreeType(exp->expType);
14219 exp->expType = ReplaceThisClassType(_class);
14221 if(tClass->templateClass)
14222 exp->expType->passAsTemplate = 0x1;
14225 exp->destType = ProcessTypeString(arg.dataTypeString, 0x0);
14226 if(exp->destType->kind == 21)
14228 FreeType(exp->destType);
14229 exp->destType = ReplaceThisClassType(_class);
14233 FinishTemplatesContext(context);
14236 else if(tClass && exp->expType->kind == 13 && exp->expType->type && exp->expType->type->kind == 20 && exp->expType->type->templateParameter->type == 0)
14239 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * curParam = (((void *)0));
14240 struct __ecereNameSpace__ecere__com__Class * sClass;
14242 for(sClass = tClass; sClass; sClass = sClass->base)
14245 if(sClass->templateClass)
14246 sClass = sClass->templateClass;
14247 for(curParam = sClass->templateParams.first; curParam; curParam = curParam->next)
14249 if(curParam->type == 0 && !strcmp(exp->expType->type->templateParameter->identifier->string, curParam->name))
14251 for(sClass = sClass->base; sClass; sClass = sClass->base)
14252 id += sClass->templateParams.count;
14262 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg = tClass->templateArgs[id];
14263 struct Context * context = SetupTemplatesContext(tClass);
14264 struct Type * basicType;
14266 basicType = ProcessTypeString(arg.dataTypeString, 0x0);
14269 if(basicType->kind == 21)
14271 FreeType(basicType);
14272 basicType = ReplaceThisClassType(_class);
14274 FreeType(exp->expType);
14275 exp->expType = __extension__ ({
14276 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14278 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 13, __ecereInstance1->type = basicType, __ecereInstance1;
14282 exp->destType = exp->expType;
14283 exp->destType->refCount++;
14286 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14287 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14288 struct Declarator * decl;
14290 decl = SpecDeclFromString(arg.dataTypeString, specs, (((void *)0)));
14293 exp->destType->refCount++;
14295 exp->expType->refCount++;
14297 exp->cast.typeName = MkTypeName(specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl));
14298 exp->cast.exp = newExp;
14301 FinishTemplatesContext(context);
14304 else if(tClass && exp->expType->kind == 8 && exp->expType->_class && strchr(exp->expType->_class->string, '<'))
14306 struct __ecereNameSpace__ecere__com__Class * expClass = exp->expType->_class->registered;
14310 struct __ecereNameSpace__ecere__com__Class * cClass = (((void *)0));
14313 int paramCount = 0;
14314 int lastParam = -1;
14315 char templateString[1024];
14316 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * param;
14318 sprintf(templateString, "%s<", expClass->templateClass->fullName);
14319 while(cClass != expClass)
14321 struct __ecereNameSpace__ecere__com__Class * sClass;
14323 for(sClass = expClass; sClass && sClass->base != cClass; sClass = sClass->base)
14326 for(param = cClass->templateParams.first; param; param = param->next)
14328 struct __ecereNameSpace__ecere__com__Class * cClassCur = (((void *)0));
14331 struct __ecereNameSpace__ecere__com__ClassTemplateParameter * paramCur = (((void *)0));
14332 struct __ecereNameSpace__ecere__com__ClassTemplateArgument arg;
14334 while(cClassCur != tClass && !paramCur)
14336 struct __ecereNameSpace__ecere__com__Class * sClassCur;
14338 for(sClassCur = tClass; sClassCur && sClassCur->base != cClassCur; sClassCur = sClassCur->base)
14340 cClassCur = sClassCur;
14341 for(paramCur = cClassCur->templateParams.first; paramCur; paramCur = paramCur->next)
14343 if(!strcmp(paramCur->name, param->name))
14350 if(paramCur && paramCur->type == 0)
14351 arg = tClass->templateArgs[cp];
14353 arg = expClass->templateArgs[p];
14355 char argument[256];
14357 argument[0] = '\0';
14358 switch(param->type)
14362 char expString[1024];
14363 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14364 struct Declarator * decl = SpecDeclFromString(param->dataTypeString, specs, (((void *)0)));
14365 struct Expression * exp;
14366 char * string = PrintHexUInt64(arg.expression.ui64);
14368 exp = MkExpCast(MkTypeName(specs, decl), MkExpConstant(string));
14369 ProcessExpressionType(exp);
14370 ComputeExpression(exp);
14371 expString[0] = '\0';
14372 PrintExpression(exp, expString);
14373 strcat(argument, expString);
14374 FreeExpression(exp);
14379 strcat(argument, arg.member->name);
14384 if(arg.dataTypeString && (!param->defaultArg.dataTypeString || strcmp(arg.dataTypeString, param->defaultArg.dataTypeString)))
14385 strcat(argument, arg.dataTypeString);
14392 strcat(templateString, ", ");
14393 if(lastParam != p - 1)
14395 strcat(templateString, param->name);
14396 strcat(templateString, " = ");
14398 strcat(templateString, argument);
14407 int len = strlen(templateString);
14409 if(templateString[len - 1] == '>')
14410 templateString[len++] = ' ';
14411 templateString[len++] = '>';
14412 templateString[len++] = '\0';
14414 FreeType(exp->expType);
14416 struct Context * context = SetupTemplatesContext(tClass);
14418 exp->expType = ProcessTypeString(templateString, 0x0);
14419 FinishTemplatesContext(context);
14426 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)");
14428 else if(type && (type->kind == 9 || type->kind == 10))
14430 struct Type * memberType = exp->member.member ? FindMember(type, exp->member.member->string) : (((void *)0));
14434 exp->expType = memberType;
14436 memberType->refCount++;
14441 char expString[10240];
14443 expString[0] = '\0';
14446 PrintExpression(exp, expString);
14447 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14449 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "member operator on non-structure type expression %s\n", (((void *)0))), expString);
14451 if(exp->expType && exp->expType->kind == 21 && (!exp->destType || exp->destType->kind != 21))
14453 if(type && (type->kind == 8 || type->kind == 19 || type->kind == 3 || type->kind == 15))
14455 struct Identifier * id = exp->member.member;
14456 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));
14460 FreeType(exp->expType);
14461 exp->expType = ReplaceThisClassType(_class);
14465 yylloc = oldyylloc;
14470 struct Type * destType = exp->destType;
14472 if(exp->member.member && exp->member.member->_class && exp->member.member->_class->name)
14474 exp->member.member->classSym = exp->member.member->_class->symbol;
14476 exp->member.exp = MkExpBrackets(MkListOne(MkExpOp((((void *)0)), '*', exp->member.exp)));
14480 ProcessExpressionType(exp);
14487 struct Symbol * classSym = exp->_class->symbol;
14489 if(classSym && classSym->registered)
14491 if(classSym->registered->type == 5)
14496 DeclareStruct(classSym->string, 0x0);
14497 FreeSpecifier(exp->_class);
14499 FullClassNameCat(name, classSym->string, 0x0);
14500 exp->typeName = MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(name), (((void *)0)))), (((void *)0)));
14504 if(classSym->registered->fixed)
14506 FreeSpecifier(exp->_class);
14507 exp->constant = PrintUInt(classSym->registered->templateClass ? classSym->registered->templateClass->structSize : classSym->registered->structSize);
14512 char className[1024];
14514 strcpy(className, "__ecereClass_");
14515 FullClassNameCat(className, classSym->string, 0x1);
14516 MangleClassName(className);
14517 DeclareClass(classSym, className);
14518 FreeExpContents(exp);
14520 exp->member.exp = MkExpIdentifier(MkIdentifier(className));
14521 exp->member.member = MkIdentifier("structSize");
14525 exp->expType = __extension__ ({
14526 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14528 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14534 struct Type * type = ProcessType(exp->typeName->qualifiers, exp->typeName->declarator);
14536 exp->expType = __extension__ ({
14537 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14539 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 3, __ecereInstance1;
14541 exp->isConstant = 0x1;
14542 DeclareType(type, 0x0, 0x0);
14548 struct Type * type = ProcessType(exp->cast.typeName->qualifiers, exp->cast.typeName->declarator);
14550 type->count = (unsigned int)1;
14551 FreeType(exp->cast.exp->destType);
14552 exp->cast.exp->destType = type;
14554 ProcessExpressionType(exp->cast.exp);
14555 type->count = (unsigned int)0;
14556 exp->expType = type;
14557 if(!exp->cast.exp->needCast && !NeedCast(exp->cast.exp->expType, type))
14559 void * prev = exp->prev, * next = exp->next;
14560 struct Type * expType = exp->cast.exp->destType;
14561 struct Expression * castExp = exp->cast.exp;
14562 struct Type * destType = exp->destType;
14565 expType->refCount++;
14566 FreeType(exp->expType);
14567 FreeTypeName(exp->cast.typeName);
14569 FreeType(exp->expType);
14570 FreeType(exp->destType);
14571 exp->expType = expType;
14572 exp->destType = destType;
14573 ((castExp ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor(castExp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(castExp)) : 0), castExp = 0);
14579 exp->isConstant = exp->cast.exp->isConstant;
14585 struct Type * type = ProcessType(exp->initializer.typeName->qualifiers, exp->initializer.typeName->declarator);
14588 exp->expType = type;
14593 struct Type * type = ProcessType(exp->vaArg.typeName->qualifiers, exp->vaArg.typeName->declarator);
14595 ProcessExpressionType(exp->vaArg.exp);
14597 exp->expType = type;
14602 struct Expression * e;
14604 exp->isConstant = 0x1;
14605 FreeType(exp->cond.cond->destType);
14606 exp->cond.cond->destType = MkClassType("bool");
14607 exp->cond.cond->destType->truth = 0x1;
14608 ProcessExpressionType(exp->cond.cond);
14609 if(!exp->cond.cond->isConstant)
14610 exp->isConstant = 0x0;
14611 for(e = (*exp->cond.exp).first; e; e = e->next)
14615 FreeType(e->destType);
14616 e->destType = exp->destType;
14618 e->destType->refCount++;
14620 ProcessExpressionType(e);
14623 exp->expType = e->expType;
14625 e->expType->refCount++;
14628 exp->isConstant = 0x0;
14630 FreeType(exp->cond.elseExp->destType);
14631 exp->cond.elseExp->destType = exp->destType ? exp->destType : exp->expType;
14632 if(exp->cond.elseExp->destType)
14633 exp->cond.elseExp->destType->refCount++;
14634 ProcessExpressionType(exp->cond.elseExp);
14635 if(!exp->cond.elseExp->isConstant)
14636 exp->isConstant = 0x0;
14641 if(exp->compound && exp->compound->compound.statements && (*exp->compound->compound.statements).last)
14643 struct Statement * last = (*exp->compound->compound.statements).last;
14645 if(last->type == 3 && last->expressions && (*last->expressions).last)
14647 ((struct Expression *)(*last->expressions).last)->destType = exp->destType;
14649 exp->destType->refCount++;
14651 ProcessStatement(exp->compound);
14652 exp->expType = (last->expressions && (*last->expressions).last) ? ((struct Expression *)(*last->expressions).last)->expType : (((void *)0));
14654 exp->expType->refCount++;
14660 struct Specifier * spec = (*exp->_classExp.specifiers).first;
14662 if(spec && spec->type == 1)
14664 exp->expType = MkClassType(spec->name);
14665 exp->expType->kind = 19;
14666 exp->byReference = 0x1;
14670 exp->expType = MkClassType("ecere::com::Class");
14671 exp->byReference = 0x1;
14677 struct __ecereNameSpace__ecere__com__Class * _class = thisClass ? thisClass : currentClass;
14681 struct Identifier * id = exp->classData.id;
14682 char structName[1024];
14683 struct Expression * classExp;
14685 strcpy(structName, "__ecereClassData_");
14686 FullClassNameCat(structName, _class->fullName, 0x0);
14688 exp->member.member = id;
14689 if(curCompound && FindSymbol("this", curContext, curCompound->compound.context, 0x0, 0x0))
14690 classExp = MkExpMember(MkExpIdentifier(MkIdentifier("this")), MkIdentifier("_class"));
14692 classExp = MkExpIdentifier(MkIdentifier("class"));
14693 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"))))))));
14694 ProcessExpressionType(exp);
14701 struct Type * type = (((void *)0));
14702 char * typeString = (((void *)0));
14703 char typeStringBuf[1024];
14705 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))
14707 struct __ecereNameSpace__ecere__com__Class * templateClass = exp->destType->_class->registered;
14709 typeString = templateClass->templateArgs[2].dataTypeString;
14713 struct Expression * e;
14715 for(e = (*exp->list).first; e; e = e->next)
14717 ProcessExpressionType(e);
14727 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14731 e->expType = (((void *)0));
14732 e = (*exp->list).first;
14733 ProcessExpressionType(e);
14736 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
14738 FreeType(e->expType);
14739 e->expType = (((void *)0));
14741 type = (((void *)0));
14749 FreeType(e->expType);
14750 e->expType = (((void *)0));
14756 typeStringBuf[0] = '\0';
14757 PrintType(type, typeStringBuf, 0x0, 0x1);
14758 typeString = typeStringBuf;
14760 type = (((void *)0));
14765 char templateString[1024];
14766 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
14767 struct __ecereNameSpace__ecere__sys__OldList * structInitializers = MkList();
14768 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14769 struct Expression * expExt;
14770 struct Declarator * decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14772 sprintf(templateString, "Container<%s>", typeString);
14775 struct Expression * e;
14777 type = ProcessTypeString(typeString, 0x0);
14778 while(e = (*exp->list).first)
14780 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*exp->list), e);
14781 e->destType = type;
14783 ProcessExpressionType(e);
14784 ListAdd(initializers, MkInitializerAssignment(e));
14787 (__ecereNameSpace__ecere__com__eSystem_Delete(exp->list), exp->list = 0);
14789 DeclareStruct("ecere::com::BuiltInContainer", 0x0);
14790 ListAdd(structInitializers, MkInitializerAssignment(MkExpMember(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkIdentifier("_vTbl"))));
14791 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14792 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0)))));
14793 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14794 ListAdd(structInitializers, MkInitializerAssignment(MkExpConstant("0")));
14795 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14796 ListAdd(structInitializers, MkInitializerAssignment(MkExpExtensionInitializer(MkTypeName(specs, MkDeclaratorArray(decl, (((void *)0)))), MkInitializerList(initializers))));
14797 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14798 ListAdd(structInitializers, MkInitializerAssignment(__extension__ ({
14799 struct Expression * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14801 __ecereInstance1->type = 2, __ecereInstance1->constant = __ecereNameSpace__ecere__com__PrintString(__ecereClass_int, &(*initializers).count, (void *)0), __ecereInstance1;
14803 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14804 ListAdd(structInitializers, MkInitializerAssignment(MkExpClass(CopyList(specs, CopySpecifier), CopyDeclarator(decl))));
14805 ProcessExpressionType(((struct Initializer *)(*structInitializers).last)->exp);
14806 exp->expType = ProcessTypeString(templateString, 0x0);
14808 exp->list = MkListOne(MkExpCast(MkTypeName(MkListOne(MkSpecifierName(templateString)), (((void *)0))), MkExpOp((((void *)0)), '&', expExt = MkExpExtensionInitializer(MkTypeName(MkListOne(MkSpecifierName("BuiltInContainer")), (((void *)0))), MkInitializerList(structInitializers)))));
14809 ProcessExpressionType(expExt);
14813 exp->expType = ProcessTypeString("Container", 0x0);
14814 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
14819 if(exp->expType && exp->expType->kind == 21 && thisClass && (!exp->destType || exp->destType->kind != 21))
14821 FreeType(exp->expType);
14822 exp->expType = ReplaceThisClassType(thisClass);
14824 if(exp->expType && (exp->expType->kind == 9 || exp->expType->kind == 10 || exp->expType->kind == 15) && !exp->expType->members.first && exp->expType->enumName)
14826 struct Symbol * symbol = FindSymbol(exp->expType->enumName, curContext, globalContext, 0x1, 0x0);
14830 if(exp->expType->kind != 15)
14832 struct Type * member;
14833 char * enumName = __ecereNameSpace__ecere__sys__CopyString(exp->expType->enumName);
14835 FreeType(exp->expType);
14836 exp->expType = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
14837 exp->expType->kind = symbol->type->kind;
14838 exp->expType->refCount++;
14839 exp->expType->enumName = enumName;
14840 exp->expType->members = symbol->type->members;
14841 for(member = symbol->type->members.first; member; member = member->next)
14842 member->refCount++;
14846 struct __ecereNameSpace__ecere__sys__NamedLink * member;
14848 for(member = symbol->type->members.first; member; member = member->next)
14850 struct __ecereNameSpace__ecere__sys__NamedLink * value = (value = __ecereNameSpace__ecere__com__eSystem_New0(structSize_NamedLink), value->name = __ecereNameSpace__ecere__sys__CopyString(member->name), value);
14852 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->members, value);
14858 if(exp->destType && (exp->destType->kind == 0 || exp->destType->kind == 18))
14860 else if(exp->destType && !exp->destType->keepCast)
14862 if(!CheckExpressionType(exp, exp->destType, 0x0))
14864 if(!exp->destType->count || unresolved)
14869 if(exp->destType->kind != 14)
14876 char expString[10240];
14878 expString[0] = '\0';
14879 PrintType(exp->destType, type2, 0x0, 0x1);
14882 PrintExpression(exp, expString);
14883 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14886 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s; expected %s\n", (((void *)0))), expString, type2);
14887 else if(exp->type != 16)
14888 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s; expected %s\n", (((void *)0))), expString, type2);
14893 char expString[10240];
14895 expString[0] = '\0';
14898 PrintExpression(exp, expString);
14899 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14902 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), expString);
14903 else if(exp->type != 16)
14904 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14916 PrintType(exp->expType, type1, 0x0, 0x1);
14917 PrintType(exp->destType, type2, 0x0, 0x1);
14919 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)))
14923 char expString[10240];
14925 expString[0] = '\0';
14928 PrintExpression(exp, expString);
14929 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14931 if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
14932 Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
14933 FreeType(exp->expType);
14934 exp->destType->refCount++;
14935 exp->expType = exp->destType;
14940 else if(exp->destType && exp->destType->kind == 14 && exp->expType && exp->expType->passAsTemplate)
14942 struct Expression * newExp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Expression);
14943 char typeString[1024];
14944 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
14945 struct Declarator * decl;
14947 typeString[0] = '\0';
14950 exp->expType->refCount++;
14952 exp->expType->refCount++;
14954 newExp->destType = exp->expType;
14955 PrintType(exp->expType, typeString, 0x0, 0x0);
14956 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
14957 exp->cast.typeName = MkTypeName(specs, decl);
14958 exp->cast.exp = newExp;
14961 else if(unresolved)
14963 if(exp->identifier->_class && exp->identifier->_class->name)
14964 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s::%s\n", (((void *)0))), exp->identifier->_class->name, exp->identifier->string);
14965 else if(exp->identifier->string && exp->identifier->string[0])
14966 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "unresolved identifier %s\n", (((void *)0))), exp->identifier->string);
14968 else if(!exp->expType && exp->type != 16)
14970 char expString[10240];
14972 expString[0] = '\0';
14975 PrintExpression(exp, expString);
14976 __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
14978 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
14980 ApplyAnyObjectLogic(exp);
14981 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5)
14983 exp->byReference = 0x1;
14985 yylloc = oldyylloc;
14988 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)
14992 *curMember = (*curMember)->next;
14993 if(subMemberStackPos && *subMemberStackPos > 0 && subMemberStack[*subMemberStackPos - 1]->type == 1)
14995 *curMember = subMemberStack[--(*subMemberStackPos)];
14996 *curMember = (*curMember)->next;
14998 while((*curMember) && (*curMember)->isProperty)
14999 *curMember = (*curMember)->next;
15000 if(subMemberStackPos)
15002 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15004 subMemberStack[(*subMemberStackPos)++] = *curMember;
15005 *curMember = (*curMember)->members.first;
15006 while(*curMember && (*curMember)->isProperty)
15007 *curMember = (*curMember)->next;
15015 if(subMemberStackPos && *subMemberStackPos)
15017 *curMember = subMemberStack[--(*subMemberStackPos)];
15018 *curMember = (*curMember)->next;
15022 struct __ecereNameSpace__ecere__com__Class * lastCurClass = *curClass;
15024 if(*curClass == _class)
15026 for(*curClass = _class; (*curClass)->base != lastCurClass && (*curClass)->base->type != 1000; *curClass = (*curClass)->base)
15028 *curMember = (*curClass)->membersAndProperties.first;
15030 while((*curMember) && (*curMember)->isProperty)
15031 *curMember = (*curMember)->next;
15032 if(subMemberStackPos)
15034 while((*curMember) && !(*curMember)->isProperty && !(*curMember)->name && ((*curMember)->type == 2 || (*curMember)->type == 1))
15036 subMemberStack[(*subMemberStackPos)++] = *curMember;
15037 *curMember = (*curMember)->members.first;
15038 while(*curMember && (*curMember)->isProperty)
15039 *curMember = (*curMember)->next;
15046 static void ProcessInitializer(struct Initializer * init, struct Type * type)
15051 if(!init->exp || init->exp->type != 1 || !init->exp->instance || init->exp->instance->_class || !type || type->kind == 8)
15053 if(init->exp && !init->exp->destType)
15055 FreeType(init->exp->destType);
15056 init->exp->destType = type;
15062 ProcessExpressionType(init->exp);
15063 init->isConstant = init->exp->isConstant;
15069 struct Expression * exp = init->exp;
15070 struct Instantiation * inst = exp->instance;
15071 struct MembersInit * members;
15074 init->list = MkList();
15077 for(members = (*inst->members).first; members; members = members->next)
15079 if(members->type == 0)
15081 struct MemberInit * member;
15083 for(member = (*members->dataMembers).first; member; member = member->next)
15085 ListAdd(init->list, member->initializer);
15086 member->initializer = (((void *)0));
15091 FreeExpression(exp);
15095 struct Initializer * i;
15096 struct Type * initializerType = (((void *)0));
15097 struct __ecereNameSpace__ecere__com__Class * curClass = (((void *)0));
15098 struct __ecereNameSpace__ecere__com__DataMember * curMember = (((void *)0));
15099 struct __ecereNameSpace__ecere__com__DataMember * subMemberStack[256];
15100 int subMemberStackPos = 0;
15102 if(type && type->kind == 12)
15103 initializerType = Dereference(type);
15104 else if(type && (type->kind == 9 || type->kind == 10))
15105 initializerType = type->members.first;
15106 for(i = (*init->list).first; i; i = i->next)
15108 if(type && type->kind == 8 && type->_class && type->_class->registered)
15110 FindNextDataMember(type->_class->registered, &curClass, &curMember, subMemberStack, &subMemberStackPos);
15113 if(!curMember->dataType)
15114 curMember->dataType = ProcessTypeString(curMember->dataTypeString, 0x0);
15115 initializerType = curMember->dataType;
15118 ProcessInitializer(i, initializerType);
15119 if(initializerType && type && (type->kind == 9 || type->kind == 10))
15120 initializerType = initializerType->next;
15122 init->isConstant = 0x0;
15124 if(type && type->kind == 12)
15125 FreeType(initializerType);
15126 if(type && type->kind != 12 && type->kind != 9 && type->kind != 10 && (type->kind != 8 || !type->_class->registered || type->_class->registered->type != 1))
15128 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Assigning list initializer to non list\n", (((void *)0))));
15135 extern struct Symbol * FindType(struct Context * ctx, char * name);
15137 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol);
15139 static void ProcessSpecifier(struct Specifier * spec, unsigned int declareStruct)
15145 if(spec->specifier == THISCLASS)
15150 spec->name = ReplaceThisClass(thisClass);
15151 spec->symbol = FindClass(spec->name);
15152 ProcessSpecifier(spec, declareStruct);
15159 struct Symbol * symbol = FindType(curContext, spec->name);
15162 DeclareType(symbol->type, 0x1, 0x1);
15163 else if((symbol = spec->symbol) && symbol->registered && symbol->registered->type == 1 && declareStruct)
15164 DeclareStruct(spec->name, 0x0);
15169 struct Enumerator * e;
15173 for(e = (*spec->list).first; e; e = e->next)
15176 ProcessExpressionType(e->exp);
15184 if(spec->definitions)
15186 struct ClassDef * def;
15187 struct Symbol * symbol = spec->id ? FindClass(spec->id->string) : (((void *)0));
15189 ProcessClass(spec->definitions, symbol);
15196 static void ProcessDeclarator(struct Declarator * decl)
15201 if(decl->identifier->classSym)
15203 FreeSpecifier(decl->identifier->_class);
15204 decl->identifier->_class = (((void *)0));
15208 if(decl->array.exp)
15209 ProcessExpressionType(decl->array.exp);
15216 if(decl->declarator)
15217 ProcessDeclarator(decl->declarator);
15218 if(decl->type == 4)
15220 struct Identifier * id = GetDeclId(decl);
15222 if(id && id->_class)
15224 struct TypeName * param = (param = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName), param->qualifiers = MkListOne(id->_class), param->declarator = (((void *)0)), param);
15226 if(!decl->function.parameters)
15227 decl->function.parameters = MkList();
15228 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), (((void *)0)), param);
15229 id->_class = (((void *)0));
15231 if(decl->function.parameters)
15233 struct TypeName * param;
15235 for(param = (*decl->function.parameters).first; param; param = param->next)
15237 if(param->qualifiers && (*param->qualifiers).first)
15239 struct Specifier * spec = (*param->qualifiers).first;
15241 if(spec && spec->specifier == TYPED_OBJECT)
15243 struct Declarator * d = param->declarator;
15244 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);
15246 FreeList(param->qualifiers, FreeSpecifier);
15247 param->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0))));
15248 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class")));
15249 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*decl->function.parameters), param, newParam);
15252 else if(spec && spec->specifier == ANY_OBJECT)
15254 struct Declarator * d = param->declarator;
15256 FreeList(param->qualifiers, FreeSpecifier);
15257 param->qualifiers = MkListOne(MkSpecifier(VOID));
15258 param->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), d);
15260 else if(spec->specifier == THISCLASS)
15265 spec->name = ReplaceThisClass(thisClass);
15266 spec->symbol = FindClass(spec->name);
15267 ProcessSpecifier(spec, 0x0);
15271 if(param->declarator)
15272 ProcessDeclarator(param->declarator);
15280 extern struct Identifier * CopyIdentifier(struct Identifier * id);
15282 extern void FreeInitDeclarator(struct InitDeclarator * decl);
15284 static void ProcessDeclaration(struct Declaration * decl)
15286 yylloc = decl->loc;
15291 unsigned int declareStruct = 0x0;
15293 if(decl->declarators)
15295 struct InitDeclarator * d;
15297 for(d = (*decl->declarators).first; d; d = d->next)
15299 struct Type * type, * subType;
15301 ProcessDeclarator(d->declarator);
15302 type = ProcessType(decl->specifiers, d->declarator);
15305 ProcessInitializer(d->initializer, type);
15306 if((*decl->declarators).count == 1 && d->initializer->type == 0 && d->initializer->exp->type == 1)
15308 if(type->kind == 8 && type->_class == d->initializer->exp->expType->_class)
15310 struct Instantiation * inst = d->initializer->exp->instance;
15312 inst->exp = MkExpIdentifier(CopyIdentifier(GetDeclId(d->declarator)));
15313 d->initializer->exp->instance = (((void *)0));
15314 if(decl->specifiers)
15315 FreeList(decl->specifiers, FreeSpecifier);
15316 FreeList(decl->declarators, FreeInitDeclarator);
15323 for(subType = type; subType; )
15325 if(subType->kind == 8)
15327 declareStruct = 0x1;
15330 else if(subType->kind == 13)
15332 else if(subType->kind == 12)
15333 subType = subType->arrayType;
15342 if(decl->specifiers)
15344 struct Specifier * s;
15346 for(s = (*decl->specifiers).first; s; s = s->next)
15348 ProcessSpecifier(s, declareStruct);
15355 ProcessInstantiationType(decl->inst);
15360 struct Specifier * spec;
15361 struct Declarator * d;
15362 unsigned int declareStruct = 0x0;
15364 if(decl->declarators)
15366 for(d = (*decl->declarators).first; d; d = d->next)
15368 struct Type * type = ProcessType(decl->specifiers, d->declarator);
15369 struct Type * subType;
15371 ProcessDeclarator(d);
15372 for(subType = type; subType; )
15374 if(subType->kind == 8)
15376 declareStruct = 0x1;
15379 else if(subType->kind == 13)
15381 else if(subType->kind == 12)
15382 subType = subType->arrayType;
15389 if(decl->specifiers)
15391 for(spec = (*decl->specifiers).first; spec; spec = spec->next)
15392 ProcessSpecifier(spec, declareStruct);
15399 static struct FunctionDefinition * curFunction;
15401 static void CreateFireWatcher(struct __ecereNameSpace__ecere__com__Property * prop, struct Expression * object, struct Statement * stmt)
15403 char propName[1024], propNameM[1024];
15404 char getName[1024], setName[1024];
15405 struct __ecereNameSpace__ecere__sys__OldList * args;
15407 DeclareProperty(prop, setName, getName);
15408 strcpy(propName, "__ecereProp_");
15409 FullClassNameCat(propName, prop->_class->fullName, 0x0);
15410 strcat(propName, "_");
15411 FullClassNameCat(propName, prop->name, 0x1);
15412 MangleClassName(propName);
15413 strcpy(propNameM, "__ecerePropM_");
15414 FullClassNameCat(propNameM, prop->_class->fullName, 0x0);
15415 strcat(propNameM, "_");
15416 FullClassNameCat(propNameM, prop->name, 0x1);
15417 MangleClassName(propNameM);
15418 if(prop->isWatchable)
15421 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15422 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15423 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15425 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15426 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15427 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireWatchers")), args));
15431 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15432 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
15433 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15435 ListAdd(args, object ? CopyExpression(object) : MkExpIdentifier(MkIdentifier("this")));
15436 ListAdd(args, MkExpIdentifier(MkIdentifier(propNameM)));
15437 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_FireSelfWatchers")), args));
15439 if(curFunction->propSet && !strcmp(curFunction->propSet->string, prop->name) && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
15440 curFunction->propSet->fireWatchersDone = 0x1;
15443 extern struct Declaration * MkDeclarationInst(struct Instantiation * inst);
15445 extern struct Instantiation * MkInstantiationNamed(struct __ecereNameSpace__ecere__sys__OldList * specs, struct Expression * exp, struct __ecereNameSpace__ecere__sys__OldList * members);
15447 extern struct Statement * MkIfStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement, struct Statement * elseStmt);
15449 extern struct Statement * MkForStmt(struct Statement * init, struct Statement * check, struct __ecereNameSpace__ecere__sys__OldList * inc, struct Statement * statement);
15451 extern struct Statement * MkWhileStmt(struct __ecereNameSpace__ecere__sys__OldList * exp, struct Statement * statement);
15453 extern struct ClassFunction * MkClassFunction(struct __ecereNameSpace__ecere__sys__OldList * specifiers, struct Specifier * _class, struct Declarator * decl, struct __ecereNameSpace__ecere__sys__OldList * declList);
15455 extern void ProcessClassFunctionBody(struct ClassFunction * func, struct Statement * body);
15457 extern void FreePropertyWatch(struct PropertyWatch * watcher);
15459 static void ProcessStatement(struct Statement * stmt)
15461 yylloc = stmt->loc;
15465 ProcessStatement(stmt->labeled.stmt);
15468 if(stmt->caseStmt.exp)
15470 FreeType(stmt->caseStmt.exp->destType);
15471 stmt->caseStmt.exp->destType = curSwitchType;
15473 curSwitchType->refCount++;
15474 ProcessExpressionType(stmt->caseStmt.exp);
15475 ComputeExpression(stmt->caseStmt.exp);
15477 if(stmt->caseStmt.stmt)
15478 ProcessStatement(stmt->caseStmt.stmt);
15482 if(stmt->compound.context)
15484 struct Declaration * decl;
15485 struct Statement * s;
15486 struct Statement * prevCompound = curCompound;
15487 struct Context * prevContext = curContext;
15489 if(!stmt->compound.isSwitch)
15491 curCompound = stmt;
15492 curContext = stmt->compound.context;
15494 if(stmt->compound.declarations)
15496 for(decl = (*stmt->compound.declarations).first; decl; decl = decl->next)
15497 ProcessDeclaration(decl);
15499 if(stmt->compound.statements)
15501 for(s = (*stmt->compound.statements).first; s; s = s->next)
15502 ProcessStatement(s);
15504 curContext = prevContext;
15505 curCompound = prevCompound;
15511 struct Expression * exp;
15513 if(stmt->expressions)
15515 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15516 ProcessExpressionType(exp);
15522 struct Expression * exp;
15524 FreeType(((struct Expression *)(*stmt->ifStmt.exp).last)->destType);
15525 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType = MkClassType("bool");
15526 ((struct Expression *)(*stmt->ifStmt.exp).last)->destType->truth = 0x1;
15527 for(exp = (*stmt->ifStmt.exp).first; exp; exp = exp->next)
15529 ProcessExpressionType(exp);
15531 if(stmt->ifStmt.stmt)
15532 ProcessStatement(stmt->ifStmt.stmt);
15533 if(stmt->ifStmt.elseStmt)
15534 ProcessStatement(stmt->ifStmt.elseStmt);
15539 struct Type * oldSwitchType = curSwitchType;
15541 if(stmt->switchStmt.exp)
15543 struct Expression * exp;
15545 for(exp = (*stmt->switchStmt.exp).first; exp; exp = exp->next)
15549 ProcessExpressionType(exp);
15552 curSwitchType = exp->expType;
15555 ProcessStatement(stmt->switchStmt.stmt);
15556 curSwitchType = oldSwitchType;
15561 if(stmt->whileStmt.exp)
15563 struct Expression * exp;
15565 FreeType(((struct Expression *)(*stmt->whileStmt.exp).last)->destType);
15566 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType = MkClassType("bool");
15567 ((struct Expression *)(*stmt->whileStmt.exp).last)->destType->truth = 0x1;
15568 for(exp = (*stmt->whileStmt.exp).first; exp; exp = exp->next)
15570 ProcessExpressionType(exp);
15573 if(stmt->whileStmt.stmt)
15574 ProcessStatement(stmt->whileStmt.stmt);
15579 if(stmt->doWhile.exp)
15581 struct Expression * exp;
15583 if((*stmt->doWhile.exp).last)
15585 FreeType(((struct Expression *)(*stmt->doWhile.exp).last)->destType);
15586 ((struct Expression *)(*stmt->doWhile.exp).last)->destType = MkClassType("bool");
15587 ((struct Expression *)(*stmt->doWhile.exp).last)->destType->truth = 0x1;
15589 for(exp = (*stmt->doWhile.exp).first; exp; exp = exp->next)
15591 ProcessExpressionType(exp);
15594 if(stmt->doWhile.stmt)
15595 ProcessStatement(stmt->doWhile.stmt);
15600 struct Expression * exp;
15602 if(stmt->forStmt.init)
15603 ProcessStatement(stmt->forStmt.init);
15604 if(stmt->forStmt.check && stmt->forStmt.check->expressions)
15606 FreeType(((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType);
15607 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType = MkClassType("bool");
15608 ((struct Expression *)(*stmt->forStmt.check->expressions).last)->destType->truth = 0x1;
15610 if(stmt->forStmt.check)
15611 ProcessStatement(stmt->forStmt.check);
15612 if(stmt->forStmt.increment)
15614 for(exp = (*stmt->forStmt.increment).first; exp; exp = exp->next)
15615 ProcessExpressionType(exp);
15617 if(stmt->forStmt.stmt)
15618 ProcessStatement(stmt->forStmt.stmt);
15623 struct Identifier * id = stmt->forEachStmt.id;
15624 struct __ecereNameSpace__ecere__sys__OldList * exp = stmt->forEachStmt.exp;
15625 struct __ecereNameSpace__ecere__sys__OldList * filter = stmt->forEachStmt.filter;
15626 struct Statement * block = stmt->forEachStmt.stmt;
15627 char iteratorType[1024];
15628 struct Type * source;
15629 struct Expression * e;
15630 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));
15631 struct Expression * arrayExp;
15632 char * typeString = (((void *)0));
15633 int builtinCount = 0;
15635 for(e = exp ? (*exp).first : (((void *)0)); e; e = e->next)
15639 FreeType(e->destType);
15640 e->destType = ProcessTypeString("Container", 0x0);
15642 if(!isBuiltin || e->next)
15643 ProcessExpressionType(e);
15645 source = (exp && (*exp).last) ? ((struct Expression *)(*exp).last)->expType : (((void *)0));
15646 if(isBuiltin || (source && source->kind == 8 && source->_class && source->_class->registered && source->_class->registered != containerClass && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, containerClass)))
15648 struct __ecereNameSpace__ecere__com__Class * _class = source ? source->_class->registered : (((void *)0));
15649 struct Symbol * symbol;
15650 struct Expression * expIt = (((void *)0));
15651 unsigned int isMap = 0x0, isArray = 0x0, isLinkList = 0x0, isList = 0x0, isCustomAVLTree = 0x0, isAVLTree = 0x0;
15652 struct __ecereNameSpace__ecere__com__Class * arrayClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Array");
15653 struct __ecereNameSpace__ecere__com__Class * linkListClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "LinkList");
15654 struct __ecereNameSpace__ecere__com__Class * customAVLTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "CustomAVLTree");
15657 stmt->compound.context = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context);
15658 stmt->compound.context->parent = curContext;
15659 curContext = stmt->compound.context;
15660 if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, customAVLTreeClass))
15662 struct __ecereNameSpace__ecere__com__Class * mapClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "Map");
15663 struct __ecereNameSpace__ecere__com__Class * avlTreeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "AVLTree");
15665 isCustomAVLTree = 0x1;
15666 if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, avlTreeClass))
15668 else if(__ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, mapClass))
15671 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, arrayClass))
15673 else if(source && __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, linkListClass))
15675 struct __ecereNameSpace__ecere__com__Class * listClass = __ecereNameSpace__ecere__com__eSystem_FindClass(privateModule, "List");
15678 isList = __ecereNameSpace__ecere__com__eClass_IsDerived(source->_class->registered, listClass);
15682 struct Declarator * decl;
15683 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15685 decl = SpecDeclFromString(_class->templateArgs[2].dataTypeString, specs, MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(id)));
15686 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15687 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalArray")), MkInitializerAssignment(MkExpBrackets(exp))))));
15691 struct Type * type = (((void *)0));
15692 char typeStringBuf[1024];
15694 arrayExp = (((struct Expression *)(*exp).last)->type == 37) ? (struct Expression *)(*exp).last : ((struct Expression *)(*exp).last)->cast.exp;
15695 if(((struct Expression *)(*exp).last)->type == 11)
15697 struct TypeName * typeName = ((struct Expression *)(*exp).last)->cast.typeName;
15700 arrayExp->destType = ProcessType(typeName->qualifiers, typeName->declarator);
15702 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)
15704 struct __ecereNameSpace__ecere__com__Class * templateClass = arrayExp->destType->_class->registered;
15706 typeString = templateClass->templateArgs[2].dataTypeString;
15708 else if(arrayExp->list)
15710 struct Expression * e;
15712 for(e = (*arrayExp->list).first; e; e = e->next)
15714 ProcessExpressionType(e);
15724 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15728 e->expType = (((void *)0));
15729 e = (*arrayExp->list).first;
15730 ProcessExpressionType(e);
15733 if(!MatchTypeExpression(e, type, (((void *)0)), 0x0))
15735 FreeType(e->expType);
15736 e->expType = (((void *)0));
15738 type = (((void *)0));
15746 FreeType(e->expType);
15747 e->expType = (((void *)0));
15753 typeStringBuf[0] = '\0';
15754 PrintType(type, typeStringBuf, 0x0, 0x1);
15755 typeString = typeStringBuf;
15761 struct __ecereNameSpace__ecere__sys__OldList * initializers = MkList();
15762 struct Declarator * decl;
15763 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15767 struct Expression * e;
15769 builtinCount = (*arrayExp->list).count;
15770 type = ProcessTypeString(typeString, 0x0);
15771 while(e = (*arrayExp->list).first)
15773 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*arrayExp->list), e);
15774 e->destType = type;
15776 ProcessExpressionType(e);
15777 ListAdd(initializers, MkInitializerAssignment(e));
15780 (__ecereNameSpace__ecere__com__eSystem_Delete(arrayExp->list), arrayExp->list = 0);
15782 decl = SpecDeclFromString(typeString, specs, MkDeclaratorIdentifier(id));
15783 stmt->compound.declarations = MkListOne(MkDeclaration(CopyList(specs, CopySpecifier), MkListOne(MkInitDeclarator(MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), decl), (((void *)0))))));
15784 ListAdd(stmt->compound.declarations, MkDeclaration(specs, MkListOne(MkInitDeclarator(MkDeclaratorArray(PlugDeclarator(decl, MkDeclaratorIdentifier(MkIdentifier("__internalArray"))), (((void *)0))), MkInitializerList(initializers)))));
15785 FreeList(exp, FreeExpression);
15789 arrayExp->expType = ProcessTypeString("Container", 0x0);
15790 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Couldn't determine type of array elements\n", (((void *)0))));
15793 else if(isLinkList && !isList)
15795 struct Declarator * decl;
15796 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15798 decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, MkDeclaratorIdentifier(id));
15799 stmt->compound.declarations = MkListOne(MkDeclaration(specs, MkListOne(MkInitDeclarator(decl, (((void *)0))))));
15800 ListAdd(stmt->compound.declarations, MkDeclaration(MkListOne(MkSpecifierName(source->_class->registered->fullName)), MkListOne(MkInitDeclarator(MkDeclaratorIdentifier(MkIdentifier("__internalLinkList")), MkInitializerAssignment(MkExpBrackets(exp))))));
15802 else if(_class->templateArgs)
15805 sprintf(iteratorType, "MapIterator<%s, %s >", _class->templateArgs[5].dataTypeString, _class->templateArgs[6].dataTypeString);
15807 sprintf(iteratorType, "Iterator<%s, %s >", _class->templateArgs[2].dataTypeString, _class->templateArgs[1].dataTypeString);
15808 stmt->compound.declarations = MkListOne(MkDeclarationInst(MkInstantiationNamed(MkListOne(MkSpecifierName(iteratorType)), MkExpIdentifier(id), MkListOne(MkMembersInitList(MkListOne(MkMemberInit(isMap ? MkListOne(MkIdentifier("map")) : (((void *)0)), MkInitializerAssignment(MkExpBrackets(exp)))))))));
15810 symbol = FindSymbol(id->string, curContext, curContext, 0x0, 0x0);
15811 if(block && block->type == 2 && block->compound.context)
15813 block->compound.context->parent = stmt->compound.context;
15817 block = MkIfStmt(filter, block, (((void *)0)));
15821 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));
15822 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15823 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15824 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15830 sprintf(count, "%d", builtinCount);
15831 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));
15832 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15833 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15834 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15836 else if(isLinkList && !isList)
15838 struct __ecereNameSpace__ecere__com__Class * typeClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, _class->templateArgs[3].dataTypeString);
15839 struct __ecereNameSpace__ecere__com__Class * listItemClass = __ecereNameSpace__ecere__com__eSystem_FindClass(_class->module, "ListItem");
15841 if(typeClass && __ecereNameSpace__ecere__com__eClass_IsDerived(typeClass, listItemClass) && _class->templateArgs[5].dataTypeString && !strcmp(_class->templateArgs[5].dataTypeString, "LT::link"))
15843 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));
15847 struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();
15848 struct Declarator * decl = SpecDeclFromString(_class->templateArgs[3].dataTypeString, specs, (((void *)0)));
15850 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));
15852 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.init);
15853 ProcessStatement(((struct Statement *)(*stmt->compound.statements).first)->forStmt.check);
15854 ProcessExpressionType((*((struct Statement *)(*stmt->compound.statements).first)->forStmt.increment).first);
15858 stmt->compound.statements = MkListOne(MkWhileStmt(MkListOne(MkExpCall(MkExpMember(expIt = MkExpIdentifier(CopyIdentifier(id)), MkIdentifier("Next")), (((void *)0)))), block));
15860 ProcessExpressionType(expIt);
15861 if((*stmt->compound.declarations).first)
15862 ProcessDeclaration((*stmt->compound.declarations).first);
15864 symbol->isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
15865 ProcessStatement(stmt);
15866 curContext = stmt->compound.context->parent;
15871 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Expression is not a container\n", (((void *)0))));
15883 struct Expression * exp;
15885 if(stmt->expressions)
15887 for(exp = (*stmt->expressions).first; exp; exp = exp->next)
15891 if(curFunction && !curFunction->type)
15892 curFunction->type = ProcessType(curFunction->specifiers, curFunction->declarator);
15893 FreeType(exp->destType);
15894 exp->destType = (curFunction && curFunction->type && curFunction->type->kind == 11) ? curFunction->type->returnType : (((void *)0));
15896 exp->destType->refCount++;
15898 ProcessExpressionType(exp);
15905 ProcessDeclaration(stmt->decl);
15910 struct AsmField * field;
15912 if(stmt->asmStmt.inputFields)
15914 for(field = (*stmt->asmStmt.inputFields).first; field; field = field->next)
15915 if(field->expression)
15916 ProcessExpressionType(field->expression);
15918 if(stmt->asmStmt.outputFields)
15920 for(field = (*stmt->asmStmt.outputFields).first; field; field = field->next)
15921 if(field->expression)
15922 ProcessExpressionType(field->expression);
15924 if(stmt->asmStmt.clobberedFields)
15926 for(field = (*stmt->asmStmt.clobberedFields).first; field; field = field->next)
15928 if(field->expression)
15929 ProcessExpressionType(field->expression);
15936 struct PropertyWatch * propWatch;
15937 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
15938 struct Expression * object = stmt->_watch.object;
15939 struct Expression * watcher = stmt->_watch.watcher;
15942 ProcessExpressionType(watcher);
15944 ProcessExpressionType(object);
15947 if(watcher || thisClass)
15949 struct External * external = curExternal;
15950 struct Context * context = curContext;
15953 stmt->expressions = MkList();
15954 curExternal = external->prev;
15955 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
15957 struct ClassFunction * func;
15958 char watcherName[1024];
15959 struct __ecereNameSpace__ecere__com__Class * watcherClass = watcher ? ((watcher->expType && watcher->expType->kind == 8 && watcher->expType->_class) ? watcher->expType->_class->registered : (((void *)0))) : thisClass;
15960 struct External * createdExternal;
15961 struct External * externalDecl = MkExternalDeclaration((((void *)0)));
15963 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), curExternal->prev, externalDecl);
15964 sprintf(watcherName, "__ecerePropertyWatcher_%d", propWatcherID++);
15965 if(propWatch->deleteWatch)
15966 strcat(watcherName, "_delete");
15969 struct Identifier * propID;
15971 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
15973 strcat(watcherName, "_");
15974 strcat(watcherName, propID->string);
15977 if(object && object->expType && object->expType->kind == 8 && object->expType->_class && object->expType->_class->registered)
15979 func = MkClassFunction(MkListOne(MkSpecifier(VOID)), (((void *)0)), MkDeclaratorFunction(MkDeclaratorIdentifier(MkIdentifier(watcherName)), MkListOne(MkTypeName(MkListOne(MkSpecifierName(object->expType->_class->string)), MkDeclaratorIdentifier(MkIdentifier("value"))))), (((void *)0)));
15980 ProcessClassFunctionBody(func, propWatch->compound);
15981 propWatch->compound = (((void *)0));
15982 createdExternal = ProcessClassFunction(watcherClass, func, ast, curExternal, 0x1);
15983 createdExternal->symbol->idCode = external->symbol->idCode;
15984 curExternal = createdExternal;
15985 ProcessFunction(createdExternal->function);
15987 struct Declaration * decl = MkDeclaration(CopyList(createdExternal->function->specifiers, CopySpecifier), MkListOne(MkInitDeclarator(CopyDeclarator(createdExternal->function->declarator), (((void *)0)))));
15989 externalDecl->declaration = decl;
15990 if(decl->symbol && !decl->symbol->pointerExternal)
15991 decl->symbol->pointerExternal = externalDecl;
15993 if(propWatch->deleteWatch)
15995 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
15997 ListAdd(args, CopyExpression(object));
15998 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
15999 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16000 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_WatchDestruction")), args));
16004 struct __ecereNameSpace__ecere__com__Class * _class = object->expType->_class->registered;
16005 struct Identifier * propID;
16007 for(propID = (*propWatch->properties).first; propID; propID = propID->next)
16009 char propName[1024];
16010 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16014 char getName[1024], setName[1024];
16015 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16017 DeclareProperty(prop, setName, getName);
16018 strcpy(propName, "__ecereProp_");
16019 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16020 strcat(propName, "_");
16021 FullClassNameCat(propName, prop->name, 0x1);
16022 ListAdd(args, CopyExpression(object));
16023 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16024 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16025 ListAdd(args, MkExpIdentifier(MkIdentifier(watcherName)));
16026 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_Watch")), args));
16029 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16034 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid watched object\n", (((void *)0))));
16036 curExternal = external;
16037 curContext = context;
16039 FreeExpression(watcher);
16041 FreeExpression(object);
16042 FreeList(watches, FreePropertyWatch);
16045 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a _class\n", (((void *)0))));
16049 for(propWatch = (*watches).first; propWatch; propWatch = propWatch->next)
16051 ProcessStatement(propWatch->compound);
16058 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16059 struct Expression * object = stmt->_watch.object;
16060 struct __ecereNameSpace__ecere__com__Class * _class;
16063 ProcessExpressionType(object);
16066 _class = object ? ((object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0))) : thisClass;
16069 struct Identifier * propID;
16072 stmt->expressions = MkList();
16073 if(!watches && curFunction->propSet && (!object || (object->type == 0 && !strcmp(object->identifier->string, "this"))))
16075 watches = MkListOne(MkIdentifier(curFunction->propSet->string));
16082 for(propID = (*watches).first; propID; propID = propID->next)
16084 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16088 CreateFireWatcher(prop, object, stmt);
16091 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), propID->string, _class->fullName);
16096 struct __ecereNameSpace__ecere__com__Property * prop;
16097 struct __ecereNameSpace__ecere__com__Class * base;
16099 for(base = _class; base; base = base->base)
16101 for(prop = base->membersAndProperties.first; prop; prop = prop->next)
16103 if(prop->isProperty && prop->isWatchable)
16105 CreateFireWatcher(prop, object, stmt);
16111 FreeExpression(object);
16112 FreeList(watches, FreeIdentifier);
16115 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16121 struct __ecereNameSpace__ecere__sys__OldList * watches = stmt->_watch.watches;
16122 struct Expression * object = stmt->_watch.object;
16123 struct Expression * watcher = stmt->_watch.watcher;
16124 struct __ecereNameSpace__ecere__com__Class * _class;
16127 ProcessExpressionType(object);
16129 ProcessExpressionType(watcher);
16132 _class = (object && object->expType && object->expType->kind == 8 && object->expType->_class) ? object->expType->_class->registered : (((void *)0));
16133 if(watcher || thisClass)
16137 struct Identifier * propID;
16140 stmt->expressions = MkList();
16143 struct __ecereNameSpace__ecere__sys__OldList * args;
16146 ListAdd(args, CopyExpression(object));
16147 ListAdd(args, MkExpConstant("0"));
16148 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16149 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16153 for(propID = (*watches).first; propID; propID = propID->next)
16155 char propName[1024];
16156 struct __ecereNameSpace__ecere__com__Property * prop = __ecereNameSpace__ecere__com__eClass_FindProperty(_class, propID->string, privateModule);
16160 char getName[1024], setName[1024];
16161 struct __ecereNameSpace__ecere__sys__OldList * args = MkList();
16163 DeclareProperty(prop, setName, getName);
16164 strcpy(propName, "__ecereProp_");
16165 FullClassNameCat(propName, prop->_class->fullName, 0x0);
16166 strcat(propName, "_");
16167 FullClassNameCat(propName, prop->name, 0x1);
16168 MangleClassName(propName);
16169 ListAdd(args, CopyExpression(object));
16170 ListAdd(args, MkExpIdentifier(MkIdentifier(propName)));
16171 ListAdd(args, watcher ? CopyExpression(watcher) : MkExpIdentifier(MkIdentifier("this")));
16172 ListAdd(stmt->expressions, MkExpCall(MkExpIdentifier(MkIdentifier("ecere::com::eInstance_StopWatching")), args));
16175 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Property %s not found in class %s\n", (((void *)0))), prop->name, _class->fullName);
16179 FreeExpression(object);
16181 FreeExpression(watcher);
16182 FreeList(watches, FreeIdentifier);
16185 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Invalid object specified and not inside a class\n", (((void *)0))));
16188 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "No observer specified and not inside a class\n", (((void *)0))));
16195 extern struct Expression * QBrackets(struct Expression * exp);
16197 extern struct TypeName * QMkType(char * spec, struct Declarator * decl);
16199 extern struct Declarator * QMkPtrDecl(char * id);
16201 extern struct Expression * MkExpPointer(struct Expression * expression, struct Identifier * member);
16203 extern struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp);
16205 extern struct Statement * MkFireWatchersStmt(struct Expression * object, struct __ecereNameSpace__ecere__sys__OldList * watches);
16207 static void ProcessFunction(struct FunctionDefinition * function)
16209 struct Identifier * id = GetDeclId(function->declarator);
16210 struct Symbol * symbol = function->declarator ? function->declarator->symbol : (((void *)0));
16211 struct Type * type = symbol ? symbol->type : (((void *)0));
16212 struct __ecereNameSpace__ecere__com__Class * oldThisClass = thisClass;
16213 struct Context * oldTopContext = topContext;
16215 yylloc = function->loc;
16216 if(type && type->thisClass)
16218 struct Symbol * classSym = type->thisClass;
16219 struct __ecereNameSpace__ecere__com__Class * _class = type->thisClass->registered;
16220 char className[1024];
16221 char structName[1024];
16222 struct Declarator * funcDecl;
16223 struct Symbol * thisSymbol;
16224 unsigned int typedObject = 0x0;
16226 if(_class && !_class->base)
16228 _class = currentClass;
16229 if(_class && !_class->symbol)
16230 _class->symbol = FindClass(_class->fullName);
16231 classSym = _class ? _class->symbol : (((void *)0));
16234 thisClass = _class;
16235 if(inCompiler && _class)
16237 if(type->kind == 11)
16239 if(symbol->type->params.count == 1 && ((struct Type *)symbol->type->params.first)->kind == 0)
16241 struct Type * param = symbol->type->params.first;
16243 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&symbol->type->params, param);
16246 if(type->classObjectType != 1)
16248 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert(&symbol->type->params, (((void *)0)), MkClassType(_class->fullName));
16249 symbol->type->staticMethod = 0x1;
16250 symbol->type->thisClass = (((void *)0));
16251 symbol->type->extraParam = 0x0;
16254 strcpy(className, "__ecereClass_");
16255 FullClassNameCat(className, _class->fullName, 0x1);
16256 MangleClassName(className);
16257 structName[0] = (char)0;
16258 FullClassNameCat(structName, _class->fullName, 0x0);
16259 funcDecl = GetFuncDecl(function->declarator);
16262 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16264 struct TypeName * param = (*funcDecl->function.parameters).first;
16266 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16268 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16269 FreeTypeName(param);
16272 if(!function->propertyNoThis)
16274 struct TypeName * thisParam;
16276 if(type->classObjectType != 1)
16278 thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16279 if(!funcDecl->function.parameters)
16280 funcDecl->function.parameters = MkList();
16281 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16285 if(type->classObjectType != 1)
16287 if(type->byReference || _class->type == 3 || _class->type == 1000 || _class->type == 4 || _class->type == 2)
16288 thisParam->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), thisParam->declarator);
16290 thisParam = __extension__ ({
16291 struct TypeName * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_TypeName);
16293 __ecereInstance1->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), MkDeclaratorIdentifier(MkIdentifier("class"))), __ecereInstance1->qualifiers = MkListOne(MkStructOrUnion(3, MkIdentifier("__ecereNameSpace__ecere__com__Class"), (((void *)0)))), __ecereInstance1;
16295 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16299 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16301 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16303 funcDecl = GetFuncDecl(initDecl->declarator);
16306 if(funcDecl->function.parameters && (*funcDecl->function.parameters).count == 1)
16308 struct TypeName * param = (*funcDecl->function.parameters).first;
16310 if(param->qualifiers && (*param->qualifiers).count == 1 && ((struct Specifier *)(*param->qualifiers).first)->specifier == VOID && !param->declarator)
16312 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*funcDecl->function.parameters), param);
16313 FreeTypeName(param);
16316 if(type->classObjectType != 1)
16318 if((_class->type != 2 && _class->type != 3 && _class->type != 4) || function != (struct FunctionDefinition *)symbol->externalSet)
16320 struct TypeName * thisParam = QMkClass(_class->fullName, MkDeclaratorIdentifier(MkIdentifier("this")));
16322 if(!funcDecl->function.parameters)
16323 funcDecl->function.parameters = MkList();
16324 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*funcDecl->function.parameters), (((void *)0)), thisParam);
16332 if(type->classObjectType != 1)
16334 thisSymbol = __extension__ ({
16335 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16337 __ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("this"), __ecereInstance1->type = classSym ? MkClassType(classSym->string) : (((void *)0)), __ecereInstance1;
16339 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&function->body->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16340 if(typedObject && thisSymbol->type)
16342 thisSymbol->type->classObjectType = 2;
16343 thisSymbol->type->byReference = type->byReference;
16347 if(inCompiler && _class && (_class->type == 0) && type->classObjectType != 1)
16349 struct __ecereNameSpace__ecere__com__DataMember * member = (((void *)0));
16352 struct __ecereNameSpace__ecere__com__Class * base;
16354 for(base = _class; base && base->type != 1000; base = base->next)
16356 for(member = base->membersAndProperties.first; member; member = member->next)
16357 if(!member->isProperty)
16363 for(member = _class->membersAndProperties.first; member; member = member->next)
16364 if(!member->isProperty)
16368 char pointerName[1024];
16369 struct Declaration * decl;
16370 struct Initializer * initializer;
16371 struct Expression * exp, * bytePtr;
16373 strcpy(pointerName, "__ecerePointer_");
16374 FullClassNameCat(pointerName, _class->fullName, 0x0);
16376 char className[1024];
16378 strcpy(className, "__ecereClass_");
16379 FullClassNameCat(className, classSym->string, 0x1);
16380 MangleClassName(className);
16381 DeclareClass(classSym, className);
16383 bytePtr = QBrackets(MkExpCast(QMkType("char", QMkPtrDecl((((void *)0)))), QMkExpId("this")));
16388 sprintf(string, "%d", _class->offset);
16389 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpConstant(string)));
16393 exp = QBrackets(MkExpOp(bytePtr, '+', MkExpPointer(QMkExpId(className), MkIdentifier("offset"))));
16395 exp = QBrackets(QMkExpCond(QMkExpId("this"), exp, MkExpConstant("0")));
16396 exp->expType = __extension__ ({
16397 struct Type * __ecereInstance2 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16399 __ecereInstance2->refCount = 1, __ecereInstance2->kind = 13, __ecereInstance2->type = __extension__ ({
16400 struct Type * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Type);
16402 __ecereInstance1->refCount = 1, __ecereInstance1->kind = 0, __ecereInstance1;
16403 }), __ecereInstance2;
16407 yylloc = function->body->loc;
16408 initializer = MkInitializerAssignment(MkExpCast(MkTypeName(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), (((void *)0)))), exp));
16410 struct Context * prevContext = curContext;
16412 curContext = function->body->compound.context;
16413 decl = MkDeclaration(MkListOne(MkStructOrUnion(3, MkIdentifier(structName), (((void *)0)))), MkListOne(MkInitDeclarator(QMkPtrDecl(pointerName), initializer)));
16414 curContext = prevContext;
16416 decl->symbol = (((void *)0));
16417 if(!function->body->compound.declarations)
16418 function->body->compound.declarations = MkList();
16419 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*function->body->compound.declarations), (((void *)0)), decl);
16425 thisClass = (((void *)0));
16428 FreeSpecifier(id->_class);
16429 id->_class = (((void *)0));
16430 if(symbol && symbol->pointerExternal && symbol->pointerExternal->type == 1)
16432 struct InitDeclarator * initDecl = (*symbol->pointerExternal->declaration->declarators).first;
16434 id = GetDeclId(initDecl->declarator);
16435 FreeSpecifier(id->_class);
16436 id->_class = (((void *)0));
16440 topContext = function->body->compound.context;
16442 struct FunctionDefinition * oldFunction = curFunction;
16444 curFunction = function;
16446 ProcessStatement(function->body);
16447 if(inCompiler && function->propSet && !function->propSet->fireWatchersDone)
16449 struct Statement * prevCompound = curCompound;
16450 struct Context * prevContext = curContext;
16451 struct Statement * fireWatchers = MkFireWatchersStmt((((void *)0)), (((void *)0)));
16453 if(!function->body->compound.statements)
16454 function->body->compound.statements = MkList();
16455 ListAdd(function->body->compound.statements, fireWatchers);
16456 curCompound = function->body;
16457 curContext = function->body->compound.context;
16458 ProcessStatement(fireWatchers);
16459 curContext = prevContext;
16460 curCompound = prevCompound;
16462 curFunction = oldFunction;
16464 if(function->declarator)
16466 ProcessDeclarator(function->declarator);
16468 topContext = oldTopContext;
16469 thisClass = oldThisClass;
16472 extern void FreeSymbol(struct Symbol * symbol);
16474 void __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(struct __ecereNameSpace__ecere__sys__BinaryTree * this, struct __ecereNameSpace__ecere__sys__BTNode * node);
16476 static void ProcessClass(struct __ecereNameSpace__ecere__sys__OldList * definitions, struct Symbol * symbol)
16478 struct ClassDef * def;
16479 struct External * external = curExternal;
16480 struct __ecereNameSpace__ecere__com__Class * regClass = symbol ? symbol->registered : (((void *)0));
16482 for(def = definitions->first; def; def = def->next)
16486 if(def->function->declarator)
16487 curExternal = def->function->declarator->symbol->pointerExternal;
16489 curExternal = external;
16490 ProcessFunction((struct FunctionDefinition *)def->function);
16492 else if(def->type == 2)
16494 if(def->decl->type == 2)
16496 thisClass = regClass;
16497 ProcessInstantiationType(def->decl->inst);
16498 thisClass = (((void *)0));
16502 struct __ecereNameSpace__ecere__com__Class * backThisClass = thisClass;
16505 thisClass = regClass;
16506 ProcessDeclaration(def->decl);
16507 thisClass = backThisClass;
16510 else if(def->type == 1 && def->defProperties)
16512 struct MemberInit * defProperty;
16513 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);
16515 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16516 for(defProperty = (*def->defProperties).first; defProperty; defProperty = defProperty->next)
16518 thisClass = regClass;
16519 ProcessMemberInitData(defProperty, regClass, (((void *)0)), (((void *)0)), (((void *)0)), (((void *)0)));
16520 thisClass = (((void *)0));
16522 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Remove(&globalContext->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16523 FreeSymbol(thisSymbol);
16525 else if(def->type == 3 && def->propertyDef)
16527 struct PropertyDef * prop = def->propertyDef;
16529 thisClass = regClass;
16534 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16536 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->setStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16538 curExternal = prop->symbol ? prop->symbol->externalSet : (((void *)0));
16539 ProcessStatement(prop->setStmt);
16545 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16547 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->getStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16549 curExternal = prop->symbol ? prop->symbol->externalGet : (((void *)0));
16550 ProcessStatement(prop->getStmt);
16552 if(prop->issetStmt)
16556 struct Symbol * thisSymbol = (thisSymbol = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), thisSymbol->string = __ecereNameSpace__ecere__sys__CopyString("this"), thisSymbol->type = MkClassType(regClass->fullName), thisSymbol);
16558 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&prop->issetStmt->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16560 curExternal = prop->symbol ? prop->symbol->externalIsSet : (((void *)0));
16561 ProcessStatement(prop->issetStmt);
16563 thisClass = (((void *)0));
16565 else if(def->type == 4 && def->propertyWatch)
16567 struct PropertyWatch * propertyWatch = def->propertyWatch;
16569 thisClass = regClass;
16570 if(propertyWatch->compound)
16572 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);
16574 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&propertyWatch->compound->compound.context->symbols, (struct __ecereNameSpace__ecere__sys__BTNode *)thisSymbol);
16575 curExternal = (((void *)0));
16576 ProcessStatement(propertyWatch->compound);
16578 thisClass = (((void *)0));
16583 void DeclareFunctionUtil(char * s)
16585 struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
16592 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + structSize_Instance)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
16593 strcpy(name, "__ecereFunction_");
16594 FullClassNameCat(name, s, 0x0);
16595 DeclareFunction(function, name);
16599 extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
16601 void ComputeDataTypes()
16603 struct External * external;
16604 struct External * temp = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_External);
16605 struct External * after = (((void *)0));
16607 currentClass = (((void *)0));
16608 containerClass = __ecereNameSpace__ecere__com__eSystem_FindClass(GetPrivateModule(), "Container");
16609 for(external = (*ast).first; external; external = external->next)
16611 if(external->type == 1)
16613 struct Declaration * decl = external->declaration;
16617 struct __ecereNameSpace__ecere__sys__OldList * decls = decl->declarators;
16621 struct InitDeclarator * initDecl = (*decls).first;
16625 struct Declarator * declarator = initDecl->declarator;
16627 if(declarator && declarator->type == 1)
16629 struct Identifier * id = declarator->identifier;
16631 if(id && id->string)
16633 if(!strcmp(id->string, "uintptr_t") || !strcmp(id->string, "intptr_t") || !strcmp(id->string, "size_t") || !strcmp(id->string, "ssize_t"))
16635 external->symbol->id = -1001, external->symbol->idCode = -1001;
16645 temp->symbol = __extension__ ({
16646 struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
16648 __ecereInstance1->id = -1000, __ecereInstance1->idCode = -1000, __ecereInstance1;
16650 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), after, temp);
16651 curExternal = temp;
16652 DeclareFunctionUtil("eSystem_New");
16653 DeclareFunctionUtil("eSystem_New0");
16654 DeclareFunctionUtil("eSystem_Renew");
16655 DeclareFunctionUtil("eSystem_Renew0");
16656 DeclareFunctionUtil("eClass_GetProperty");
16657 DeclareStruct("ecere::com::Class", 0x0);
16658 DeclareStruct("ecere::com::Instance", 0x0);
16659 DeclareStruct("ecere::com::Property", 0x0);
16660 DeclareStruct("ecere::com::DataMember", 0x0);
16661 DeclareStruct("ecere::com::Method", 0x0);
16662 DeclareStruct("ecere::com::SerialBuffer", 0x0);
16663 DeclareStruct("ecere::com::ClassTemplateArgument", 0x0);
16664 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), temp);
16665 for(external = (*ast).first; external; external = external->next)
16667 afterExternal = curExternal = external;
16668 if(external->type == 0)
16670 currentClass = external->function->_class;
16671 ProcessFunction(external->function);
16673 else if(external->type == 1)
16675 currentClass = (((void *)0));
16676 ProcessDeclaration(external->declaration);
16678 else if(external->type == 2)
16680 struct ClassDefinition * _class = external->_class;
16682 currentClass = external->symbol->registered;
16683 if(_class->definitions)
16685 ProcessClass(_class->definitions, _class->symbol);
16689 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove((&*ast), external);
16690 ((external ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(external) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(external)) : 0), external = 0);
16693 else if(external->type == 4)
16695 thisNameSpace = external->id->string;
16698 currentClass = (((void *)0));
16699 thisNameSpace = (((void *)0));
16700 ((temp->symbol ? (__ecereClass_Symbol->Destructor ? __ecereClass_Symbol->Destructor(temp->symbol) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp->symbol)) : 0), temp->symbol = 0);
16701 ((temp ? (__ecereClass_External->Destructor ? __ecereClass_External->Destructor(temp) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(temp)) : 0), temp = 0);
16704 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);
16706 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);
16708 void __ecereRegisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)
16710 struct __ecereNameSpace__ecere__com__Class * class;
16712 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetYydebug", "void SetYydebug(bool b)", SetYydebug, module, 1);
16713 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetThisClass", "void SetThisClass(ecere::com::Class c)", SetThisClass, module, 1);
16714 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetThisClass", "ecere::com::Class GetThisClass(void)", GetThisClass, module, 1);
16715 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintExpression", "void PrintExpression(Expression exp, char * string)", PrintExpression, module, 1);
16716 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessTemplateParameterType", "Type ProcessTemplateParameterType(TemplateParameter param)", ProcessTemplateParameterType, module, 2);
16717 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("NeedCast", "bool NeedCast(Type type1, Type type2)", NeedCast, module, 2);
16718 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt", "char * PrintInt(int64 result)", PrintInt, module, 1);
16719 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt", "char * PrintUInt(uint64 result)", PrintUInt, module, 1);
16720 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintInt64", "char * PrintInt64(int64 result)", PrintInt64, module, 1);
16721 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUInt64", "char * PrintUInt64(uint64 result)", PrintUInt64, module, 1);
16722 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt", "char * PrintHexUInt(uint64 result)", PrintHexUInt, module, 1);
16723 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintHexUInt64", "char * PrintHexUInt64(uint64 result)", PrintHexUInt64, module, 1);
16724 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintShort", "char * PrintShort(short result)", PrintShort, module, 1);
16725 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUShort", "char * PrintUShort(uint16 result)", PrintUShort, module, 1);
16726 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintChar", "char * PrintChar(char result)", PrintChar, module, 1);
16727 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintUChar", "char * PrintUChar(byte result)", PrintUChar, module, 1);
16728 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintFloat", "char * PrintFloat(float result)", PrintFloat, module, 1);
16729 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintDouble", "char * PrintDouble(double result)", PrintDouble, module, 1);
16730 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt", "bool GetInt(Expression exp, int * value2)", GetInt, module, 1);
16731 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt", "bool GetUInt(Expression exp, uint * value2)", GetUInt, module, 1);
16732 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetInt64", "bool GetInt64(Expression exp, int64 * value2)", GetInt64, module, 1);
16733 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUInt64", "bool GetUInt64(Expression exp, uint64 * value2)", GetUInt64, module, 1);
16734 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntPtr", "bool GetIntPtr(Expression exp, intptr * value2)", GetIntPtr, module, 1);
16735 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntPtr", "bool GetUIntPtr(Expression exp, uintptr * value2)", GetUIntPtr, module, 1);
16736 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetIntSize", "bool GetIntSize(Expression exp, intsize * value2)", GetIntSize, module, 1);
16737 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUIntSize", "bool GetUIntSize(Expression exp, uintsize * value2)", GetUIntSize, module, 1);
16738 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetShort", "bool GetShort(Expression exp, short * value2)", GetShort, module, 1);
16739 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUShort", "bool GetUShort(Expression exp, uint16 * value2)", GetUShort, module, 1);
16740 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetChar", "bool GetChar(Expression exp, char * value2)", GetChar, module, 1);
16741 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetUChar", "bool GetUChar(Expression exp, byte * value2)", GetUChar, module, 1);
16742 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetFloat", "bool GetFloat(Expression exp, float * value2)", GetFloat, module, 1);
16743 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetDouble", "bool GetDouble(Expression exp, double * value2)", GetDouble, module, 1);
16744 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeClassMembers", "void ComputeClassMembers(ecere::com::Class _class, bool isMember)", ComputeClassMembers, module, 2);
16745 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeModuleClasses", "void ComputeModuleClasses(ecere::com::Module module)", ComputeModuleClasses, module, 1);
16746 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeTypeSize", "int ComputeTypeSize(Type type)", ComputeTypeSize, module, 1);
16747 __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);
16748 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareStruct", "void DeclareStruct(char * name, bool skipNoHead)", DeclareStruct, module, 2);
16749 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareProperty", "void DeclareProperty(ecere::com::Property prop, char * setName, char * getName)", DeclareProperty, module, 2);
16750 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("Dereference", "Type Dereference(Type source)", Dereference, module, 1);
16751 __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);
16752 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessInstantiationType", "void ProcessInstantiationType(Instantiation inst)", ProcessInstantiationType, module, 2);
16753 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindTemplateArg", "ecere::com::ClassTemplateArgument * FindTemplateArg(ecere::com::Class _class, TemplateParameter param)", FindTemplateArg, module, 2);
16754 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetupTemplatesContext", "Context SetupTemplatesContext(ecere::com::Class _class)", SetupTemplatesContext, module, 1);
16755 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FinishTemplatesContext", "void FinishTemplatesContext(Context context)", FinishTemplatesContext, module, 1);
16756 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessMethodType", "void ProcessMethodType(ecere::com::Method method)", ProcessMethodType, module, 1);
16757 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessPropertyType", "void ProcessPropertyType(ecere::com::Property prop)", ProcessPropertyType, module, 1);
16758 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareMethod", "void DeclareMethod(ecere::com::Method method, char * name)", DeclareMethod, module, 1);
16759 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClass", "char * ReplaceThisClass(ecere::com::Class _class)", ReplaceThisClass, module, 2);
16760 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassType", "Type ReplaceThisClassType(ecere::com::Class _class)", ReplaceThisClassType, module, 2);
16761 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceThisClassSpecifiers", "void ReplaceThisClassSpecifiers(ecere::sys::OldList specs, ecere::com::Class _class)", ReplaceThisClassSpecifiers, module, 2);
16762 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunction", "bool DeclareFunction(ecere::com::GlobalFunction function, char * name)", DeclareFunction, module, 2);
16763 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareGlobalData", "void DeclareGlobalData(GlobalData data)", DeclareGlobalData, module, 2);
16764 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "Conversion", 0, sizeof(struct Conversion), 0, 0, 0, module, 2, 1);
16765 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
16766 __ecereClass_Conversion = class;
16767 __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);
16768 __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);
16769 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ModuleVisibility", "bool ModuleVisibility(ecere::com::Module searchIn, ecere::com::Module searchFor)", ModuleVisibility, module, 1);
16770 __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);
16771 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("MatchTypeExpression", "bool MatchTypeExpression(Expression sourceExp, Type dest, ecere::sys::OldList conversions, bool skipUnitBla)", MatchTypeExpression, module, 2);
16772 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReadString", "void ReadString(char * output, char * string)", ReadString, module, 1);
16773 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetOperand", "Operand GetOperand(Expression exp)", GetOperand, module, 1);
16774 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PopulateInstance", "void PopulateInstance(Instantiation inst)", PopulateInstance, module, 1);
16775 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeInstantiation", "void ComputeInstantiation(Expression exp)", ComputeInstantiation, module, 1);
16776 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CallOperator", "void CallOperator(Expression exp, Expression exp1, Expression exp2, Operand op1, Operand op2)", CallOperator, module, 1);
16777 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeExpression", "void ComputeExpression(Expression exp)", ComputeExpression, module, 1);
16778 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CheckTemplateTypes", "void CheckTemplateTypes(Expression exp)", CheckTemplateTypes, module, 1);
16779 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindSymbol", "Symbol FindSymbol(char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)", FindSymbol, module, 1);
16780 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("PrintType", "void PrintType(Type type, char * string, bool printName, bool fullName)", PrintType, module, 1);
16781 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("FindMemberAndOffset", "Type FindMemberAndOffset(Type type, char * string, uint * offset)", FindMemberAndOffset, module, 1);
16782 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ParseExpressionString", "Expression ParseExpressionString(char * expression)", ParseExpressionString, module, 1);
16783 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
16784 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
16785 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
16786 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
16787 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
16790 void __ecereUnregisterModule_pass15(struct __ecereNameSpace__ecere__com__Instance * module)